**29.A Electrical Circuit**

**29.A-1 Model for a General RLC Circuit**

Consider an RLC series circuit with resistance
(ohm), inductance
(henry), and capacitance
(farad). Denote the electric charge by
(coulomb). The current in the circuit is the instantaneous rate of change of the charge, so that

**> ** |
**charge := i(t) = diff( q(t), t );** |

The unit for current is *ampere*. One of Kirchoff's Laws states that the sum of the instantaneous *voltage* *drops* (changes in potential) around a closed circuit must be zero, so that

**> ** |
**KirchoffLaw := E[R] + E[L] + E[C] - E[emf] = 0;** |

where
,
, and
are the voltage drops across the resistor, inductor, and capacitor, respectively, and
is the voltage drop produced by an attached electromotive force.

According to Ohm's Law, the voltage drop across a resistor is proportional to the current with constant of proportionality
, so that

Faraday's Law states that the voltage drop across the inductor is proportional to the instantaneous rate of change of the current, with
as the proportionality constant, so that

**> ** |
**E[L] := L*diff(i(t),t);** |

The voltage drop across a capacitor is proportional to the electric charge on the capacitor, with constant of proportionality
, giving

**29.A-2 Solution for the General RLC Circuit**

When the modeling assumptions for the potential drop across each component in the circuit are inserted into Kirchoff's Law, the resulting ODE is

Put this into the form of a second-order ODE for the charge via the substitutions

**> ** |
**odeQ := eval( KirchoffLaw, {charge,E[emf]=e(t)} );** |

The corresponding initial conditions are

**> ** |
**icQ := q(0)=q0, D(q)(0)=i0;** |

The solution to this generic IVP is

**> ** |
**infolevel[dsolve] := 3:** |

**> ** |
**solQ := subs(_z1=u, dsolve( { odeQ, icQ }, q(t) ));** |

**> ** |
**infolevel[dsolve] := 0:** |

`Methods for second order ODEs:`

`--- Trying classification methods ---`

`trying a quadrature`

`trying high order exact linear fully integrable`

`trying differential order: 2; linear nonhomogeneous with symmetry [0,1]\

`

`trying a double symmetry of the form [xi=0, eta=F(x)]`

`Try solving first the homogeneous part of the ODE`

` -> Tackling the linear ODE "as given":`

` checking if the LODE has constant coefficients`

` <- constant coefficients successful`

` <- successful solving of the linear ODE "as given"`

` -> Determining now a particular solution to the non-homogeneous ODE`\

` building a particular solution using variation of parameters`

` particular solution has integrals (!)`

` -> trying a d'Alembertian particular solution free of integrals`

` <- no simpler d'Alembertian solution was found`

` <- solving first the homogeneous part of the ODE successful`

The current can be found by differentiation:

**> ** |
**solI := eval( charge, solQ );** |

The same expressions for the charge and current can be derived as the solution to the first-order system of ODEs formed by Kirchoff's Law and the constitutive relation between current and charge. The appropriate first-order IVP is

**> ** |
**sysQI := eval(KirchoffLaw,E[emf]=e(t)), charge;****
** icQI := q(0)=q0, i(0)=i0; |

with solution

**> ** |
**solQI := subs(_z1=u, dsolve( { sysQI, icQI }, { q(t), i(t) } ));** |

That the two forms of the solutions are the same is verified in Maple with

**> ** |
**simplify( eval( q(t), solQ ) - eval( q(t), solQI ) );** |

**29.A-3 Special Case #1: LC Circuit**

If the circuit does not have a resistor,
, and the solutions "simplify" to

**> ** |
**LCsolQI := simplify( eval( solQI, R=0 ));** |

Note that
and
imply that since the exponentials in this problem all involve imaginary exponents, the real-valued solutions will involve sine and cosine. In particular, there is no transient solution for an LC circuit. Given that the second-order ODE for the charge in an LC circuit reduces to

which is equivalent to an undamped oscillator, this is not surprising.

**29.A-4 Special Case #2: RC Circuit**

If the circuit does not have an inductor,
, and it is not possible to obtain the solutions by simply inserting
into the general solution to the RLC circuit.

Attempting this leads to the error

**> ** |
**simplify( eval( solQI, L=0 ) );** |

Error, numeric exception: division by zero

The problem is that when
the ODE for the charge is no longer of second order, as seen with

**> ** |
**RCodeQ := eval( odeQ, L=0 );** |

The solution is

**> ** |
**RCsolQ := subs(_z1=u, expand( dsolve( { RCodeQ, q(0)=q0 }, q(t) )));****
** RCsolI := i(t) = subs(_z1=u, expand( diff( rhs(RCsolQ), t ))); |

Here, because
, the denominators all tend to
as
. This means that the initial charge in the system has no bearing on the long-time behavior of the solution. If the exponentially growing term in the integrand for the particular solution survives in a form that exactly cancels the exponential growth in the denominator, then the steady-state solution for the charge will be nontrivial. For example, taking
leads to the solution

**> ** |
**collect( value( eval( { RCsolQ, RCsolI }, e=1 ) ), exp );** |

where
tends to
while
tends to zero.

**29.A-5 Special Case #3: RL Circuit**

If the circuit does not have a capacitor,
, and it is possible to obtain the charge on the circuit by simply taking a limit of the general solution to the RLC circuit. This limit is obtained via

**> ** |
**RLsolQ := simplify( map( limit, solQ, C=infinity )) assuming R>0;** |

This substitution works because the ODE for the charge, namely,

**> ** |
**RLodeQ := limit( odeQ, C=infinity );** |

is still of second-order, with two distinct eigenvalues. Note that while the formal substitution
yields the same ODE, that is,

**> ** |
**eval( odeQ, C=infinity );** |

this substitution cannot be used directly on the solution, since that results in

**> ** |
**eval( solQ, C=infinity );** |

However, the charge in an LR circuit can be obtained as the limit of the generic solution for an RLC circuit as
, as seen by

**> ** |
**simplify( map( limit, solQ, C=infinity ) ) assuming R>0;** |

The corresponding current is

**> ** |
**i(t) = expand( diff( rhs(RLsolQ), t ) ) assuming R>0;** |

Careful inspection of the expression for the charge in the circuit verifies that this solution is obtained from a second-order ODE with eigenvalues
and
. The presence of a zero eigenvalue implies that the initial charge and current in the circuit impact the solution for all time. Moreover, because
> 0, only the portion of the homogeneous solution contributed by the negative exponential is guaranteed to be transient.