the average state space model system using the Euler method
Show older comments
The unit step response of the average state space model system using the Euler method differs slightly in amplitude from the step response of the Buck converter transfer function. Which method would you prefer to use instead of Euler, which is not as complicated as the differential equation?
Best regards,
% Buck converter parameters
L = 1e-3; % Inductance in Henry
C = 100e-6; % Capacitance in Farad
R = 5; % Load resistance in Ohm
Vin = 40; % Input voltage in Volt
Vref = 20; % Desired output voltage in Volt
f = 200e3; % Switching frequency in Hz
Tfinal = 0.01; % Simulation time in seconds
% Time vector
Ts = 1e-6; % Simulation step size
t = 0:Ts:Tfinal; % Time vector
N = length(t); % Number of simulation points
% State-space matrices (average model)
A = [ 0 -1/L;
1/C -1/(R*C) ];
B = [ Vin/L;
0 ];
% Initial conditions
x = zeros(2, N); % x(1,:) = iL (inductor current), x(2,:) = Vo (output voltage)
% Duty cycle (assumed constant for open-loop case)
D = Vref / Vin; % Ideal duty cycle to achieve Vref at steady state
% Simulation loop using Euler integration
for k = 1:N-1
dx = A * x(:,k) + B * D;
x(:,k+1) = x(:,k) + Ts * dx;
end
% Plotting results
figure;
subplot(2,1,1);
plot(t, x(1,:), 'b', 'LineWidth', 1.5);
ylabel('i_L (A)');
grid on;
title('Buck Converter - Average Model Simulation');
subplot(2,1,2);
plot(t, x(2,:), 'r', 'LineWidth', 1.5);
ylabel('V_o (V)');
xlabel('Time (s)');
grid on;

Gvd=tf([Vin/(L*C)],[1 1/(R*C) 1/(L*C)]);
step(Gvd);

Accepted Answer
More Answers (0)
Categories
Find more on Electrical Block Libraries in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
