2. General Physics

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

\($DefaultFont = {"Courier", 12}; 
Off[General::spell]; 

    Off[General::spell1]; 
PageWidth -> 70; \)

Needs["Calculus`FourierTransform`"]

Clear["Global'*"];

2.4 Problems

2.4.4  LRC Circuits

Problem 2:  Series RL Circuit

Part (a)  Solve for the charge q[t] for an arbitraty V[t].

Note:  Here we solve first for i[t] and then for q[t].  With Mathematica v.3.0.1,
	the one-step solution method suggested in the text produces error messages
	and leaves unevaluated constants of integraton.

eq1 = {V[t] == R  i[t]  +  L i'[t],  i[0] == i0}

dsol1 = DSolve[eq1, i[t], t] // Flatten

i[t_] = i[t] /. dsol1

eq2 = {q'[t] == i[t], q[0] == q0}

dsol2  =  DSolve[eq2, q[t], t] // Flatten

q[t_] = q[t] /. dsol2

Part (b)  Solve for the charge q[t] and current i[t] when V[t] = V0 Cos[ωt].

V[t_] = V0 Cos[ω t]

q[t_] = q[t] // Simplify

i[t_] = i[t] // Simplify

Part (c)  Plot the charge q[t] and current i[t] when q0=0

values = {R -> 0.1, L -> 2, V0 -> 1, ω -> 1, i0 -> 0.1, q0 -> 0}

\(\(Plot[Evaluate[{q[t], i[t]} /. values], {t, 0, 20}
, 
      PlotStyle -> {{Dashing[{0.06, 0.00}], Thickness[0.008]}

          		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ , {
            Dashing[{0.03, 0.03}], Thickness[0.008]}}
, Frame -> True
, 
      FrameLabel -> {"Time", "Charge & Current"}
, 
      GridLines -> Automatic]; \)\)

Part (d)  Take the Fourier transform of data (with noise) formed
	  from the charge function q[t] from part (b) above.

\(\(fourierdata\  = \ 
      Table[q[t]\ Random[Real, {0.9, 1.1}] /. values // N

        		, {t, 0, 100  π, 100  π/300}]; \)\)

Short[fourierdata, 3]

ListPlot[fourierdata, PlotJoined -> True];

ftrans = Fourier[fourierdata];

ListPlot[Abs[ftrans], PlotJoined -> True, PlotRange -> {0, 5}];

ftarg = 
      Table[ArcTan[Im[ftrans[[n]]], Re[ftrans[[n]]]], {n, 1, 300}];

ListPlot[ftarg, PlotJoined -> True];

ftri = 
      Table[{Re[ftrans[[n]]], Im[ftrans[[n]]]}, {n, 1, 150}];

ListPlot[ftri, PlotJoined -> True];