带有非线性约束的非线性方程优化 编出程序提示错误 求助。
Show older comments
目标函数
Function v=myfun(x)
v=0.25*3.14*x(1)^2*x(2);
约束
function [c,ceq]=mycon(x)
%约束条件
c(1)=24000-0.25*3.14*0.8*63.347*x(1)^(2/3)*x(2)-0.25*3.14*(0.8)^(1/3)*450*x(1)^(5/3);
c(2)=24000-3.14* 63.347 *x(1)*x(2)-0.25*3.14*(25000-25*x(1))*(x(1)^2);
c(3)=4*1/3.14*1/2000*24000*1/(x(1)^2)*x(2)+1/3.14*1/20000*24000*1/x(1)*1/x(2)-0.04 ;
ceq=[];
主程序
l=[0;0]; %下限
x0=[0;0]; %赋初值
[x,favl,exitflag]=fmincon(@myfun,x0,[],[],[],[],l,[],@mycon)
程序运行后提示如下截图

Accepted Answer
More Answers (0)
Categories
Find more on Global or Multiple Starting Point Search in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!