📄 exp3_1.m
字号:
clear
clc
close
t0=0;
tfinal=15;
x0=[0.5;0]; %初始化,电感电流为0,电容电压为0.5v
%tol=0.001; %数值计算精度
[t,x]=ode45('elecsys',t0,tfinal,x0);
%elecsys是系统微分方程的描述函数
figure(1)
subplot(211)
plot(t,x(:,1))
title('capacitor voltage')
xlabel('time-sec')
subplot(212)
plot(t,x(:,2))
title('current of L')
xlabel('time-sec')
figure(2)
vc=x(:,1);
i=x(:,2);
plot(vc,i);
title('current versus capacitor voltage')
xlabel('capacitor voltage')
ylabel('current')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -