分析一下这个matlab运行结果>> clear>> x0=[-1,1];>> fun='(x(1)+(sqrt(225*(x(2)-x(1))^2-(x(1)^2)*(x(2)^2)+450*x(1)*x(2)-50625)))/x(2)';>> Lb=[0,0];>> Ub=[];>> options=[];>> [x,fval,exitflag,output]=fmincon(fun,x0,[],[],[],[],Lb,Ub,[],[],option
来源:学生作业帮助网 编辑:作业帮 时间:2024/12/02 16:29:19
分析一下这个matlab运行结果>> clear>> x0=[-1,1];>> fun='(x(1)+(sqrt(225*(x(2)-x(1))^2-(x(1)^2)*(x(2)^2)+450*x(1)*x(2)-50625)))/x(2)';>> Lb=[0,0];>> Ub=[];>> options=[];>> [x,fval,exitflag,output]=fmincon(fun,x0,[],[],[],[],Lb,Ub,[],[],option
分析一下这个matlab运行结果
>> clear
>> x0=[-1,1];
>> fun='(x(1)+(sqrt(225*(x(2)-x(1))^2-(x(1)^2)*(x(2)^2)+450*x(1)*x(2)-50625)))/x(2)';
>> Lb=[0,0];
>> Ub=[];
>> options=[];
>> [x,fval,exitflag,output]=fmincon(fun,x0,[],[],[],[],Lb,Ub,[],[],options)
Warning:Large-scale (trust region) method does not currently solve this type of problem,
switching to medium-scale (line search).
> In C:\MATLAB6p5\toolbox\optim\fmincon.m at line 213
Optimization terminated successfully:
Magnitude of directional derivative in search direction
less than 2*options.TolFun and maximum constraint violation
is less than options.TolCon
Active Constraints:
1
x =
0.0001 1.0000
fval =
1.0000e-004 +2.2450e+002i
exitflag =
1
output =
iterations:2
funcCount:25
stepsize:-6.1035e-005
algorithm:'medium-scale:SQP,Quasi-Newton,line-search'
firstorderopt:2.9367e-004
cgiterations:[]
%请问最后得到的x(1)和x(2)应该取多少才能得到minf(x)啊?
分析一下这个matlab运行结果>> clear>> x0=[-1,1];>> fun='(x(1)+(sqrt(225*(x(2)-x(1))^2-(x(1)^2)*(x(2)^2)+450*x(1)*x(2)-50625)))/x(2)';>> Lb=[0,0];>> Ub=[];>> options=[];>> [x,fval,exitflag,output]=fmincon(fun,x0,[],[],[],[],Lb,Ub,[],[],option
x(1)=0.0001 x(2)=1.0000