# Exercici 12.19

Designem per:
R, resistencia. R = 180 ohm
C, capacitat. C = 1/280 F
L, autoinducció. L = 20H
q(t) la càrrega que circula pel circuit

kill(all)$

R : 180$
C : 1/280$
L : 20$

EDO:  'diff(q,t,2) +(R/L)*'diff(q,t) + (1/(L*C))*q = (1/L) * 10*sin(t);

ode2(EDO, q, t);

define (q(t) , (13*sin(t)-9*cos(t))/500 + k1*%e^(-2*t) + k2*%e^(-7*t) ) ;

define ( Dq(t) , diff(q(t),t));

Eq1:  q(0) = 0;
Eq2:  Dq(0) = 1;
solve ([Eq1,Eq2] , [k1,k2]);

k1:11/50;
k2:-101/500;

wxplot2d([q(t)], [t,0,30], [ylabel, ""] , [legend, "q(t)"] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set grid; set zeroaxis;"])$

wxplot2d([q(t)], [t,0,10], [ylabel, ""] , [legend, "q(t)"] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set grid; set zeroaxis;"])$