排版一下:syms t u(t) v(t) R1 = 1.2e-3; R2 = 9.2e-3; Cin = 1.1e6/60; Cwall = 1.86e8/60; PN =8000; qin=20; qout =0; u1=diff(u); v1=diff(v); eq1 = Cinu1==PN-(u-v)/R1; eq0 = Cinu1==0-(u-v)/R1; eq2 = Cwall*v1==(u-v)/R1-(v-qout)/R2; eq3 = u(0)==20; eq4 = v(0)==z; [uSol1(t), vSol1(t)] = dsolve(eq1,eq2,eq3,eq4); [uSol2(t), vSol2(t)] = dsolve(eq0,eq2,eq3,eq4); figure(1) subplot(1,2,1),fplot3(uSol1,[0 1440],[0 30]); title('开启时室内温度') xlabel('时间'), ylabel('z轴'), zlabel('温度') subplot(1,2,2),fplot3(vSol1,[0 1440],[0 30]); title('开启时墙体温度') xlabel('时间'), ylabel('z轴'), zlabel('温度') figure(2) subplot(1,2,1),fplot3(uSol2,[0 1440],[0 30]); title('关闭时室内温度') xlabel('时间'), ylabel('z轴'), zlabel('温度') subplot(1,2,2),fplot3(vSol2,[0 1440],[0 30]); title('关闭时墙体温度') xlabel('时间'), ylabel('z轴'), zlabel('温度')
时间: 2023-12-06 11:02:02 浏览: 65
syms T06.rar_matlab 正解_matlab程序-正解_机器人运动学
下面是排版后的代码:
```
syms t u(t) v(t) z
R1 = 1.2e-3;
R2 = 9.2e-3;
Cin = 1.1e6/60;
Cwall = 1.86e8/60;
PN = 8000;
qin = 20;
qout = 0;
u1 = diff(u);
v1 = diff(v);
eq1 = Cin*u1 == PN - (u - v)/R1;
eq0 = Cin*u1 == 0 - (u - v)/R1;
eq2 = Cwall*v1 == (u - v)/R1 - (v - qout)/R2;
eq3 = u(0) == 20;
eq4 = v(0) == z;
[uSol1(t), vSol1(t)] = dsolve(eq1, eq2, eq3, eq4);
[uSol2(t), vSol2(t)] = dsolve(eq0, eq2, eq3, eq4);
figure(1)
subplot(1, 2, 1), fplot3(uSol1, [0 1440], [0 30]);
title('开启时室内温度');
xlabel('时间'), ylabel('z轴'), zlabel('温度')
subplot(1, 2, 2), fplot3(vSol1, [0 1440], [0 30]);
title('开启时墙体温度');
xlabel('时间'), ylabel('z轴'), zlabel('温度')
figure(2)
subplot(1, 2, 1), fplot3(uSol2, [0 1440], [0 30]);
title('关闭时室内温度');
xlabel('时间'), ylabel('z轴'), zlabel('温度')
subplot(1, 2, 2), fplot3(vSol2, [0 1440], [0 30]);
title('关闭时墙体温度');
xlabel('时间'), ylabel('z轴'), zlabel('温度')
```
在排版后的代码中,我们添加了符号变量 z 的声明,并对代码进行了缩进和换行,使其更易读。
阅读全文