RLC电路的微分方程求解:请在一张图上绘制如下图所示的串联RLC回路的三种阶跃响应:欠阻尼响应、过阻尼响应、临界阻尼响应,横坐标为时间t,纵坐标为uC。零时刻电路无能量,U为电压源48 V,C=学号后两位,单位μF,L=学号后两位,单位mH,阻尼电阻R值可依据阶跃响应类型选取。
%2022.6.19
%by 秦舞阳
tspan=[0,0.04];
y0=[0;0];
[t,YY]=ode45('DYDt50',tspan,y0);
plot(t,YY(:,1));
hold on
[t,YY]=ode45('DYDt51',tspan,y0);
plot(t,YY(:,1));
hold on
[t,YY]=ode45('DYDt52',tspan,y0);
plot(t,YY(:,1));
hold on
xlabel("t/Second");
ylabel("uc/V");
legend('欠阻尼','临界阻尼','过阻尼')
function yd=DYDt50(t,y)
U=48;
R1=40;
R2=0;
C=16e-6;
L=16e-3;
yd=[-(1/(R1*C))*y(1)-(1/C)*y(2)+(1/(R1*C))*U;(1/L)*y(1)-(R2/L)*y(2)];
function yd=DYDt51(t,y)
U=48;
R1=4;
R2=0;
C=16e-6;
L=16e-3;
yd=[-(1/(R1*C))*y(1)-(1/C)*y(2)+(1/(R1*C))*U;(1/L)*y(1)-(R2/L)*y(2)];
function yd=DYDt52(t,y)
U=48;
R1=0.4;
R2=0;
C=16e-6;
L=16e-3;
yd=[-(1/(R1*C))*y(1)-(1/C)*y(2)+(1/(R1*C))*U;(1/L)*y(1)-(R2/L)*y(2)];
运行结果: