# Circuit Theory/Second-Order Solution

== Second-Order Solution
This page is going to talk about the solutions to a second-order, RLC circuit. The second-order solution is reasonably complicated, and a complete understanding of it will require an understanding of differential equations. This book will not require you to know about differential equations, so we will describe the solutions without showing how to derive them. The derivations may be put into another chapter, eventually.
The aim of this chapter is to develop the complete response of the second-order circuit. There are a number of steps involved in determining the complete response:
* Obtain the differential equations of the circuit
* Determine the resonant frequency and the damping ratio
* Obtain the characteristic equations of the circuit
* Find the roots of the characteristic equation
* Find the natural response
* Find the forced response
* Find the complete response
We will discuss all these steps one at a time.

## Finding Differential Equations

A Second-order circuit cannot possibly be solved until we obtain the second-order differential equation that describes the circuit. We will discuss here some of the techniques used for obtaining the second-order differential equation for an RLC Circuit.

### Note

    Parallel RLC circuits are easier to solve using ordinary differential equations in voltage (a consequence of Kirchhoff's Voltage Law), and Series RLC circuits are easier to solve using ordinary differential equations in current (a consequence of Kirchhoff's Current Law).

### The Direct Method

The most direct method for finding the differential equations of a circuit is to perform a nodal analysis, or a mesh current analysis on the circuit, and then solve the equation for the input function. The final equation should contain only derivatives, no integrals.

### The Variable Method

If we create two variables, g and h, we can use them to create a second-order differential equation. First, we set g and h to be either inductor currents, capacitor voltages, or both. Next, we create a single first order differential equation that has g = f(g, h). Then, we write another first-order differential equation that has the form:
    ${\frac {dh}{dt}}=Kg$ or ${\frac {1}{K}}{\frac {dh}{dt}}=g$
Next, we substitute in our second equation into our first equation, and we have a second-order equation.

## Zero-Input Response

The zero-input response of a circuit is the state of the circuit when there is no forcing function (no current input, and no voltage input). We can set the differential equation as such:
    ${{d^{2}i} \over {dt^{2}}}+2\zeta {{di} \over {dt}}+\omega _{o}^{2}i(t)=0$
This gives rise to the characteristic equation of the circuit, which is explained below.

## Characteristic Equation

The characteristic equation of an RLC circuit is obtained using the "Operator Method" described below, with zero input. The characteristic equation of an RLC circuit (series or parallel) will be:
    $s^{2}i+{R \over L}si+{1 \over {LC}}i=0$
The roots to the characteristic equation are the "solutions" that we are looking for.

### Finding the Characteristic Equation

This method of obtaining the characteristic equation requires a little trickery. First, we create an operator s such that:
    $sx={\frac {dx}{dt}}$
Also, we can show higher-order operators as such:
    $s^{2}x={\frac {d^{2}x}{dt^{2}}}$
Where x is the voltage (in a series circuit) or the current (in a parallel circuit) of the circuit source. We write 2 first order differential equations for the inductor currents and/or the capacitor voltages in our circuit. We convert all the differentiations to s, and all the integrations (if any) into (1/s). We can then use Cramer's rule to solve for a solution.

### Solutions

The solutions of the characteristic equation are given in terms of the resonant frequency and the damping ratio:
[Characteristic Equation Solution]
    $s=-\zeta \pm {\sqrt {\zeta ^{2}-\omega _{o}^{2}}}$
If either of these two values are used for s in the assumed solution $x=Ae^{st}$ and that solution completes the differential equation then it can be considered a valid solution. We will discuss this more, below.

## Damping

The solutions to a circuit are dependent on the type of damping that the circuit exhibits, as determined by the relationship between the damping ratio and the resonant frequency. The different types of damping are Overdamping, Underdamping, and Critical Damping.

### Overdamped

A circuit is called Overdamped when the following condition is true:
    $\zeta >\omega _{0}$
In this case, the solutions to the characteristic equation are two distinct, positive numbers, and are given by the equation:
    $I(t)=Ae^{\ s_{1}t}+Be^{\ s_{2}t}$, where
    $s_{1},s_{2}=-\zeta \pm {\sqrt {\zeta ^{2}-\omega _{0}^{2}}}$
In a parallel circuit:
    $\zeta =1/(2RC)$
    $\omega _{0}=1/{\sqrt {(LC)}}$
In a series circuit:
    $\zeta =R/(2L)$
    $\omega _{0}=1/{\sqrt {(LC)}}$
Overdamped circuits are characterized as having a very large settling time, and possibly a large steady-state error.

### Underdamped

A Circuit is called Underdamped when the damping ratio is less than the resonant frequency.
    $\zeta <\omega _{0}$
In this case, the characteristic polynomial's solutions are complex conjugates. This results in oscillations or ringing in the circuit. The solution consists of two conjugate roots:
    $\lambda _{1}=-\zeta +i\omega _{c}$
and
    $\lambda _{2}=-\zeta -i\omega _{c}$
where
    $\omega _{c}={\sqrt {-(\omega _{o}^{2}-\zeta ^{2})}}$
The solutions are:
    $i(t)=Ae^{(-\zeta +i\omega _{c})t}+Be^{(-\zeta -i\omega _{c})t}$
for arbitrary constants A and B. Using Euler's formula, we can simplify the solution as:
       $i(t)=e^{-\zeta t}\left[C\sin(\omega _{c}t)+D\cos(\omega _{c}t)\right]$
for arbitrary constants C and D. These solutions are characterized by exponentially decaying sinusoidal response. The higher the Quality Factor (below), the longer it takes for the oscillations to decay.

### Critically Damped

A circuit is called Critically Damped if the damping factor, or the ratio of actual damping to critical damping, is equal to 1:
    $\zeta =1$
In this case, the solutions to the characteristic equation is a double root. The two roots are identical ($\lambda _{1}=\lambda _{2}=\lambda$), the solutions are:
    $I(t)=(A+Bt)e^{\lambda t}$
for arbitrary constants A and B. Critically damped circuits typically have low overshoot, no oscillations, and quick settling time.

## Series RLC

The differential equation to a simple series circuit with a constant voltage source V, and a resistor R, a capacitor C, and an inductor L is:
    $L{\frac {d^{2}q}{dt^{2}}}+R{\frac {dq}{dt}}+{1 \over C}q=0$
The characteristic equation then, is as follows:
    $Ls^{2}+Rs+{1 \over C}=0$
With the two roots:
    $s_{1}=-{R \over 2L}+{\sqrt {({R \over 2L})^{2}-{1 \over LC}}}$
and
    $s_{2}=-{R \over 2L}-{\sqrt {({R \over 2L})^{2}-{1 \over LC}}}$

## Parallel RLC

The differential equation to a parallel RLC circuit with a resistor R, a capacitor C, and an inductor L is as follows:
    $C{\frac {d^{2}v}{dt^{2}}}+{\frac {1}{R}}{\frac {dv}{dt}}+{1 \over L}v=0$
Where v is the voltage across the circuit. The characteristic equation then, is as follows:
    $Cs^{2}+{1 \over R}s+{1 \over L}=0$
With the two roots:
    $s_{1}=-{1 \over 2RC}+{\sqrt {({1 \over 2RC})^{2}-{1 \over LC}}}$
and
    $s_{2}=-{1 \over 2RC}-{\sqrt {({1 \over 2RC})^{2}-{1 \over LC}}}$

## Circuit Response

Once we have our differential equations, and our characteristic equations, we are ready to assemble the mathematical form of our circuit response. RLC Circuits have differential equations in the form:
    $a_{2}{\frac {d^{2}x}{dt^{2}}}+a_{1}{\frac {dx}{dt}}+a_{0}x=f(t)$
Where f(t) is the forcing function of the RLC circuit.

### Natural Response

The natural response of a circuit is the response of a given circuit to zero input (i.e. depending only upon the initial condition values). The natural Response to a circuit will be denoted as x$_n$(t). The natural response of the system must satisfy the unforced differential equation of the circuit:
[Unforced function]
    $a_{2}{\frac {d^{2}x}{dt^{2}}}+a_{1}{\frac {dx}{dt}}+a_{0}x=0$
We remember this equation as being the "zero input response", that we discussed above. We now define the natural response to be an exponential function:
    $x_{n}=A_{1}e^{st}+A_{2}e^{st}$
Where s are the roots of the characteristic equation of the circuit. The reasons for choosing this specific solution for x$_n$ is based in differential equations theory, and we will just accept it without proof for the time being. We can solve for the constant values, by using a system of two equations:
    $x(0)=A_{1}+A_{2}$
    ${\frac {dx(0)}{dt}}=s_{1}A_{1}+s_{2}A_{2}$
Where x is the voltage (of the elements in a parallel circuit) or the current (through the elements in a series circuit).

### Forced Response

The forced response of a circuit is the way the circuit responds to an input forcing function. The Forced response is denoted as x$_f$(t).
Where the forced response must satisfy the forced differential equation:
[Forced function]
    $a_{2}{\frac {d^{2}x}{dt^{2}}}+a_{1}{\frac {dx}{dt}}+a_{0}x=f(t)$
The forced response is based on the input function, so we can't give a general solution to it. However, we can provide a set of solutions for different inputs:
| Input Form | Output Form |
| K (constant) | A (constant) |
| $M\sin(\omega t)$ | $A\sin(\omega t)+B\cos(\omega t)$ |
| $Me^{-at}$ | $Ae^{-at}$ |

### Complete Response

The Complete response of a circuit is the sum of the forced response, and the natural response of the system:
[Complete Response]
    $x_{c}(t)=x_{t}(t)+x_{s}(t)$
Once we have derived the complete response of the circuit, we can say that we have "solved" the circuit, and are finished working.
the 2nd order circuit (LC) when there is no R in the circuit we consider a=1/2RC ( if the circuit parallel ) = 0 so the circuit will be in undermade case since a=0 and omega has value greater than zero