Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%euler circuito RLC con EDO segundo grado
- clear all
- clc
- %constantes
- h=0.001; %sampleo, delta t, tiempo de musetreo , tamaΓ±o de paso ,.. etc
- L=440e-3 ; %inductancia
- C=47e-6 ; %capacitancia
- R=100 ; %resistencia
- %conste de simulacion
- tFin=2 %[segundos]
- kFin=(tFin/h)+1
- orden =2
- %valores iniciales
- Vc(1)=0;
- Vc(2)=0;
- for k=1:kFin
- %vector tiempo
- t(k)=(k-1)*h;
- %vector volteje entrada
- if t(k)>1
- V(k)=10;
- else
- V(k)=0;
- end
- if k <(kFin-orden+1)
- Vc(k+2)=(h^2/(L*C))*V(k) + (2-R*h/L)*Vc(k+1)+(-1-(h^2/(L*C))+(R/L)*h)*Vc(k);
- end
- end
- plot(t,V), hold on
- plot(t,Vc,'m'), hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement