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`LaplaceTransform`"]

Clear["Global'*"];

2.4 Problems

2.4.4  LRC Circuits

Problem 3:  RLC Loop

Part (a)  Find the Laplace transform of q[t] for an arbitraty V[t].

eq1  =  
      L q''[t]  +  R q'[t]  +  q[t]/C  ==  V[t]

eq2 = LaplaceTransform[eq1, t, s] // Simplify

sol = Solve[eq2, LaplaceTransform[q[t], t, s]] // Flatten

Part (b)  Consider the explicit solution when V[t]=0.

sol0 = sol /. V[t] -> 0

initial = {q[0] -> q0, q'[0] -> i0}

\(\(charge[t_] = 
      InverseLaplaceTransform[
					
          \(LaplaceTransform[q[t], t, s]
					 /. sol0\) /. initial\ , 
          s, t] // Simplify
\)\)

charge[t_] = charge[t] // ExpandAll

charge[t_] = charge[t] // Simplify

\(freqrule = {Sqrt[\(-4\) L + C\ R^2] -> 2\ I\ \(ω\_0\) Sqrt[C] L, 
        
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        1/Sqrt[\(-4\) L + C\ R^2] -> 1/\((2\ I\ \(ω\_0\) Sqrt[C] L)\), 
        
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \((\(-4\) L + C\ R^2)\) -> \(-4\)\ ω\_0^2\ C\ L^2, 

        		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
        1/\((\(-4\) L + C\ R^2)\) -> \(-1\)/\((4\ ω\_0^2\ C\ L^2)\)}
        \)

wrule = 
      Solve[(-4 L + C R^2) == -4 (Subscript[ω, 0])^2 C L^2, 
          (Subscript[ω, 0])][[2]]

charge0 = 
      charge[t] //. freqrule // ComplexExpand // FullSimplify

current0 = D[charge0, t] // Simplify

Part (c)  Make a 2-D plot of charge and current vs. time

values = {R -> 1, V0 -> 1, C -> 1, L -> 4, q0 -> 1, i0 -> 0}

\(\(text = 
      Graphics[

        			{Text[FontForm[Charge, \ \ {"Courier", 10}], {5, 0.8}], 

          				Text[FontForm[Current, {"Courier", 10}], {8, 0.3}]}]; 
    \)\)

\(\(pt = 
      Plot[Evaluate[\({charge0, current0} /. wrule\) /. values]
, {t, 0.001, 
          20}
, PlotStyle -> {{Dashing[{0.01, 0.01}], Thickness[0.01]}

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

Show[{pt, text}];

Part (d)  Make a 3-D plot of charge vs. time and L.

values2 = {R -> 1, V0 -> 1, C -> 1, q0 -> 1, i0 -> 1}

\(\(p1 = 
      Plot3D[Evaluate[\(charge0 /. wrule\) /. values2]

        	, {t, 0, 30}, {L,  .001, 4}
, 
        AxesLabel -> {"Time", "   Inductance", "Charge"}
, 
        PlotRange\  -> \ All
, FaceGrids -> {{0, 0, 1}, {0, \(-1\), 0}}
, 
        ViewPoint -> {1, 3, 1}
, PlotPoints -> 30]; \)\)