早教吧作业答案频道 -->英语-->
matlab问题,高分求matlab求三元方程的极值.形式如图片,这个式子应该有一个最大值,我就是想求得这个值是多少,是不是1,如果是如何得到的,最好能有一个程序求出.再写一下 如果用xz-x+1>0与xz-y
题目详情
matlab问题,高分求matlab求三元方程的极值.
形式如图片,这个式子应该有一个最大值,我就是想求得这个值是多少,是不是1,如果是如何得到的,最好能有一个程序求出.
再写一下 如果用xz-x+1>0与xz-y-1>0约束一下,看是否有最值,我的想法是如果约束后那么(x-1)(1+y-xz)-(1+y)(x-1)+(xz)^2=xz(xz-x+1)>0,说明整个值是小于1的.
形式如图片,这个式子应该有一个最大值,我就是想求得这个值是多少,是不是1,如果是如何得到的,最好能有一个程序求出.
再写一下 如果用xz-x+1>0与xz-y-1>0约束一下,看是否有最值,我的想法是如果约束后那么(x-1)(1+y-xz)-(1+y)(x-1)+(xz)^2=xz(xz-x+1)>0,说明整个值是小于1的.
▼优质解答
答案和解析
如果用xz-x+>0与xz-y-1>0约束一下,第一个约束不清晰
xz-x+>0====》xz-x+1>0
function aa
y=@(x)-(x(1)-1).*(1+x(2)-x(1).*x(3))./((1+x(2)).*(x(1)-1)-(x(1).*x(3)).^2);
[X,FVAL,EXITFLAG] =fmincon(y,[1.5 1 0.5],[],[],[],[],[1 0 0],[inf inf 1],@(x)con(x))
function [c,cq]=con(x)
c(1)=-x(1).*x(3)+x(1)-1;
c(2)=1+x(2)-x(1).*x(3);
cq=[];
Warning: Trust-region-reflective algorithm does not solve this type of problem, using
active-set algorithm. You could also try the interior-point or sqp algorithms: set the
Algorithm option to 'interior-point' or 'sqp' and rerun. For more help, see Choosing the
Algorithm in the documentation.
> In fmincon at 472
In AAAA at 3
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 function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1 3 1
2 2
X =
1 0 1
FVAL =
0
EXITFLAG =
1
这个式子的最大值,估计是趋于0的
(x-1)(1+y-xz)-(1+y)(x-1)+(xz)^2化简后为
xz(xz-x+1)没错
可是x>1 01/x xz(xz-x+1)
xz-x+>0====》xz-x+1>0
function aa
y=@(x)-(x(1)-1).*(1+x(2)-x(1).*x(3))./((1+x(2)).*(x(1)-1)-(x(1).*x(3)).^2);
[X,FVAL,EXITFLAG] =fmincon(y,[1.5 1 0.5],[],[],[],[],[1 0 0],[inf inf 1],@(x)con(x))
function [c,cq]=con(x)
c(1)=-x(1).*x(3)+x(1)-1;
c(2)=1+x(2)-x(1).*x(3);
cq=[];
Warning: Trust-region-reflective algorithm does not solve this type of problem, using
active-set algorithm. You could also try the interior-point or sqp algorithms: set the
Algorithm option to 'interior-point' or 'sqp' and rerun. For more help, see Choosing the
Algorithm in the documentation.
> In fmincon at 472
In AAAA at 3
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 function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1 3 1
2 2
X =
1 0 1
FVAL =
0
EXITFLAG =
1
这个式子的最大值,估计是趋于0的
(x-1)(1+y-xz)-(1+y)(x-1)+(xz)^2化简后为
xz(xz-x+1)没错
可是x>1 01/x xz(xz-x+1)
看了 matlab问题,高分求ma...的网友还看了以下:
因式分解的填空题(x+y)^2=;(a-b)^3=分解因式:x^3-x=若x^2+2(m-3)x+1 2020-03-31 …
如果(m-1)x^4+x^n+x+1是二次三项式,求mnoh my gady!偶写错鸟,打错鸟.. 2020-05-13 …
数学:如果m,n满足等式x^2+mx-15=(x+3)(x+n)求m+n的值1.如果m,n满足等式 2020-05-17 …
已知x+y=m求9(x+y)^2(2x+2y)^2(3x+3y)^2的值怎么算 2020-05-17 …
若(3x+2y-10)0无意义且2x+y=5求x.y(注意是0次方)已知x+x-1=m求x2+x- 2020-06-03 …
二次函数y=x^-(m+1)x+m求在x轴上的点a用m表示要方法 2020-06-12 …
初一数学难题3x^2*y^|m|-(m-1)y+5是关于x,y的三次三项式,则m=()如果(m+1 2020-07-31 …
是否存在整数m使得关于x的不等式1/m+3x/m²>x/m.1/m+3x/m²>x/m+3/m²与 2020-08-03 …
已知函数f(x)=ax^2+bx+c(a>0),同时满足:1.函数g(x)=ax+b在[-1,1]上 2020-12-19 …
(1)25(x+2)2次方-36=0求x的值,记住是(x+2)的2次方.(2)若a是(-2)的2次方 2020-12-31 …