Boost converter mathematical equation

My scope shows 0 value for IL and VO can any correct my simulation based on equations i posted.

回答 (2 件)

Sam Chak
Sam Chak 2026 年 1 月 26 日

0 投票

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 件のコメント

komathy
komathy 2026 年 1 月 26 日
移動済み: Sam Chak 2026 年 1 月 26 日
Tis is my actual simulation. For IL and vo scope cant get result
Sam Chak
Sam Chak 2026 年 1 月 26 日
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
komathy 2026 年 1 月 26 日
switch is controlled by a pulse-width modulation (PWM) signal at a fixed switching frequency of 5 kHz. The switching behavior is as follows: When PWM signal is HIGH → Switch is in Position 1 Inductor is connected to the input source Vg through RL Diode is reverse-biased, capacitor supplies the load When PWM signal is LOW → Switch moves to Position 2 Inductor is connected to the output stage Inductor energy is transferred to the capacitor and load . The transition between positions is instantaneous in the ideal model. The duty ratio D=0.25 means the switch spends 25% of the period in Position 1 and 75% in Position 2.
Sam Chak
Sam Chak 2026 年 1 月 26 日
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
/MATLAB/toolbox/control/ctrlanalysis/gensig.m
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
komathy 2026 年 1 月 26 日
mine 2023b got any other choice for me to get simulation boost converter
Sam Chak
Sam Chak 2026 年 1 月 26 日
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 2026 年 1 月 29 日
I use these settings in the Model Config panel, and the Scope shows the two signals.

サインインしてコメントする。

komathy
komathy 2026 年 1 月 26 日

0 投票

Tis is my actual simulation. For IL and vo scope cant get result

1 件のコメント

komathy
komathy 2026 年 1 月 26 日
i need compare with my simscape and mathematical equation. here i upload my mathmatical slx file . help me check can ?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeBuilding and Simulating Electronic, Mechatronic, and Electrical Power System Networks についてさらに検索

質問済み:

2026 年 1 月 26 日

コメント済み:

2026 年 1 月 29 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by