Circuito RCL
G.D'Agostini

Risposta a onda quadra ai capi di C mediante serie di Fourier

Circuito

Valori dei componenti

r0 = 50. ;    
rl = 100. ;    
r = 10. ;    (* 
      resistenza del resistore *) 
rt = r0+rl+r   
c = 4.7*10^(-9);
l =  10.  *10^(-3);

Parametri

ω0 = 1/Sqrt[l c]
ν0 = ω0/(2 Pi)
γ = rt/l
Δν = γ/(2 Pi)
τ = 2/γ
ω1 = 
      Sqrt[ω0^2 - (γ/2)^2]
If[Im[ω1] ≠ 0  ||  ω1 == 
          0, 
Print["Attenzione: Soluzione non oscillante \
-> non gestita dal presente notebook"]; 
Print["        \
    --> DA FARE"]
]
T1 = 2 Pi/ω1
Q = ω0/γ

Scarica condensatore (come promemoria)

V0 = 1. ;
vcSc = 
        V0 E^(-(γ/
                      2) t) Cos[ω1 t];
Plot[{vcSc, V0 E^(-(γ/2)  t)}, {t, 0,  
          10*T1},  PlotRange -> {-1, 1}, 
        PlotStyle -> {{}, Dashing[{0.015}]}];

Regime sinusoidale. Corrente e tensioni su C, R e L in funzione di ν

Impedenze

Zr = r
Zrt = rt
Zl = I ω l
Zc = 1/(I ω c)
Ztot = Zrt + Zl + Zc

Comportamento in funzione della frequenza per tensione unitaria del generatore

V0 = 1;
i = V0/Ztot
vr0 = r *i
vc0 = Zc*i
vl0 = Zl*i
vgr0 = V0 - r0*i

Legenda: 
- Le curve continue sono relative a vg
-Le curve tratteggiate sono relative a vgr

FindMinimum[-(Abs[
              vc0] /. ω -> (2 Pi ν)), {ν, ν0, 1.1*ν0}]
FindMinimum[-(Abs[
              vc0/vgr0] /. ω -> (2 Pi ν)), {ν, ν0, 1.1*ν0}]
\(\(Plot[{Abs[vc0] /. ω -> \((2\ Pi\ ν)\), 
          Abs[vc0/vgr0] /. ω -> \((2\ Pi\ ν)\)}, 
{ν, 0, 50000}, 
        AxesLabel -> {"ν", "Vc"}, 
        PlotStyle -> {{}, Dashing[{0.015}]}];\)\)
\(\(Plot[{Arg[vc0] /. ω -> \((2\ Pi\ ν)\), 
          Arg[vc0/vgr0] /. ω -> \((2\ Pi\ ν)\)}, 
{ν, 0, 50000}, 
        AxesLabel -> {"ν", "φc"}, 
        PlotStyle -> {{}, Dashing[{0.015}]}];\)\)

Sviluppo in serie dell'onda quadra

νg=ν0/20

νg = ν0/20
T = 1/νg
ωg = 2 Pi νg
Plot[
        UnitStep[Cos[ ωg t]] - 0.5,  {t, -T, T}];

tup = T/2;
n = 200;
  
fc = Table[2/(k* Pi) Sin[k* Pi /2], {k, 1, n}];
ff = 
        Table[fc [[k]]*Cos[k* ωg t],  {k, 1, n}];
fp = 
        Table[Plot[ff[[k]], {t, -T, T}, 
            DisplayFunction -> Identity], {k, 1, n}];
ftot = Apply[Plus, ff];

Show[fp, DisplayFunction -> $DisplayFunction, 
        PlotRange -> {-0.65, 0.65}];
Plot[ftot, {t, -T, T}];

Guadagno delle singole componenti (ai capi di C)

Ac = 
        Table[Abs[vc0] /. ω -> (k*ωg), {k, 1, 
            n}];
dφc = 
        Table[Arg[vc0] /. ω -> (k* ωg), {k, 1, 
            n}];
ffC = 
        Table[fc[[k]]*Ac[[k]]*
            Cos[k* ωg t + dφc[[k]]], {k, 1, 
            n}];
fpC = 
        Table[Plot[ffC[[k]], {t, -T, T}, 
            DisplayFunction -> Identity], {k, 1, n}];
fCtot = Apply[Plus, ffC];

Componenti filtrate e loro somma

Show[fpC, DisplayFunction -> $DisplayFunction, 
        PlotRange -> {-0.65, 0.65}];
Plot[fCtot, {t, -T, T}];

νg=ν0/40

νg = ν0/40
T = 1/νg
ωg = 2 Pi νg

tup = T/2;
n = 200;
  
fc = Table[2/(k* Pi) Sin[k* Pi /2], {k, 1, n}];
ff = 
        Table[fc [[k]]*Cos[k* ωg t],  {k, 1, n}];
fp = 
        Table[Plot[ff[[k]], {t, -T, T}, 
            DisplayFunction -> Identity], {k, 1, n}];
ftot = Apply[Plus, ff];

Show[fp, DisplayFunction -> $DisplayFunction, 
        PlotRange -> {-0.65, 0.65}];
Plot[ftot, {t, -T, T}];

Guadagno delle singole componenti (ai capi di C)

Ac = 
        Table[Abs[vc0] /. ω -> (k*ωg), {k, 1, 
            n}];
dφc = 
        Table[Arg[vc0] /. ω -> (k* ωg), {k, 1, 
            n}];
ffC = 
        Table[fc[[k]]*Ac[[k]]*
            Cos[k* ωg t + dφc[[k]]], {k, 1, 
            n}];
fpC = 
        Table[Plot[ffC[[k]], {t, -T, T}, 
            DisplayFunction -> Identity], {k, 1, n}];
fCtot = Apply[Plus, ffC];

Componenti filtrate e loro somma

Show[fpC, DisplayFunction -> $DisplayFunction, 
        PlotRange -> {-0.65, 0.65}];
Plot[fCtot, {t, -T, T}];

νg=ν0/4

νg = ν0/4
T = 1/νg
ωg = 2 Pi νg

tup = T/2;
n = 200;
  
fc = Table[2/(k* Pi) Sin[k* Pi /2], {k, 1, n}];
ff = 
        Table[fc [[k]]*Cos[k* ωg t],  {k, 1, n}];
fp = 
        Table[Plot[ff[[k]], {t, -T, T}, 
            DisplayFunction -> Identity], {k, 1, n}];
ftot = Apply[Plus, ff];

Show[fp, DisplayFunction -> $DisplayFunction, 
        PlotRange -> {-0.65, 0.65}];
Plot[ftot, {t, -T, T}];

Guadagno delle singole componenti (ai capi di C)

Ac = 
        Table[Abs[vc0] /. ω -> (k*ωg), {k, 1, 
            n}];
dφc = 
        Table[Arg[vc0] /. ω -> (k* ωg), {k, 1, 
            n}];
ffC = 
        Table[fc[[k]]*Ac[[k]]*
            Cos[k* ωg t + dφc[[k]]], {k, 1, 
            n}];
fpC = 
        Table[Plot[ffC[[k]], {t, -T, T}, 
            DisplayFunction -> Identity], {k, 1, n}];
fCtot = Apply[Plus, ffC];

Componenti filtrate e loro somma

Show[fpC, DisplayFunction -> $DisplayFunction, 
        PlotRange -> {-0.65, 0.65}];
Plot[fCtot, {t, -T, T}];