| 查看: 2040 | 回复: 2 | ||
[求助]
fmincon函数求解非线性约束优化问题出错已有1人参与
|
|
我用fmincon函数求解一个非线性约束优化问题总是算不出结果,不知道哪里出问题了,求大佬帮忙看看,一下是代码: x0=[3.6;0.8;19;7.8;7.6;3.5;5.2]; A=[];b=[]; Aeq=[];beq=[]; lb=[2.6;0.7;17;7.3;7.3;2.9;5.0];ub=[3.6;0.8;28;8.3;8.3;3.9;5.5]; [x,fval,exitflag,output,lambda,grad,hessian]=fmincon(@myfun,x0,A,b,Aeq,beq,lb,ub,@mycon); function [c,ceq] = mycon(x) c(1)=27/(x(1)*x(2)^2*x(3))-1; c(2)=397.5/(x(1)*x(2)^2*x(3)^2)-1; c(3)=1.93*x(4)^3/(x(2)*x(3)*x(6)^4)-1; c(4)=1.93*x(5)^3/(x(2)*x(3)*x(7)^4)-1; c(5)= 10*x(6)^(-3)*sqrt((745*x(2)^(-1)*x(3)^(-1)*x(4))^2+1.69*10^7)-1100; c(6)=10*x(7)^(-3)*sqrt((745*x(2)^(-1)*x(3)^(-1)*x(5))^2+1.575*10^8)-850; c(7)=(1.5*x(6)+1.9)/x(4)-1; c(8)=(1.1*x(7)+1.9)/x(5)-1; c(9)=x(2)*x(3)-40; c(10)=5-x(1)/x(2); c(11)=x(1)/x(2)-12; ceq = []; function y = myfun(x) y = 0.7854*x(1)*x(2)^2*(3.333*x(3)^2+14.9334*x(3)-43.0934)-1.5079*x(1)*(x(6)^2+x(7)^2)+7.477*(x(6)^3+x(7)^3)+0.7854*(x(4)*x(6)^2+x(5)*x(7)^2); 以下是MATLAB里的提示: 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 optimality tolerance, and constraints are satisfied to within the default value of the constraint tolerance. <stopping criteria details> Optimization completed: The relative first-order optimality measure, 7.082717e-09, is less than options.OptimalityTolerance = 1.000000e-06, and the relative maximum constraint violation, 0.000000e+00, is less than options.ConstraintTolerance = 1.000000e-06. Optimization Metric Options relative first-order optimality = 7.08e-09 OptimalityTolerance = 1e-06 (default) relative max(constraint violation) = 0.00e+00 ConstraintTolerance = 1e-06 (default) 由于是第一次用MATLAB来求解优化问题,所很多地方不懂,请多多指教,谢谢各位大神了。 |
» 猜你喜欢
三甲基碘化亚砜的氧化反应
已经有4人回复
请问下大家为什么这个铃木偶联几乎不反应呢
已经有5人回复
请问有评职称,把科研教学业绩算分排序的高校吗
已经有5人回复
孩子确诊有中度注意力缺陷
已经有12人回复
2025冷门绝学什么时候出结果
已经有3人回复
天津工业大学郑柳春团队欢迎化学化工、高分子化学或有机合成方向的博士生和硕士生加入
已经有4人回复
康复大学泰山学者周祺惠团队招收博士研究生
已经有6人回复
AI论文写作工具:是科研加速器还是学术作弊器?
已经有3人回复
论文投稿,期刊推荐
已经有4人回复
硕士和导师闹得不愉快
已经有13人回复
2楼2018-05-23 02:25:44
3楼2018-05-23 14:25:12














回复此楼