Boost converter mathematical equation
古いコメントを表示
My scope shows 0 value for IL and VO can any correct my simulation based on equations i posted.
回答 (2 件)
Hi @komathy
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 件のコメント
Sam Chak
2026 年 1 月 26 日
Hi @komathy
I believe there should be a switching term in your Boost Converter model:

You should also describe the switching wave signal more clearly, particularly how it transitions from Position 1 to Position 2 and then back to Position 1. By checking out the effects of the initial values of
and
on the system in MATLAB, you meaningfully compare the results or find out what went wrong in your Simulink model.
komathy
2026 年 1 月 26 日
Hi @komathy
This is a rough idea for you to cross-check with the Simulink model. If you have the Control System Toolbox, you should be able to use the gensig() function to generate the PWM accurately.
which gensig
t = linspace(0, 0.1, 1001);
r = sinpi(t/0.01 + deg2rad(-43)) + 1/sqrt(2);
sw = (sign(r) + 1)/2;
figure
plot(t, sw), grid minor
xlabel('Time, t')
title('Pulse-width modulation (PWM)')
xlim([ 0.0, 0.1])
ylim([-0.5, 1.5])
% parameters
Vg = 15;
L = 100e-6;
C = 470e-6;
RO = 20; % probably the load resistance
RL = 0.1;
RC = 0.05;
%% Boost Converter
function [dx, vO] = BoostConverter(t, x, Vg, L, C, RO, RL, RC)
% initialization
dx = zeros(2, 1);
% definitions
iL = x(1);
vC = x(2);
% pulse-width modulation (PWM)
r = sinpi(t/0.01 + deg2rad(-43)) + 1/sqrt(2);
sw = (sign(r) + 1)/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 = (sw*RC*iL + vC)/(1 + RC/RO);
% differential equations
dx(1) = 1/L*(Vg - RL*iL - sw*vO); % diL/dt
dx(2) = 1/C*(sw*iL - vO/RO); % dvC/dt
end
% call ode45
tspan = [0, 1e-1]; % simulation time
iL0 = 100; % initial iL value at t = 0
vC0 = 50; % initial vC value at t = 0
x0 = [iL0; vC0]; % initial condition of the state vector x
[t, x] = ode45(@(t, x) BoostConverter(t, x, Vg, L, C, RO, RL, RC), tspan, x0);
% Pre-allocate for the voltage signal vO1
vO = zeros(numel(t), 1);
% Use for-loop to iteratively call BoostConverter1() to return the 2nd output
for i = 1:numel(t)
[~, vO(i)] = BoostConverter(t(i), x(i,:).', Vg, L, C, RO, RL, RC);
end
% plot results
plot(t, [x, vO])
grid on
ylim([-150, 250])
xlabel('time, t')
ylabel('\bf{x}\rm(t)')
title('Time response of the Boost Converter')
legend({'$i_{L}$', '$v_{C}$', '$v_{O}$'}, 'interpreter', 'latex')
komathy
2026 年 1 月 26 日
Sam Chak
2026 年 1 月 26 日
Hi @komathy
In MathWorks products, simulations can generally be run in 3 primary ways:
- Use MATLAB – This requires the user to code the mathematical model.
- Use Simulink – This requires the user to build a block diagram that is physically equivalent to the mathematical model.
- 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
2026 年 1 月 29 日
カテゴリ
ヘルプ センター および File Exchange で Building and Simulating Electronic, Mechatronic, and Electrical Power System Networks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




