matlab解方程老出现is not a valid expression or equation.clear;clc;clf;syms x K R L D T Iref E a tao;K=0.3;R=10;L=12e-3;D=0.4;Iref=5;T=1e-4;E=350;a=E/R;tao=L/R;x=solve('(x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x=0','x')出现错误
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 19:08:53
matlab解方程老出现is not a valid expression or equation.clear;clc;clf;syms x K R L D T Iref E a tao;K=0.3;R=10;L=12e-3;D=0.4;Iref=5;T=1e-4;E=350;a=E/R;tao=L/R;x=solve('(x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x=0','x')出现错误
matlab解方程老出现is not a valid expression or equation.
clear;clc;clf;
syms x K R L D T Iref E a tao;
K=0.3;R=10;L=12e-3;D=0.4;Iref=5;T=1e-4;E=350;
a=E/R;tao=L/R;
x=solve('(x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x=0','x')
出现错误
Error using ==> solve>getEqns at 182
' (x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x=0 ' is not a valid expression or equation.
matlab解方程老出现is not a valid expression or equation.clear;clc;clf;syms x K R L D T Iref E a tao;K=0.3;R=10;L=12e-3;D=0.4;Iref=5;T=1e-4;E=350;a=E/R;tao=L/R;x=solve('(x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x=0','x')出现错误
你可能用的matlab版本比较新, 尽量用符号变量, 避免用字符串:
syms xK=0.3;R=10;L=12e-3;D=0.4;Iref=5;T=1e-4;E=350;
a=E/R;tao=L/R;
x=solve((x-a)*exp(-T/tao)+2*a*exp((-T/tao)*(1-D-K*(Iref-x)))-a-x,x) % 这一行输出x
subs(x) % x的数值结果.
输出为:
x =
-86471113102594225/102882269851877+40*lambertw(2251799813685248/102882269851877*exp(10847469989018732/514411349259385))
ans =
4.42205395667386