给代码:clear clc syms t u(t) v(t) z=15; 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); eq0 = Cinu1 == 0 - (u - v)/R1; eq1 = Cinu1 == PN - (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), fplot(uSol1, [0 1440]); title('开启时室内温度'); xlabel('时间'), ylabel('温度') subplot(1, 2, 2), fplot(vSol1, [0 1440]); title('开启时墙体温度'); xlabel('时间'), ylabel('温度') figure(2) subplot(1, 2, 1), fplot(uSol2, [0 1440]); title('关闭时室内温度'); xlabel('时间'), ylabel('温度') subplot(1, 2, 2), fplot(vSol2, [0 1440]); title('关闭时墙体温度'); xlabel('时间'), ylabel('温度')加入稳态解u,v
时间: 2024-02-06 17:03:11 浏览: 117
matlab中常见函数功用.pdf
代码已经在前面回答中给出了,这里再次附上代码:
```matlab
clear
clc
syms t u(t) v(t)
z = 15;
R1 = 1.2e-3;
R2 = 9.2e-3;
Cin = 1.1e6/60;
Cwall = 1.86e8/60;
PN = 8000;
qin = 20;
qout = 0;
u_ss = PN*R2/(R1+R2) + qout*R1/(R1+R2);
v_ss = (PN*R2/(R1+R2) + z*R1/(R1+R2))*R1/(R1+R2);
u1 = diff(u);
v1 = diff(v);
eq0 = Cin*u1 == - (u - v)/R1;
eq1 = Cin*u1 == PN - (u - v)/R1;
eq2 = Cwall*v1 == (u - v)/R1 - (v - qout)/R2;
eq3 = u(0) == u_ss;
eq4 = v(0) == v_ss;
[uSol1(t), vSol1(t)] = dsolve(eq1, eq2, eq3, eq4);
[uSol2(t), vSol2(t)] = dsolve(eq0, eq2, eq3, eq4);
figure(1)
subplot(1, 2, 1), fplot(uSol1, [0 1440]);
title('开启时室内温度');
xlabel('时间'), ylabel('温度')
subplot(1, 2, 2), fplot(vSol1, [0 1440]);
title('开启时墙体温度');
xlabel('时间'), ylabel('温度')
figure(2)
subplot(1, 2, 1), fplot(uSol2, [0 1440]);
title('关闭时室内温度');
xlabel('时间'), ylabel('温度')
subplot(1, 2, 2), fplot(vSol2, [0 1440]);
title('关闭时墙体温度');
xlabel('时间'), ylabel('温度')
```
阅读全文