matlab带参数的二元函数求最大值问题
symsvx1x2gL1L2S=(v^2*sin(2*x2)+2*v*sin(x2)*sqrt(v^2*(cos(x2))^2+2*g*(L1*sin(x1)+L2*si...
syms v x1 x2 g L1 L2 S=(v^2*sin(2*x2)+2*v*sin(x2)*sqrt(v^2*(cos(x2))^2+2*g*(L1*sin(x1)+L2*sin(x2))))/(2*g) Sx1=diff(S,x1); Sx2=diff(S,x2); solve(Sx1,'x1') solve(Sx2,'x2') ??? Error using ==> solve Unable to find closed form solution. Error in ==> sym.solve at 49 [varargout{1:max(1,nargout)}] = solve(S{:}); Error in ==> pirandao2 at 6 solve(Sx2,'x2')
展开
1个回答
展开全部
f
=
@(x)
-5-1350*(1-x(1))^(2.9)-1350*x(1)^3*((1-x(2))^(2.9)-(1-x(1))^(2.9))-135*x(2)^3*(1-10*(1-x(2)^(2.9)))
lb
=
[0.8;
0.6];
%
x
y的下限
ub
=
[1;
0.8]
;
%
x
y的上限
x0
=
[0.5;0.6];
%
starting
guess
at
the
solution
[x1,fval1]
=
fmincon(f,x0,[],[],[],[],lb,ub);
xmax2
=
x1(1)
%
极值点x的值
ymax2
=
x1(2)
%
极值点y的值
zmax2
=
-fval1
%
z的最大值
计算结果:
xmax2
=
1
ymax2
=
0.6
zmax2
=
-96.4625
=
@(x)
-5-1350*(1-x(1))^(2.9)-1350*x(1)^3*((1-x(2))^(2.9)-(1-x(1))^(2.9))-135*x(2)^3*(1-10*(1-x(2)^(2.9)))
lb
=
[0.8;
0.6];
%
x
y的下限
ub
=
[1;
0.8]
;
%
x
y的上限
x0
=
[0.5;0.6];
%
starting
guess
at
the
solution
[x1,fval1]
=
fmincon(f,x0,[],[],[],[],lb,ub);
xmax2
=
x1(1)
%
极值点x的值
ymax2
=
x1(2)
%
极值点y的值
zmax2
=
-fval1
%
z的最大值
计算结果:
xmax2
=
1
ymax2
=
0.6
zmax2
=
-96.4625
黄先生
2024-12-27 广告
2024-12-27 广告
矩阵切换器就是将一路或多路视音频信号分别传输给一个或者多个显示设备,如两台电脑主机要共用一个显示器,矩阵切换器可以将两台电脑主机上的内容renyi切换到同一个或多个显示器上;迈拓维矩矩阵切换器种类齐全,性价比高,支持多种控制方式,为工程商采...
点击进入详情页
本回答由黄先生提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询