Differential Equations Systems with an PWM switch.

조회 수: 2 (최근 30일)
Carlos Martínez
Carlos Martínez 2017년 4월 6일
I want to simulate the behavior of this circuit:
I have this ODE System.
Where u is a PWM function with Duty Cylce D so u would be [1,0] because the circuits changes its topology when u is 1 or u because of the Switch (SW).
I want to simulate it in both modes at the same time. Is there any way of doing it? Here is my code:
E=input('Input the value of Source: ');
L=input('Input the value of Inductance: ');
C=input('Input the value of Capacitor: ');
RL=input('Input the value of Load: ');
u=input('Input the value of U: ');
syms i(t) v(t)
ode1 = diff(i) == -((1-u)/L).*v + E/L;
ode2 = diff(v) == (1-u)/C.*i - v/(RL*C);
cond1 = i(0) == 0;
cond2 = v(0) == 0;
conds = [cond1; cond2];
[iSol(t), vSol(t)] = dsolve(odes,conds);
ezplot(iSol);
hold on;
ezplot(vSol);
grid on;
legend('iSol','vSol','Location','best');
I would appreciate every advice for this. Thanks!

답변 (0개)

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

Help CenterFile Exchange에서 Pulse width modulation (PWM)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by