早教吧作业答案频道 -->英语-->
还是昨天那个问题,用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...的网友还看了以下:
数学问题关于三角和最值还有充分条件的已知函数f(x)=4sin(π/4+x)-2根号三cos2x- 2020-04-07 …
已知点P在曲线y=4/e^x+1上,α为曲线在点P处的切线的倾斜角,则α的取值范围是y=4/[(e 2020-04-11 …
已知点P在曲线y=4/(e^x+10)上,a为曲线在点P处的切线的倾斜角,则a的取值范围是()A[ 2020-04-11 …
已知点P在曲线y=4/(e^x+1)上,a为曲线在点P处的切线的倾斜角,则a的取值范围是y=4/[ 2020-04-11 …
某商品的进价为30元/件,试销期间商品定价x元/件与销量y件存在的函数关系式的图像如图所示(1)求 2020-04-27 …
求z=x-y的最大值和最小值使式中的xy满足线性规划条件x+2y求z=x-y的最大值和最小值使式中 2020-07-21 …
已知某产品的总成本函数为C(X)=x的平方+2x+100(C:千元;X:百件)又每百件产品的销售价 2020-07-26 …
(1)求z=x+3y的最大值,使式中的x、y满足约束条件2x+3y≤24,x-y≤7,y≤6,x≥0 2020-10-30 …
y=4/[(e^x)+1]∴对x求导,最后得y'=(-4e^x)/(1+e^x)²=(-4)/[(e 2020-10-31 …
设x,y满足条件x-y+5≥0,x+y≥0,x≤3.(1)求u=x^2+y^2的最大值和最小值(2) 2020-11-01 …