当前位置:编程学习 > Matlab >>

matlab最优化的问题,非线性约束~~~急求解答啊。程序写好了,就是有BUG~~~也不知道为什么

mycon.m文件 function [c,ceq]=mycon(x) c=[0.1*1000*log2(1+x(1)/(10^0.1*(80^(-4)*x(2)+60^(-4)*x(3))+10^(-10))-b*x(1));0.1*1000*log2(1+x(2)/(10^0.1*(80^(-4)*x(1)+70^(-4)*x(3))+10^(-10))-b*x(2));0.1*1000*log2(1+x(3)/(10^0.1*(60^(-4)*x(1)+70^(-4)*x(2))+10^(-10))-b*x(2));(x(1)/(10^0.1*(10^0.1*(80^(-4)*x(2)+60^(-4)*x(3)))+10^(-10)))-42;(x(2)/(10^0.1*(10^0.1*(80^(-4)*x(1)+70^(-4)*x(3)))+10^(-10)))-42;(x(3)/(10^0.1*(10^0.1*(60^(-4)*x(1)+70^(-4)*x(2)))+10^(-10)))-42;0.001-10^0.1*100^(-4)*(x(1)+x(2)+x(3))-10^(-10);]; ceq=0; fun.m文件 function f=fun(x) f=-(x(1)+x(2)+x(3)); main.m文件 VLB=[0 0 0];VUB=[]; [x,fval,exitflag,output]=fmincon('fun',[100;70;36],[],[],[],[],VLB,VUB,'mycon');
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,