早教吧作业答案频道 -->英语-->
还是昨天那个问题,用matlab优化一个方程,d=x-(x*x-40-6*a*x)^(0.5),多一个条件,x在10到20之间,a在0到1之间,求d取最小值,同时a尽可能的接近1.如果要加权的话,就随便设一个,要过程,麻烦您了请问
题目详情
还是昨天那个问题,用matlab优化一个方程, d=x-(x*x-40-6*a*x)^(0.5) ,多一个条件, x在10到20之间, a在0到1之间,求d取最小值,同时a尽可能的接近1 . 如果要加权的话,就随便设一个, 要过程,麻烦您了
请问怎么加权重呢,比如a的权取0.2 ,d取0.8
请问怎么加权重呢,比如a的权取0.2 ,d取0.8
▼优质解答
答案和解析
[x,feval,flag]= fmincon(@(x)x(1)-(x(1)*x(1)-40-6*x(2)*x(1))^(0.5),[11;0.9],[],[],[],[],[10 0],[20 1])
Warning: Trust-region-reflective method does not currently solve this type of problem,
using active-set (line search) instead.
> In fmincon at 439
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
2 1
x =
20
0
feval =
1.0263
flag =
1
d取最小值,同时a尽可能的接近1,这有个权重,d取最小值,a=0,a尽可能的接近1,d就不是最小值
你可以看下三维图,用下面的语句画图
ezsurf('x-(x.*x-40-6*y*x)^(0.5)',[10 20 0 1])
Warning: Trust-region-reflective method does not currently solve this type of problem,
using active-set (line search) instead.
> In fmincon at 439
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
2 1
x =
20
0
feval =
1.0263
flag =
1
d取最小值,同时a尽可能的接近1,这有个权重,d取最小值,a=0,a尽可能的接近1,d就不是最小值
你可以看下三维图,用下面的语句画图
ezsurf('x-(x.*x-40-6*y*x)^(0.5)',[10 20 0 1])
看了 还是昨天那个问题,用matl...的网友还看了以下:
,直线l过A(4,0)和B(0,4)两点,它与二次函数y=ax^2+2的图像在第一象限而相交于P点 2020-05-13 …
懂的进.函数y=Asin(wx+a)(A>0,w>0,3π\2<a<2π)的最小值是-3,周期为π 2020-05-16 …
【懂数学的高人快来吧!快来吧!】急,麻烦数学高人帮忙再详细解释一遍一道题的解答过程,谢谢如题:(文 2020-05-17 …
指数函数的题目一般的解法以这题为例函数f(x)=a^2x+2a^x-1(a>0,a不等于1)在区间 2020-06-03 …
还是昨天那个问题,用matlab优化一个方程,d=x-(x*x-40-6*a*x)^(0.5),多 2020-06-23 …
椭圆与抛物线相交椭圆:x/a+y/b=1(b>a>0)抛物线:x=2py(p>0)的交点分别为AB 2020-06-29 …
关于椭圆的一道选择题椭圆x2/a2+y2/b2=1(a>b>0)的左焦点F到过顶点A(-a,0), 2020-06-30 …
Pr[A]=0.45,Pr[B]=0.55,Pr[A'∩B]=0.3.求(1)Pr[B'∩A]=( 2020-07-22 …
正切函数值表别复制密密麻麻一大片啊!我想要带π(派)的那种,比如π/6是三分之根号三,这样的就行了 2020-08-01 …
要解题过程(举例)的.1.A真包含于B是A交B等于A的()填充分非必要条件或必要非充分条件2.若AB 2020-12-07 …