matlab 用solve或者fsolve求解方程组clcsyms x y z;eq1 =-(31*x*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);eq2 =-(y*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);eq3=exp(29301/2500
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/18 03:48:20
matlab 用solve或者fsolve求解方程组clcsyms x y z;eq1 =-(31*x*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);eq2 =-(y*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);eq3=exp(29301/2500
matlab 用solve或者fsolve求解方程组
clc
syms x y z;
eq1 =-(31*x*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);
eq2 =-(y*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);
eq3=exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625)*((31*x^2)/(10000*z^2) + y^2/(10000*z^2) - 661/625);
[x,y,z]=solve(eq1==0,eq2==0,eq3==0)
Error using ==> char
Conversion to char from logical is not possible.
出现这个问题,怎么回事呢?会不会是方程的系数等级差别太大了,解不了,没有解析解,那要怎么解出数值解呢?
matlab 用solve或者fsolve求解方程组clcsyms x y z;eq1 =-(31*x*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);eq2 =-(y*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z);eq3=exp(29301/2500
solve的参数必须是符号函数,你的eq1,2,3的确是符号函数,可你加了"==0"就变成了判断是否等于0了,即结果是逻辑值0或1,所以出现
Conversion to char from logical is not possible.(不能将逻辑值转换为字符)的错误提示.
要计算式可以计算的:
clc
eq1 ='-(31*x*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z)=0';
eq2 ='-(y*exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625))/(5000*z)=0';
eq3='exp(29301/2500 - (31*x^2)/(10000*z) - y^2/(10000*z) - (661*z)/625)*((31*x^2)/(10000*z^2) + y^2/(10000*z^2) - 661/625)=0';
[x,y,z]=solve(eq1,eq2,eq3)
不过估计会和你说的那样,求不出解析解.