早教吧作业答案频道 -->英语-->
还是昨天那个问题,用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...的网友还看了以下:
解方程,加一道化简求值的题目.解方程:(1):2/x+3=1/x-1(2):x/x-3=2+3/x- 2020-03-31 …
关于x的一元二次方程kx^2+(k+2)x+k/4=0,k取何值时,该方程(你看不懂,我在把题读一 2020-05-13 …
十进制数11与二进制数2相加的结果是(0101)2的2是什么意思? 2020-05-14 …
已知p:方程x平方加mx加1=0有两个不等的负根:q:方程4x平方加4(m减2)x加1=0无实跟, 2020-05-15 …
修改病句.1.今天讲了一个动人的故事.2.程强的姐姐是一名优良的工人代表.3.我穿好队 2020-06-12 …
55分之19的分子、分母同时加一个相同的数,得到的新分数约分后是5分之2.所加的数是几? 2020-07-17 …
我会列式计算.①73.46的2.7倍是多少?②一个数除以2.4,积是3.62,这个数是多少?③20 2020-07-18 …
那2×9和9×2的意义相同吗?我认为乘和乘以都不区分了,他们的意义相同,但同事说不同.说2乘9只能 2020-07-20 …
基础写作下图是我国近10年私人汽车拥有情况.[写作内容]请根据以上数据,写一篇短文,包括以下内容:1 2020-12-01 …
假定你是李华,得悉你校的国外友好学校来你校参观,你申请担任向导,请写一份邮件给你校的负责老师,申请参 2020-12-15 …