早教吧作业答案频道 -->英语-->
还是昨天那个问题,用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-23 …
用同样的方砖铺地铺二十平米呀320块如果仆42平方米要用多少块方砖用比例解决问题用同样的方砖铺地铺 2020-06-14 …
初一乘方应用题.1.截止2010年,我国约有7.4乘10的7次方辆民用汽车,按平均每辆车的车身长为 2020-07-04 …
用方程解应用题1.今年“3.15”期间,某城市因商品质量问题投诉的消费者有408人,比去年同期投用 2020-07-18 …
一元一次方程应用题在一次过关测试中有2道应用题,分别为"配套问题”和“行程问题”,其中有15位同学 2020-07-25 …
有理数的乘方(应用题)(悬赏分100) 2020-07-30 …
有理数的除法与乘方应用题1.某制药厂的一个冷库室温度是-3摄氏度,现有一批药品要在-24摄氏度冷藏, 2020-11-30 …
六年级一道乘方应用题,节省零用钱是学生的好习惯,如果你第一个月节省2元,第二个月节省4元,第三个月节 2020-12-27 …
问几道初一数学应方程用题1、一艘游船在静水中的航行速度是14千米/时,水流速度是2千米/时,游船从A 2021-01-15 …