Differential Equations Systems with an PWM switch.

2 visualizaciones (últimos 30 días)
Carlos Martínez
Carlos Martínez el 6 de Abr. de 2017
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!

Respuestas (0)

Comunidades de usuarios

Más respuestas en  Power Electronics Control

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by