何必手算?MATLAB數(shù)值方法求解微分方程|Matlab符號(hào)計(jì)算


clc
close all
clear
L = 1;
C = 1e-6;
G = 2e-3;
Is = 1;
f = @(t, x)[x(2); 1/(L*C)*(Is-x(1)-G*L*x(2))];
tspan = [0 0.008];
[t, y] = ode45(f, tspan, [0; 0]);
yyaxis left
plot(t, y(:,1), 'LineWidth', 2);
grid on;
yyaxis right
plot(t, y(:, 2), 'LineWidth', 2);
grid on;
legend('iL', 'Uc');
標(biāo)簽: