Matlab求解2元一次方程组
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/17 12:01:15
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楼,我前面已经给这些赋过值了啊,为什么他不会把这些值带进去呢?
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楼,我前面已经给这些赋过值了啊,为什么他不会把这些值带进去呢?
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
结果如上.
给分吧,好的话,加送不介意,
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
结果如上.
给分吧,好的话,加送不介意,