matlab写公式五元二次方程组用matlab能写出来吗?请给个例子
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/08/24 20:47:30
matlab写公式
五元二次方程组用matlab能写出来吗?请给个例子
五元二次方程组用matlab能写出来吗?请给个例子
给个例子,注意并不是所有的五元二次方程组都有解.
syms x y z s t
f1=x+y-z+s+t;
f2=x^2-y^2+2*z;
f3=x*y+s*t;
f4=z-s*t;
f5=x^2+y^2-2*t;
[x,y,z,s,t]=solve(f1,f2,f3,f4,f5);
解得:
x =
0
1/2*2^(1/2)
1/2*2^(1/2)
-1/2*2^(1/2)
-1/2*2^(1/2)
y =
0
1+(-2-2*2^(1/2))^(1/2)
1-(-2-2*2^(1/2))^(1/2)
1+(-2+2*2^(1/2))^(1/2)
1-(-2+2*2^(1/2))^(1/2)
z =
0
-(2^(1/2)-1)*(1+(-2-2*2^(1/2))^(1/2))/(1/2*2^(1/2)*(1+(-2-2*2^(1/2))^(1/2))-1/2*2^(1/2)-1-(-2-2*2^(1/2))^(1/2))
-(2^(1/2)-1)*(1-(-2-2*2^(1/2))^(1/2))/(1/2*2^(1/2)*(1-(-2-2*2^(1/2))^(1/2))-1/2*2^(1/2)-1+(-2-2*2^(1/2))^(1/2))
-(-1-2^(1/2))*(1+(-2+2*2^(1/2))^(1/2))/(-1/2*2^(1/2)*(1+(-2+2*2^(1/2))^(1/2))+1/2*2^(1/2)-1-(-2+2*2^(1/2))^(1/2))
-(-1-2^(1/2))*(1-(-2+2*2^(1/2))^(1/2))/(-1/2*2^(1/2)*(1-(-2+2*2^(1/2))^(1/2))+1/2*2^(1/2)-1+(-2+2*2^(1/2))^(1/2))
s =
0
1/(1/2*2^(1/2)*(1+(-2-2*2^(1/2))^(1/2))-1/2*2^(1/2)-1-(-2-2*2^(1/2))^(1/2))*(1+(-2-2*2^(1/2))^(1/2))
1/(1/2*2^(1/2)*(1-(-2-2*2^(1/2))^(1/2))-1/2*2^(1/2)-1+(-2-2*2^(1/2))^(1/2))*(1-(-2-2*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