早教吧作业答案频道 -->英语-->
还是昨天那个问题,用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...的网友还看了以下:
基因分离定律和基因自由组合定律,什么时候答哪个?题设问什么问题的时候该答哪个答案,我感觉这俩同时出 2020-05-16 …
命题结论题设在两个命题中,如果第一个命题的题设是第二个命题的结论,而第一个命题的结论是第二个命题的 2020-05-20 …
绝对黑体与温度的关系绝对黑体是不是在任何温度下都是呈现黑色?(不知道这个题设是不是本身就存在问题) 2020-05-21 …
文章的题目一般有什么作用?每篇文章都会有一个题目,那这个题目一般都有什么作用呢? 2020-06-09 …
自控关于欠阻尼二阶系统的一个题设单位反馈1型典型欠阻尼二阶系统,在输入振幅A=1,频率f=5/π信 2020-07-06 …
求助定积分的一个题设y'(x)=e^(x-1)^2,y(0)=0,则∫[0,1]y(x)dx=? 2020-07-12 …
有关均匀分布的一个题设随机变量X的绝对值不大于1,且P{X=0}=1/4,已知当X≠0时,X在其他 2020-07-13 …
我们知道任何一个命题都由题设和结论两部分组成,如果我们把一个命题的题设变结论,结论变题设,那么所得 2020-07-30 …
离散数学等价关系和相容关系问题两个题设R和S是集合A上的等价关系,则RUS的对称性()A.一定成立 2020-08-01 …
帮我做这个题设计制作一个统计降雨量的小仪器—降雨量度量器,并用其进行降雨量统计的试验的试验报告 2020-12-20 …