Matlab求解2元一次方程组syms csyms dti=300R=3.*10.^5k=1.2s=287.*10.^(-6)q0=10h=5qi=0qp1=0qp2=0[c,d]=solve('c=-(q0-qp1-h*(d-ti))/k','-k*(-qi*l/k+c)=h*(-(qi/(2*k))*l^2+c*l+d-ti)-qp2')我这边显示的是The following error occurred converting f

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 11:29:49

Matlab求解2元一次方程组syms csyms dti=300R=3.*10.^5k=1.2s=287.*10.^(-6)q0=10h=5qi=0qp1=0qp2=0[c,d]=solve('c=-(q0-qp1-h*(d-ti))/k','-k*(-qi*l/k+c)=h*(-(qi/(2*k))*l^2+c*l+d-ti)-qp2')我这边显示的是The following error occurred converting f
Matlab求解2元一次方程组
syms c
syms d
ti=300
R=3.*10.^5
k=1.2
s=287.*10.^(-6)
q0=10
h=5
qi=0
qp1=0
qp2=0
[c,d]=solve('c=-(q0-qp1-h*(d-ti))/k','-k*(-qi*l/k+c)=h*(-(qi/(2*k))*l^2+c*l+d-ti)-qp2')
我这边显示的是
The following error occurred converting from sym to double:
Error using ==> sym.double at 25
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable,use the VPA function instead.
请问是什么问题呢?
1楼,我前面已经给这些赋过值了啊,为什么他不会把这些值带进去呢?

Matlab求解2元一次方程组syms csyms dti=300R=3.*10.^5k=1.2s=287.*10.^(-6)q0=10h=5qi=0qp1=0qp2=0[c,d]=solve('c=-(q0-qp1-h*(d-ti))/k','-k*(-qi*l/k+c)=h*(-(qi/(2*k))*l^2+c*l+d-ti)-qp2')我这边显示的是The following error occurred converting f
syms c
syms d
ti=300;
R=3.*10.^5;
k=1.2;
s=287.*10.^(-6);
q0=10;
h=5;
qi=0;
qp1=0;
qp2=0;
[c,d]=solve('c=-(q0-qp1-h*(d-ti))/k','-k*(-qi*l/k+c)=h*(-(qi/(2*k))*l^2+c*l+d-ti)-qp2');
c=subs(c,{'q0','qp1','h','ti','k','qp2','qi'},{q0,qp1,h,ti,k,qp2,qi})
d=subs(d,{'q0','qp1','h','ti','k','qp2','qi'},{q0,qp1,h,ti,k,qp2,qi})
这是正确代码,
c =
- (12*c)/5 - 5*c*l
d =
(6*c)/25 + d + c*l
结果如上.
给分吧,好的话,加送不介意,

c =

1/2*(-4*c*k^2+2*qp1*k+2*k*qi*l+h*qi*l^2-2*h*c*l*k+2*qp2*k)/k



d =

-1/2/h/k*(2*k*qi*l-2*c*k^2+h*qi*l^2-2*h*c*l*k-2*h*d*k+2*qp2*k)
没有问题!