Boost converter mathematical equation

52 views (last 30 days)
komathy
komathy on 26 Jan 2026 at 3:42
Commented: Sam Chak on 29 Jan 2026 at 17:39
My scope shows 0 value for IL and VO can any correct my simulation based on equations i posted.

Answers (2)

Sam Chak
Sam Chak on 26 Jan 2026 at 7:17
From the programmer's perspective, I can only verify the responses of the differential equations for the Boost Converter. However, the duty cycle information is definitely missing from the differential equations. Your Simulink model should produce results similar to those obtained in MATLAB.
% parameters
Vg = 15;
L = 100e-6;
C = 470e-6;
RO = 20; % probably the load resistance
RL = 0.1;
RC = 0.05;
%% Switch Position 1
function [dx, vO] = BoostConverter1(t, x, Vg, L, C, RO, RL, RC)
% initialization
dx = zeros(2, 1);
% definitions
iL = x(1);
vC = x(2);
% mathematical manipulation of algebraic relationship
% vO = RC*C*(dvC/dt) + vC;
% vO = RC*C*(- vO/(C*RO)) + vC;
% vO = - RC*C*vO/(C*RO) + vC;
% vO + RC*C*vO/(C*RO) = vC;
% vO*(1 + RC*C*1/(C*RO)) = vC;
vO = vC/(1 + RC*C*1/(C*RO));
% differential equations
dx(1) = 1/L*(Vg - RL*iL - 0); % diL/dt
dx(2) = 1/C*(0 - vO/RO); % dvC/dt (doesn't affected by iL(t) at Switch Position 1)
end
%% Switch Position 2
function [dx, vO] = BoostConverter2(t, x, Vg, L, C, RO, RL, RC)
% initialization
dx = zeros(2, 1);
% definitions
iL = x(1);
vC = x(2);
% mathematical manipulation of algebraic relationship
% vO = RC*C*(dvC/dt) + vC;
% vO = RC*C*(1/C*(iL - vO/RO)) + vC;
% vO = RC*(iL - vO/RO) + vC;
% vO = RC*iL - RC*vO/RO + vC;
% vO + RC*vO/RO = RC*iL + vC;
% vO*(1 + RC/RO) = RC*iL + vC;
vO = (RC*iL + vC)/(1 + RC/RO);
% differential equations
dx(1) = 1/L*(Vg - RL*iL - vO); % diL/dt
dx(2) = 1/C*(iL - vO/RO); % dvC/dt (doesn't affected by iL(t) at Switch Position 1)
end
% call ode45 to solve the system during Position 1
tspan = [0, 1e-2]; % simulation time
iL0 = 100; % initial iL value at t = 0
vC0 = 50; % initial vC value at t = 0
x10 = [iL0; vC0]; % initial condition of the state vector x
[t1, x1]= ode45(@(t, x) BoostConverter1(t, x, Vg, L, C, RO, RL, RC), tspan, x10);
% Pre-allocate for the voltage signal vO1
vO1 = zeros(numel(t1), 1);
% Use for-loop to iteratively call BoostConverter1() to return the 2nd output
for i = 1:numel(t1)
[~, vO1(i)] = BoostConverter1(t1(i), x1(i,:).', Vg, L, C, RO, RL, RC);
end
% call ode45 to solve the system during Position 2
tspan = [1e-2, 2e-2]; % simulation time
iL0 = x1(end,1); % initial iL value at t = 1e-2
vC0 = x1(end,2); % initial vC value at t = 1e-2
x20 = [iL0; vC0]; % initial condition of the state vector x
[t2, x2]= ode45(@(t, x) BoostConverter2(t, x, Vg, L, C, RO, RL, RC), tspan, x20);
% Pre-allocate for the voltage signal vO2
vO2 = zeros(numel(t2), 1);
% Use for-loop to iteratively call BoostConverter2() to return the 2nd output
for j = 1:numel(t2)
[~, vO2(j)] = BoostConverter2(t2(j), x2(j,:).', Vg, L, C, RO, RL, RC);
end
% "stitching" results
t = [ t1; t2];
x = [ x1; x2];
vO = [vO1; vO2];
% plot results
plot(t, [x, vO])
grid on
xlabel('time, t')
ylabel('\bf{x}\rm(t)')
title('Time response of the Boost Converter')
legend({'$i_{L}$', '$v_{C}$', '$v_{O}$'}, 'interpreter', 'latex')
  7 Comments
Sam Chak
Sam Chak on 26 Jan 2026 at 13:55
In MathWorks products, simulations can generally be run in 3 primary ways:
  1. Use MATLAB – This requires the user to code the mathematical model.
  2. Use Simulink – This requires the user to build a block diagram that is physically equivalent to the mathematical model.
  3. Use Apps provided by the toolboxes – These are designed for users to perform complex data analysis, signal processing, and numerical tasks without the need to write code or possess advanced mathematical knowledge.
Since it is not possible to run Simulink models on the MATLAB Answers forum, I can only advise using the MATLAB solution as guidance to troubleshoot what might be wrong in your Simulink model. I am not suggesting that you abandon Simulink. If the MATLAB code accurately describes the differential equations of the Boost Converter, you can leverage this experience to understand how the signal flows from the source (PWM signal) to the Scope (measured outputs).
If the Simulink Scope measures zero outputs but the MATLAB plot() function produces non-zero outputs, you should identify the source of the discrepancies. In the Simulink image, I cannot determine the cause because there are no values displayed on all signal branches. However, you can right-click on the signal branch of interest (usually before and after the integrator block) and select "Show Value"; the value will appear when you run the Simulink model.
For the values "before the integrator," you can compare these values with those derived from the differential equations diL/dt​ and dvC/dt​. If discrepancies exist, it indicates that either the models are not the same or that some values from the PWM source are incorrectly triggered.
Sam Chak
Sam Chak on 29 Jan 2026 at 17:39
I use these settings in the Model Config panel, and the Scope shows the two signals.

Sign in to comment.


komathy
komathy on 26 Jan 2026 at 8:12
Tis is my actual simulation. For IL and vo scope cant get result
  1 Comment
komathy
komathy on 26 Jan 2026 at 14:27
i need compare with my simscape and mathematical equation. here i upload my mathmatical slx file . help me check can ?

Sign in to comment.

Categories

Find more on Building and Simulating Electronic, Mechatronic, and Electrical Power System Networks 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!