matlab 函数 fmincon求解非线性规划,求这个函数的最小值 function f = myfun(x)f = (pi*(x(3)+2)*x(2)*x(1)^2)/4;运行后返回(约束在最后面有写)Warning:Trust-region-reflective method does not currently solve this type of prob

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 15:02:59
matlab 函数 fmincon求解非线性规划,求这个函数的最小值 function f = myfun(x)f = (pi*(x(3)+2)*x(2)*x(1)^2)/4;运行后返回(约束在最后面有写)Warning:Trust-region-reflective method does not currently solve this type of prob

matlab 函数 fmincon求解非线性规划,求这个函数的最小值 function f = myfun(x)f = (pi*(x(3)+2)*x(2)*x(1)^2)/4;运行后返回(约束在最后面有写)Warning:Trust-region-reflective method does not currently solve this type of prob
matlab 函数 fmincon求解非线性规划,
求这个函数的最小值 function f = myfun(x)
f = (pi*(x(3)+2)*x(2)*x(1)^2)/4;
运行后返回(约束在最后面有写)
Warning:Trust-region-reflective method does not currently solve this type of problem,
using active-set (line search) instead.
> In fmincon at 439
Solver stopped prematurely.
fmincon stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 300 (the default value).
x =
4.0499
14.0013
1.0013
FVAL =
541.3289
说是这个trust……解不了这个问题,那么该怎么改一下?help过没发现怎么改……
非线性约束 function [c,ceq] = mycon(x)
k=1.6*(x(1)/x(2))^0.14; %曲度系数
F=13; %最大力
f=20.2416; %气门最大升程
G=8100; %切变模量
w=1500; %凸轮轴转速
c(1) =8*k*F*x(2)/(pi*x(1)^3)-51; %切应力
c(2) =((x(3)+2-0.5)+1.2*f)/x(2)-5.3 ; %稳定性约束
c(3) =((G*x(1)^4*1.2*f/(8*x(2)^3*x(3)))*8*k*x(2))/(pi*x(1)^3); %极限切应力?
c(4) =10*w-3.56*10^5*x(1)/(x(2)^2*x(3)) ; %无共振
ceq = [];
主函数 [x,FVAL] = fmincon(@myfun,[2.5; 21; 7],[4 -1 0;-18 1 0],[0;0],[],[],[2.2;16;3],[3.5;28;Inf],@mycon(x))

matlab 函数 fmincon求解非线性规划,求这个函数的最小值 function f = myfun(x)f = (pi*(x(3)+2)*x(2)*x(1)^2)/4;运行后返回(约束在最后面有写)Warning:Trust-region-reflective method does not currently solve this type of prob
主要问题:
1、关于Trust-region-reflective算法的警告
该类方法不适用于存在非线性约束的情况,所以用警告的方式提示你使用别的方法.如果不介意看到警告信息,直接忽略无妨;如果不想看到警告,主程序可以这样调用:
opt=optimset('Algorithm','active-set',);
x0=[2.5 21 7];
[x,FVAL] = fmincon(@myfun,x0,[4 -1 0;-18 1 0],[0;0],[],[],[2.2;16;3],[3.5;28;Inf],@mycon,opt)
2、程序现在最大的问题是,你给出的初始解不在可行域内,也就是说,不满足你的所有约束条件(很容易验证,不满足非线性不等式约束c(x)

关于信任域那个,见matlab帮助
use 'trust-region-reflective' when
applicable. Your problem must have: objective function includes gradient,
only bounds, or only linear equality constraints (but not bot...

全部展开

关于信任域那个,见matlab帮助
use 'trust-region-reflective' when
applicable. Your problem must have: objective function includes gradient,
only bounds, or only linear equality constraints (but not both).
在matlab help的Choosing a Solver部分。
有推荐使用。
你后面的程序好似也有不少问题。

收起

求matlab中fmincon函数格式的中文解释? MATLAB中fmincon函数用的什么算法 matlab fmincon函数中的迭代初值怎么确定 有关matlab中 fmincon问题在利用matlab中fmincon求解非线性规划问题时(x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options))目标函数fun十分复杂,在求解x的同时,fun中需要另外一些临时输入的常数,此时fun函 matlab 求解最小值问题fmincon函数,在迭代过程中,如何输出每一步的变量值,需要设置一些什么东西 Matlab有约束的多元函数的最小值!在约束条件中,出现等式,怎样计算?比如说,有X1+X2+X3=50,还有一些不等式,用fmincon或是linprog函数怎么求解,有多个等式,怎样作呢? matlab中fmincon函数中不含等号的边界值怎么设置?matlab中fmincon函数的不含等号的边界值怎么设置?fmincon中默认的边界条件是lb matlab 求解优化问题,过程信息显示用matlab优化函数【比如fmincon等】 求解优化问题时,总是显示一大堆的优化过程信息【比如用什么算法,迭代次数,梯度等】,请问,如何屏蔽这些信息的显示?------ MATLAB里fmincon为什么上下限不起作用? 关于matlab最优化中fmincon函数主函数:x0=[0.1 0.05 3.5];lb=[0 0 3];ub=[0.8 0.6 10];a=[-1 1 0;-1 0 0;0 -1 0;0 0 -1];b=[0 0 0 -3]';options=optimset('tolcon',1e-8);[x,fval]=fmincon(@cdz_f,x0,a,b,[],[],lb,ub,@cdz_v,options)辅助函数(非 MATLAB,fmincon解题原理是什么?请问高手,MATLAB中fmincon函数的解题原理是什么?他是根据具体什么算法实现的?比如是内点法?还是其他什么算法?谢谢 matlab fmincon 约束函数 能不能用表达式?matlab fmincon 约束函数的编写,能不能用表达式?比如[x,f]=fmincon('target',x0,A,b,[],[],[],[],'gearcon') %约束条件函数 function [c,cep]=gearcon(x)c(1)=x(1)*x(2)-6;这里能不能 matlab 函数 fmincon求解非线性规划,求这个函数的最小值 function f = myfun(x)f = (pi*(x(3)+2)*x(2)*x(1)^2)/4;运行后返回(约束在最后面有写)Warning:Trust-region-reflective method does not currently solve this type of prob matlab非线性规划fmincon函数中目标函数参数传递问题,fmincon函数的标准形式维[x,fval]=fmincon('fun',Bt0,[],[],[],[],lb,ub,@constr),然后fun是目标函数,Bt0为初值点,优化函数相当于讲Bt0带入fun,逐渐逼近求局 matlab中的fmincon具体怎么用?接替原理是什么? 用matlab解决非线性线性规划问题直接上图哪个大神知道,帮忙用fmincon函数把上面模型程序写出来, 使用matlab的fmincon优化,一直提示变量“x”未定义,使用matlab的fmincon函数进行优化,遇到以下问题:%以下是建立的目标函数M文件function f = CostObj( x ) % 目标函数a=[1 3 5];b=[2 4 6];c=0*ones(1,3);for i=1:3c(i Matlab fmincon 目标函数问题Matlab中fmincon的目标函数需要根据需要而变化,就是需要处理大量的数据,每次带入一个数据目标函数都会变化,如何向其中传递变量?e.gfunction f=myconj(x)f=A*x;%A变量随着外