# Circuit Theory/Mesh Analysis

!Non-trivial meshes of the planar circuit labeled 1, 2, and
3.{width="300"}

Mesh analysis is done in the phasor domain.

The mesh analysis method reduces the number of equations and unknowns
one is finding in a circuit.

Kirchhoff\'s method finds all currents and voltages. Mesh analysis only
finds mesh (loop) currents.

Mesh analysis starts with the normal Kirchhoff loop equations:

$$\Delta_{k=1}^n {V}_k = 0$$

and solves terminal equations so that voltage is a function of current,
and then substitutes into the loop voltage equation:

$$v = \Delta I * R$$

$$v = \frac{\Delta I}{C * j\omega} = \frac{\Delta I}{sC}$$

$$v = \Delta I * j\omega L = \Delta I * sL$$

What is $\Delta I$? It is the difference (or addition) of possibly two
mesh currents following through a device. It can be just one current if
the device is not part of two meshes. Devices that are part of two
meshes need the mesh currents added or subtracted (depending on
direction).

$$\Delta I = I_{meshA} - I_{meshB}$$

At first glance mesh analysis may seem trivial, but there are subtle
differences to Kirchhoff\'s exposed when doing the problems:

Mesh currents can be in the same direction or different directions
through the same device. They are not Kirchhoff\'s currents through
individual devices. Without careful labeling of the mesh current
directions on the planar circuit diagram, it is impossible to keep
directions straight.

-   Mesh currents are positive if they are in the same direction of the
    particular Kirchhoff loop equation being written, negative if they
    would cause a negative voltage.
-   Mesh currents are typically CW and dictate the loop equation
    direction.
-   Has to be done in the phasor domain so impedances between nodes can
    be computed.
-   Can have too few equations requiring finding additional equations
    from \"Super Meshes\".
-   Some problems can not be solved. Recognizing these is not trivial.

## Mesh currents

!Figure 2: Circuit with mesh currents labeled as i~1~, i~2~, and i~3~.
The arrows show the direction of the mesh
current.{width="300"}
Mesh analysis works by arbitrarily assigning mesh currents in the
non-trivial loops/meshes. Figure 1 labels the essential meshes with one,
two, and three.

A mesh current may not correspond to any physically flowing current, but
the physical currents are easily found from them. It is usual practice
to have all the mesh currents loop in the same direction.

## Example

center\|framed\|Circuit diagram for use with the Mesh Current example
problem.

The circuit has 2 loops indicated on the diagram. Using KVL we get:

-   **Loop1:** $0=9-1000I_1-3000(I_1-I_2)$
-   **Loop2:** $0=3000(I_1-I_2)-2000I_2-2000I_2$

Simplifying we get the simultaneous equations:

$$0=9-4000I_1+3000I_2$$

$$0=0+3000I_1-7000I_2$$

Solving to get:

$$I_1=3.32mA$$

$$I_2=1.42mA$$

## Setting up the equations

Each mesh produces one equation. These equations are the sum of the
voltage drops in a complete loop of the mesh current.For problems more
general than those including current and voltage sources, the voltage
drops will be the impedance of the electronic component multiplied by
the mesh current in that loop.

If a voltage source is present within the mesh loop, the voltage at the
source is either added or subtracted depending on if it is a voltage
drop or a voltage rise in the direction of the mesh current. For a
current source that is not contained between two meshes, the mesh
current will take the positive or negative value of the current source
depending on if the mesh current is in the same or opposite direction of
the current source.The following is the same circuit from above with the
equations needed to solve for all the currents in the circuit.

$\begin{cases}
\text{Mesh 1: } I_1 = I_s\\
\text{Mesh 2: } -V_s + R_1(I_2-I_1) + \frac{1}{sc}(I_2-I_3)=0\\
\text{Mesh 3: } \frac{1}{sc}(I_3-I_2) + R_2(I_3-I_1) + LsI_3=0\\
\end{cases} \,$\

### Supermesh

!Figure 3: Circuit with a supermesh. Supermesh occurs because the
current source is in between the essential
meshes.{width="300"}
A supermesh occurs when a current source is contained between two
essential meshes. The circuit is first treated as if the current source
is not there. This leads to one equation that incorporates two mesh
currents. Once this equation is formed, an equation is needed that
relates the two mesh currents with the current source. This will be an
equation where the current source is equal to one of the mesh currents
minus the other. The following is a simple example of dealing with a
supermesh.

$\begin{cases}
\text{Mesh 1, 2: } -V_s + R_1I_1 + R_2I_2 = 0\\
\text{Current source: } I_s = I_2 - I_1
\end{cases} \,$


# Circuit Theory/Dangling Resistors

!100 ohm dangling resistor is only connected to the circuit by one
wire
!dangling resistor removed

When opening capacitors, inductors or current sources during circuit
analysis, sometimes a resistor is left connected to the circuit with
only one wire. It can be removed from the circuit.

It can be removed because there is no current through it. This means
that the electromotive force is the same through the resistor. The green
and the red dot are part of the same node.

The original voltage between green and black is going to be the same
voltage between red and black.  The total
Resistance will be r1+r2.


# Circuit Theory/Shorted Resistors

!Circuit With a Short of Resistor
3 !The
effective circuit: Resistor 3 removed because not impacting the
circuit

A wire in the left circuit is shorting the 100Ω resistor. All current
will bypass the resistor and travel through the short. The voltage
across the 100Ω resistor is going to be zero. The 100Ω resistor is not
impacting the circuit. For analysis purposes, the 100Ω resistor can be
removed.

The real world wire is going to have some resistance, and a tiny trickle
of current will go through the resistor. The exact magnitude is going to
depend upon the amount of resistance in the wire. The ideal math would
involve infinity. So typically the assumption of a short is done by
redrawing the circuit. This is why redrawing circuits when making
assumptions (such as removing a resistor because of the short) is
important.


# Circuit Theory/Open Puzzles

Sloppy people build circuits with shorts where wires accidentally touch.
These people are easy to spot. The circuit looks like a bird\'s nest.

Opens are harder. Intermittent opens are caused by bad wires, bad
connections, bad soldering, warm up/cool down expansion contraction,
dust, and physical movement of the circuit. Finding them is difficult.
One technique is to push every where in the circuit with a wooden stick
to try and re-create an open. Identifying opens is the best thing to
practice at the moment.

!Circuit with Open

This circuit has an open between the red and black dots. No current is
flowing. The electro motive force (EMF) extends from the battery +
terminal through resistors 4 and 5. The EMF from the negative terminal
of the battery extends through resistor 6. Thus the voltage drop between
the red and black dots is the battery voltage of 1 volt.

!Circuit where open causes dangling resistor, or where opening a short
puts the resistor back in the
circuit

Opening a wire can cause dangling resistors. A wire removed between red
and green removes resistor 2 from the circuit.

Opening a short can put a resistor back into the circuit. A wire between
between green and ground would short resistor 4. Opening this wire puts
resistor 4 back into the circuit.

If a wire connected black, green and red, then resistor 4 would be
shorted out of the circuit. Resistors 2 and 3 would combine in parallel,
and the combination would combine in series with resistor 1.

!Two opens complicating
things

Two wires have been removed from this circuit. This has left resistors
2,3,7,5 and 8 dangling.

It has made the EMF of red and green, the same as the EMF between
resistors 1 and 6.

It has made the EMF of the black and blue the same as the EMF between
resistors 6 and 4.

The voltage drop from red to black will be the same voltage drop from
green to blue.

!Which resistors are left dangling because of these two
opens?

Resistors 3,4,5 and 6 are no longer are participating in this circuit.

!What are the voltages between the colored
points?

The EMF of the green, red, yellow, blue points in the circuit is all the
same \... that of the positive terminal of the battery.

The EMF of the black is that of the negative terminal of the battery.

The voltage between any pair of green, red, yellow and blue is zero.

The voltage between black and any of the other colors is going to be 1
volt.


# Circuit Theory/One Port Devices

There are many circuits that can solve any particular task. Kirchhoff or
any other analysis technique can not describe the bare minimum, most
simple, alternative to an existing circuit that works.

The goal is to figure out a circuit\'s characteristics \... like an
eigenvalue \... the minimal parameters that
totally define it. The minimal characteristics or parameters serve two
purposes:

-   Enable design of alternative, cheaper, simpler circuits that do the
    same thing
-   Help designers using the existing circuit predict its impact on
    other circuits attached to it.

## One-Port

![](One_Port_Circuit.svg "One_Port_Circuit.svg")

Impedance, resistance and reactance are often drawn as a rectangle
instead of their normal circuit symbols. This is the beginning of
dealing with the real world rather than the ideal.

A \"port\" hides what is inside of it like a \"black
box\".

A resistor, capacitor, inductor and power source are one-port (two-wire)
devices. But in the real world a resistor could also have some
inductance, or capacitance, or act as an antenna channeling wireless
energy into the circuit.

More generally, a one-port circuit can have any number of passive
elements, independent and dependent sources and nodes. A port can be
described as a circuit that has been designed, analyzed and tested. At
this point, a circuit\'s internal details, its design, and its theory of
operation are no longer important. It becomes a building block. Complex
circuits may consist of a few ports where each port itself may be
complex.

When ports are named, miniaturized and mass-produced, they become a new
circuit device.

One-port devices are usually found at the beginning and the end of a
circuit. The middle of a circuit is built with two-port
devices, which are covered later.

A port has characteristics besides its impedance and whether it contains
a source or not. A port has parameters. The
ideal parameters we have been studying are sometimes called
lumped element parameters. These
parameters may change depending on how the port is \"driven\". Ports can
have different \"driving
points\".

## Example

Suppose we are going to connect a DC Voltage power supply to points a
and b. The goal is to characterize the insides of the box that contains
a DC voltage source and a couple of resistors. Do this by:

-   Plot V~ab~ as depending upon the current (instead of the actual
    situation where current is dependent upon the added voltage supply)
    so that the slope is resistance. From the plot find the slope
    (resistance). What does the vertical, V~ab~ axis intercept
    represent? What does the horizontal (current) axis intercept
    represent?
-   Calculate the V~ab~ if nothing is attached to the one port device.
-   Zero the voltage source and calculate the resistance between a and
    b.
-   Create another one port device that behaves the same with just one
    source and resistor. Simulate it and show that it produces the same
    V~ab~ curve or line.

<File:Example26aa.png%7CCircuit> that problem statement is referring to
<File:Example26c.png%7CSince> current is on the independent (x) axis and
voltage is dependent, need a current source.
<File:Example26e.png%7CSimulation> that can be found at
circuitlab.com

### Plot V~ab~

:   Circuit was simulated at
    circuitlab
    resulting in the plot above that matches the formula below.
:   Slope of the line is 66.66667 ohms and the intercept is -1 volt.
:   The equation of the line can be formed by node analysis at a:
    $$I - \frac{V_{ab}}{100} - \frac{V_{ab}+3}{200} = 0$$
:   Solving for V~ab~
    $$V_{ab} = \frac{200*I}{3} - 1$$
:   Can see in the simulation that the intercept when i = 0 is -1 and
    slope is 200/3.

### Calculate V~ab~ with nothing attached

Nothing attached means the current is zero, so from the equation
V~ab~=-1 \... which is the V~ab~ vertical axis intercept. !Circuit with
voltage source shorted so can compute resistance between points a and
b.

### Zero voltage source, calculate resistance between a and b

After shorting the voltage source, have 200 and 100 ohm resistors in
parallel so:

$$R_{ab} = \frac{1}{\frac{1}{200} + \frac{1}{100}} = \frac{200}{3}$$
which is the slope of the equation.

### Create simpler one port device

<File:Example26d.png%7Csimple> circuit the performs exactly the same way
as the more complicated one <File:Example26e.png%7Csimulation> at
circuitlab.com
is same as the 2 resistor circuit with -3 volt source


# Circuit Theory/Source Injection

Source injection is a trick used when parallel/series combinations
don\'t exist in a circuit.

Source injection helps find the overall impedance of a circuit from
V~s~/I~s~. Vs and Is are found in the phasor/complex frequency domain
using node or mesh analysis.

<File:Example24a.png%7Coriginal> complicated circuit, want to look at
just the red part <File:Example24b.png%7Cwant> to reduce middle
resistors into one equivalent resistor <File:Example24c.png%7Cremove>
middle part from circuit, inject source of 1 volt, find source current
and compute the equivalent resistance

!mupad screen shot of code node analysis of the
source injected
circuit
Suppose have a complicated circuit, want to break it up into smaller
sections, find a clump of passive devices in the middle of it, want to
find their equivalent, but can not combine in series or parallel.

This type of problem has to be done with source injection (or Y Δ
Transform .. but that is later).

One is really not physically injecting anything into the circuit, one is
just pretending so that node analysis can be used to find the overall
real (in phasor/complex frequency domain) impedance.

For the circuit above, the node analysis shows that the overall current
is:

$$I_s = 0.2542735043$$ This means that:

$$R_{eq} = \frac{V_s}{I_s} = \frac{1}{0.2542735043} =  3.9328 ohms$$


# Circuit Theory/Lab4.5.1

!the original circuit, R7 is the load, find thevenin equivalent of the
rest of the
circuit
!Finding Vth using ohm\'s
law !thevenin resistance
is calculated by zeroing the sources and opening the
load
!redrawing thevenin resistance network to make calculation
easier

Example, find the thevenin equivalent of this circuit, treating R7 as
the load.

-   Simulate the circuit, displaying load voltage and current as the
    load is swept through a range of resistance values
-   Simulate the thevenin equivalent circuit and again sweep the load
    voltage and current through a range of resistance values

## Finding Thevenin Voltage

Open the load (resistor R7), and find the voltage across it\'s
terminals.

R~5~ and R~6~ are dangling and can be removed.

V~th~ = V~A~ - V~B~

V~A~ = 2-V~R1~ = 2 - (2-5)\*2.2/(2.2+4.7) .. voltage divider

V~A~ = 2.9565

V~B~ = 5-V~R3~ = 5 - 5\*6.8/(6.8+6.8) .. voltage divider

V~B~ = 2.5 volts

V~th~ = 2.9565 - 2.5 = 0.4565 volts

Can check with this
simulation.

## Finding Thevenin Resistance

Remove the load, zero the sources.

Redraw up and down so the parallel/serial relationships between the
resistors are obvious.

-   $R_{th} = 1 + \frac{1}{\frac{1}{2.2} + \frac{1}{4.7}} + \frac{1}{\frac{1}{6.8} + \frac{1}{6.8}} + 1.5$
-   $R_{th} =  7.3986$

## Finding Norton Current

I~N~ = V~th~/R~th~ = 0.4565/7.3986 = 0.0617 amp

## Simulating the original circuit

In the
simulation,
can see the computed Norton\'s current when the load is 0 ohms.

Can see the computed Thevenin voltage when the load is around 20 ohms
which approximates an open.

## Comparing with the Thevenin Equivalent

In this
simulation,
can see the same values, except this time the load voltage is relative
to ground, so don\'t have to look at a drop or differences between two
voltages as with the original circuit simulation.

<File:Example25e.png%7CSweep> simulation of original circuit for R7
values of 47 ranging from 0 to 20 <File:Example25f.png%7CThe> thevenin
equivalent with the R7 load in place <File:Example25g.png%7CSweep>
simulation of the thevenin equivalent circuit for R7 values ranging from
0 to 20 ohms


# Circuit Theory/Thevenin-Norton

## Vth using Node

!opening load, finding V~th~ using Node ..
code

$$V_{th} = 6.4516$$

## In using Node

!shorting load, finding I~n~ using Node ..
code

$$I_N = 1.064773736$$

## Rth or Rn

$$V_{th}/I_N= \frac{6.4516}{1.064773736} =  6.0591 ohms$$

## Finding Rth using source injection and node

<File:Example23d.png%7Czero> sources to find Rth
<File:Example23e.png%7Cadd> source injection since parallel/series
combinations do not exist <File:Example23g.png%7Credraw> up and down
before solving

Here is the mupad/matlab code that generates the
answer R~th~ = 6.0591 ohms.

## Comparing Node with Thevenin Equivalent

!solving using Node ..
code
!solving using Thevenin
equivalent Solving
the node equations yields:

$$V_a = 5.393$$

$$V_b = 1.1673$$

$$V_c = 1.107$$

$$i_{12} = 0.3571$$

$$v_{12} = 4.286$$ Using the Thevenin equivalent (and voltage divider)
to compute voltage across the 12 ohm resistor:

$$v_{12} = V_s*\frac{12}{R{total}}$$

$$v_{12} = 6.4516*\frac{12}{6.0591+12} = 4.287$$ So they match \...

Thevenin voltage and resistance can not be computed from a node analysis
of the entire circuit, but the node analysis of the entire circuit can
be used to check if the thevenin equivalent produces the same numbers.


# Circuit Theory/Example70

!original circuit

$$V_{s1} = \frac{\sqrt{2}}{6}\cos (t+\frac{\pi}{4})$$

$$V_{s2} = \cos (t+\frac{\pi}{3})$$

$$\mathbb{V}_{s1} = \frac{1}{6}(1 + j)$$

$$\mathbb{V}_{s2} = \frac{1}{2}(1 + j\sqrt{3})$$ The series components
can be lumped together .. which simplifies the circuit a bit.

## Node Analysis

!Node analysis !mupad and matlab
/code/ for all the work
below

$$\frac{\mathbb{V}_{s1} - \mathbb{V}_a}{5} - \mathbb{V}_a - \frac{\mathbb{V}_a + \mathbb{V}_{s2}}{j\sqrt{3}} = 0$$

$$\mathbb{V}_a = -0.42063 + j0.065966$$

## Mesh Analysis

!Mesh analysis

$$i_1 - i_2 - V_{s1} + 5 * i_1 = 0$$

$$i_2 j\sqrt{3} - V_{s2} + i_2 - i_1 = 0$$

$$i_3 = i_1 - i_2$$ Solving

$$i_3 = -0.42063 + j.065966$$ Which is the same as the voltage through
the 1 ohm resistor.

## Thevenin voltage

!Thevenin voltage requires opening the
load

Make ground the negative side of $V_{s2}$, then:

$$V_{th} = V_A - V_B$$

$$V_{th} = i*j\sqrt{3} - V_{s2}$$

$$V_{th} = \frac{V_{s1} + V_{s2}}{5 + j\sqrt{3}}*j\sqrt{3} - V_{s2}$$
Solving

$$V_{th} = -0.747977 - j0.5492$$

## Norton Current

<File:Example70norton1.png%7Cshort> out the load
<File:Example70norton2.png%7Csplit> into two circuits so can use
superposition <File:Example70norton3.png%7Chalf> the circuit is shorted
out by shorting the voltage sources

$$i_n = i_1 - i_2 = \frac{V_{s1}}{5} - \frac{V_{s2}}{j\sqrt{3}}$$

$$i_n = -0.4667 + j0.3220$$

## Thevenin/Norton Impedance

![](Example70impedance.png "Example70impedance.png")

short voltage sources, open current sources, remove load and find
impedance where the load was attached

$$Z_{th} = \frac{1}{\frac{1}{5} + \frac{1}{j\sqrt{3}}} = 0.537 + j1.5465$$
check

$$Z_{th} = \frac{V_{th}}{I_n} = 0.537 + j1.5465$$ yes! they match

## Evaluate Thevenin Equivalent Circuit

![](Example70theveninEquivalent.png "Example70theveninEquivalent.png")

Going to find current through the resistor and compare with mesh current

$$i = \frac{V_{th}}{Z_{th} + 1} = -0.42063 + j0.06599$$ yes! they match

## Find Load value for maximum power transfer

$$Z_{L} = z_{th}^* = 0.537 - j1.5465$$

## Find average power transfer with Load that maximizes

$$Z_{th} + Z_{L} = 0.537*2$$

$$P_{avg} = \frac{Re(V_{th})^2}{Z_{th} + Z_{L}} = \frac{\sqrt{0.747977^2 + 0.5492^2}}{2*0.537} = 0.8037 watts$$

## Simulation

![](Example70simulation2.png){width="800"}

The circuit was
simulated.
A way was found to enter equations into the voltage supply parameters
which improves accuracy:

<File:Example70-vs11.png%7Ctype> sqrt(3) instead of a numeric
approximation <File:Example70-vs2.png%7Cadded> pi/2 to convert from cos
to sin sources

To compare with the results above, need to translate the current and
voltage through the resistor into the time domain.

### Period

Period looks right about 6 seconds \... should be:

$$T = \frac{1}{f} = \frac{2*\pi}{w} = 2*\pi = 6.2832$$

### Current

Current through 1 ohm resistor, once moved into the time domain (from
the above numbers) is:

$$i(t) = 0.4258*cos(t + 171^{\circ})$$ From the mesh analysis, the
current\'s through both sources were computed:

$$i_{s1} = 0.1192*cos(t + 9.72^{\circ})$$ The magnitudes are accurate,
they are almost π out of phase which is can be seen on the simulation.

### Voltage

The voltage is the same as the current through a 1 ohm resistor:

$$v(t) = 0.4258*cos(t + 171^{\circ})$$ The voltage of the first (left)
source is:

$$V_{s1} = \frac{\sqrt{2}}{6} cos(t + \frac{pi}{4}) = 0.2357 * cos(t + 45^{\circ})$$
The magnitudes match. The voltage through the source peaks before the
current because the first source sees the inductor.

The voltage through the resistor should peak about 171 - 45 = 126°
before the source \... which it appears to do.


# Circuit Theory/Superposition

## Goal

Split multisource circuit into smaller, simpler circuits, compute
current or voltage and add.

## Procedure

Pick one source, turn off all or set to zero all others:

-   Set Voltage Sources to V=0, doesn\'t care about current so is a
    short
-   Set Current Sources to I=0, doesn\'t care about the voltage so turns
    into an open

## Example 1

Find the current through the 3 ohm resistor assuming moving left to
right is positive:

<File:Example16a.png%7CThe> original circuit is equal to
<File:Example16b.png%7Cthis> circuit where i = 24/5 plus
<File:Example16c.png%7Cthis> circuit where i = -14/5 (current divider)
plus <File:Example16d.png%7Cthis> circuit where i = -3/5.

The total current in the direction shown on the original diagram is
going to be:
$\frac{24}{5} - \frac{14}{5} - \frac{3}{5} = \frac{7}{5} amp$

## Example 2

Find the current through the 4 ohm resistor assuming moving left to
right is positive:

<File:Example17a.png%7CThe> original circuit is equal to
<File:Example17b.png%7Cthis> circuit which can be re-drawn as
<File:Example17bs.png%7Cthis> circuit where i = 35/3 = 11.67 plus
<File:Example17c.png%7Cthis> circuit which can be re-drawn as
<File:Example17cs.png%7Cthis> circuit where i = -11/36 = -.3056 plus
<File:Example17d.png%7Cthis> circuit which can be re-drawn as
<File:Example17ds.png%7Cthis> circuit where i = 25/18 = 1.3889 (current
divider)

$i = 35/3 - 11/36 + 25/18 = 51/4 = 12.75 amps$

Simulation at circuit
lab confirms the
answer:

!DC Simulation at Circuit
Lab


# Circuit Theory/Extra Element

The Extra Element technique helps break down one complicated problem
into several simpler ones like superposition. However the goal is to
find impedance rather than current or voltage.

By removing the element that most complicates the circuit the overall
circuit impedance can be obtained.

$$Z_{in} = Z^{\infty}_{in} \left( \frac{1+\frac{Z^0_{e}}{Z}}{1+\frac{Z^{\infty}_{e}}{Z}} \right)$$

where

$$Z\$$ is the impedance chosen as the extra element to be removed

$$Z^{\infty}_{in}$$ is the input impedance with Z removed (or made
infinite)

$$Z^0_{e}$$ is the impedance seen by the extra element Z with the source
shorted (or made zero)

$$Z^{\infty}_{e}$$ is the impedance seen by the extra element Z with the
source opened (or made infinite)

Computing these three terms may seem like extra effort, but they are
often easier to compute than the overall input impedance.

### Example

!4 resistors, 1 capacitor
example !set up for
node analsysis !node
analysis in mupad ../code/ .. need to solve for
vs/current to compare
answers

Consider the problem of finding $Z_{in}$ for the circuit in Figure 1
using the EET (note all component values are unity for simplicity). If
the capacitor (gray shading) is denoted the extra element then

$$Z = \frac{1}{s}$$

Removing this capacitor from the circuit we find

<File:Example18b.png%7Ccapacitor> removed, looking at the input (source
input) <File:Example18c.png%7Ccapacitor> removed, reorganizing circuit
so can see input impedance $Z^{\infty}_{in}$

$$Z^{\infty}_{in} = 2\|1 +1 = \frac{5}{3}$$

Calculating the impedance seen by the capacitor with the input shorted
we find

<File:Example18d.png%7Cshorted> source, finding $Z^0_{e}$
<File:Example18h.png%7Cshorted> source redrawn

$$Z^0_{e} = 1\|(1+1\|1) = \frac{3}{5}$$

Calculating the impedance seen by the capacitor with the input open we
find

<File:Example18d.png%7Copen> source, finding $Z^{\infty}_{e}$
<File:Example18h.png%7Copen> source redrawn

$$Z^{\infty}_{e} = 2\|1+1 = \frac{5}{3}$$

Therefore using the EET, we find

$$Z_{in} = \frac{5}{3} \left(\frac{1+\frac{3}{5}s}{1+\frac{5}{3}s}\right)$$

Note that this problem was solved by calculating three simple driving
point impedances by inspection.


# Circuit Theory/Symmetry

Some very complicated circuits can be solved by seeing symmetry. Three
examples are presented below:

## Example 1

Bridge Balance

<File:Example19a.png%7COriginal> Complicated Circuit
<File:Example19b.png%7CRedrawn> up and down <File:Example19c.png%7CZ>
impedances are all equal, so middle Z has no current going through it,
nodes on either side are at the same EMF <File:Example19d.png%7Cmiddle>
Z can be replaced by short or open, since no current is going through it

## Example 2

Cube

<File:Example20a.png%7Coriginal> flattened cube of resistors
<File:Example20b.png%7Cidentifying> identical EMF locations
<File:Example20d.png%7Credrawing> idential EMF as the same nodes, can
see three groups of parallel resistors

## Example 3

2D-Grid\
Suppose there is an infinite 2 dimensional grid of impedances (Z). What
is the input impedance if connected across (in parallel) with any given
impedance?

<File:Example21a.png%7CCurrent> due to injection at any spot splits in
quarters and then begins to fill the resistive grid like water filling
an infinite bucket. <File:Example21b.png%7CCurrent> removed at another
spot splits in quarters and then begins to drain the resistive grid like
draining an infinite bucket. <File:Example21c.png%7CTogether> the two
create a steady state situtation where the question \"What is the input
impedance\" can be asked. The current i is i/4 + i/4 = i/2. v = i/2\*Z
so v/i = Z/2 = input impedance.

If the grid were three dimensional, the current would split into 6 equal
sections, thus the input impedance would be Z/3.

So what does this mean? It helps us understand that the infinity of
space has an impedance:
376.730\... ohms which is plank\'s
impedance \* 4π and is related to the
speed of light, the permeability of free space and permitivity of free
space.

Perhaps this is related
entanglement and to the trinity
since: $\frac{Z}{3} = \frac{1}{\frac{1}{Z} + \frac{1}{Z} + \frac{1}{Z}}$


# Circuit Theory/Y Δ

!Circuit after Δ Y transformation of top bridge .. can now use
parallel/serial combinations rather than source injection to find
Thevenin\'s
resistanceThe
bridge circuit example was
solved with source injection, but could have been solved with a Y Δ
transformation. ![](Example23g.png "Example23g.png")\
The 5,2 and 3 ohm resistors form a Δ that could be transformed into a Y.
![](Wye-delta-2.svg)\
The equations are:

$$R_1 = \frac{R_bR_c}{R_a + R_b + R_c}, R_2 = \frac{R_aR_c}{R_a + R_b + R_c}, R_3 = \frac{R_aR_b}{R_a + R_b + R_c}$$

$$R_1 = \frac{5*2}{3 + 5 + 2}=1, R_2 = \frac{3*2}{3 + 5 + 2}=0.6, R_3 = \frac{3*5}{3 + 5 + 2}=1.5$$
Now Thevenin\'s resistance can be solved by parallel and serial
combinations:

$$R_{th} = \frac{1}{\frac{1}{8} + \frac{1}{10.6}} + 1.5 = 6.0591$$

Which is the same value found through source
injection.


# Circuit Theory/Quadratic Equation Revisited

### The Quadratic Equation

The roots to the quadratic polynomial

$y = ax^2 + bx +c$

are easily derived and many people memorized them in high school:

$\begin{align}
  x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.
\end{align}$

### Derivation of the Quadratic Equation

To derive this set $y = 0$ and complete the square:

$\begin{align}
  0 &= ax^2 + bx +c  \\
  0 &= a \left( x^2 + \frac{b}{a} x + \frac{c}{a} \right)\\
  0 &=  x^2 + \frac{b}{a} x + \left(\frac{b}{2a}\right)^2 + \frac{c}{a} - \left(\frac{b}{2a}\right)^2 \\
  0 &= \left( x + \frac{b}{2a} \right)^2 + \left(\frac{c}{a} - \left(\frac{b}{2a}\right)^2 \right).
\end{align}$

Solving for $x$ gives

$\begin{align}
  0 &= \left( x + \frac{b}{2a} \right)^2 + \left(\frac{c}{a} - \left(\frac{b}{2a}\right)^2\right) \\
  \left( x + \frac{b}{2a} \right)^2 &= -\left(\frac{c}{a} - \left(\frac{b}{2a}\right)^2\right) \\
  &= \frac{b^2 - 4ac }{\left(2a\right)^2}.
\end{align}$

Taking the square root of both sides and putting everything over a
common denominator gives

$\begin{align}
  x + \frac{b}{2a}  &= \pm \sqrt{\frac{b^2 - 4ac }{\left(2a\right)^2}} \\
  x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}.
\end{align}$

### Numerical Instability of the Usual Formulation of the Quadratic Equation

Middlebrook has pointed out that this is a poor expression from a
numerical point of view for certain values of $a$, $b$, and $c$.

\[Give an example here\]

Middlebrook showed how a better expression can be obtained as follows.
First, factor $-\frac{b}{2a}$ out of the expression:

$\begin{align}
  x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \\
    &= \left( -\frac{b}{2a} \right) \left( 1 \pm \sqrt{1 - \frac{4ac}{b^2}} \right).
\end{align}$

Now let

$Q^2 = \frac{ac}{b^2}.$

Then

$\begin{align}
  x &= \left( -\frac{b}{2a} \right) \left( 1 \pm \sqrt{1 - 4Q^2} \right)
\end{align}$

### A More Numerically Stable Formulation of the Negative Root

Considering just the negative square root we have

$\begin{align}
  x_1 &= \left( -\frac{b}{2a} \right) \left( 1 - \sqrt{1 - 4Q^2} \right).
\end{align}$

Multiplying the numerator and denominator by $1 + \sqrt{1 - 4Q^2}$ gives

$\begin{align}
  x_1 &= \left( -\frac{b}{2a} \right) \left( 1 - \sqrt{1 - 4Q^2} \right)
\left( \frac{1 + \sqrt{1 - 4Q^2}}{1 + \sqrt{1 - 4Q^2}} \right) \\
&= \left( -\frac{b}{2a} \right) \left( \frac{1 - 1 + 4Q^2}{1 + \sqrt{1 - 4Q^2}} \right) \\
&= -\frac{2 b Q^2}{a} \left( \frac{1}{1 + \sqrt{1 - 4Q^2}} \right) \\
&= -\frac{2 b \left( \frac{ac}{b^2} \right)}{a} \left( \frac{1}{1 + \sqrt{1 - 4Q^2}} \right) \\
&= -\frac{2 c}{b} \left( \frac{1}{1 + \sqrt{1 - 4Q^2}} \right) \\
&= -\frac{c}{b} \left( \frac{1}{\frac{1}{2} + \frac{1}{2}\sqrt{1 - 4Q^2}} \right).
\end{align}$

By defining

$F = \frac{1}{2} + \frac{1}{2}\sqrt{1 - 4Q^2}$

we can write

$\begin{align}
  x_1 &= -\frac{c}{bF} .
\end{align}$

Note that as $Q \to 0$, $F \to 1$.

### Finding the Positive Root Using the Same Approach

Turning now to the positive square root we have

$\begin{align}
  x_2 &= \left( -\frac{b}{2a} \right) \left( 1 + \sqrt{1 - 4Q^2} \right) \\
&= \left( -\frac{b}{a} \right) \left( \frac{1}{2} + \frac{1}{2}\sqrt{1 - 4Q^2} \right) \\
&= -\frac{bF}{a}.
\end{align}$

Using the two roots $x_1$ and $x_2$, we can factor the quadratic
equation

$\begin{align}
  y &= a x^2 + b x + c \\
&= a \left( x^2 + \frac{b}{a} + \frac{c}{a}\right) \\
&= a \left( x - x_1\right) \left( x - x_2\right) \\
&= a \left( x + \frac{c}{bF}\right) \left( x +\frac{bF}{a}\right).
\end{align}$

### Accuracy for Low $Q$

For values of $Q \le 0.3$ the value of $F$ is within 10% of 1 and we may
neglect it. As noted above, the approximation gets better as $Q \to 0$.
With this approximation the quadratic equation has a very simple
factorization:

$\begin{align}
  y &= a x^2 + b x + c \\
&\approx a \left( x + \frac{c}{b}\right) \left( x +\frac{b}{a}\right),
\end{align}$

an expression that involves no messy square roots and can be written by
inspection. Of course, it is necessary to check the assumption about $Q$
being small before using the simplification. Without this
simplification, $F$ needs to be calculated and the roots are slightly
more complicated.

\[Explore the consequences if $Q > 0.5$.\]


# Circuit Theory/Transients

Transient analysis produces an equation of voltage or current.

## Energy Imbalance

The temporary conditions are caused by an energy imbalance. The energy
imbalance occurs between power sources and capacitors or inductors.
Power sources may charge capacitors or inductors. The capacitors or
inductors may dump previously stored energy into resistors, each other
or charge power sources.

Transients occur while energy is being balanced in the circuit.

## Transient Origins

The events that can cause transients are:

-   switching on power
-   changing a component\'s value in a functioning circuit
-   discharging a component after the circuit has been turned off

Turning a knob can change a value, but so can temperature, light,
acceleration, stretching, compressing, humidity, etc. Electrical
transducers sense non-electrical energy and
cause resistance, capacitance or inductance values to change or change
the energy stored in a capacitor/inductor.

## First & Second Order Analysis

First order circuits have either a capacitor or inductor.

Second order circuits have two energy storage elements and require a
different analysis technique.

First order transients voltages and currents are typically one
sinusoidal riding one exponential.

Second order transients are typically described as one of the following:

-   overdamped
-   critically damped
-   underdamped
-   undamped

The word \"damped\" refers how two different types of energy storage
elements (capacitors and inductors) interact as energy is dissipated.
The math in general shows the combination of two sinusoidals riding on
two exponentials.

## Math Summary

There are two ways to solve transient problems.

#### Differential Equations

Something causes the energy imbalance. The goal is to find the final
value of a charging circuit, not the equation describing how energy was
added to the circuit.

The goal is to find an equation for the discharge. The steps are to form
a differential equation (no integrals at any step) and evaluate
constants. Differential equation analysis requires computing a constant
C. Unfortunately, C = 0 in most of the examples below. This is because
the equation describes time from 0 to ∞. At t=∞, most designs want all
energy eliminated from a circuit.

#### Convolution Integral


# Circuit Theory/Initial Conditions

## Both Voltage and Current

Initial conditions describe the energy stored in every capacitor and
every inductor.

Initial conditions are completely specified only when both voltage and
current for all capacitors and all inductors is known.

## Assume Zero

Assume zero for the capacitor voltage and/or inductor current if no
information is given.

## Inductor Initial Conditions

Every inductor has two initial conditions: current and voltage. When a
switch is thrown that eliminates all power supplies, (or connects new
power supplies) the inductor can turn into a power supply itself. The
current through an inductor maintains it\'s direction and magnitude
between $t(0_-)$ and $t(0_+)$. The voltage may instantaneously switch
polarity and/or magnitude.

Energy changes elsewhere in a circuit cause an inductor to block these
changes by appearing as an open. An Inductors will allow any voltage to
appear across it\'s terminals in order to maintain the energy in its
magnetic field. An inductor doesn\'t want the current to increase or
decrease. Any current change will change the energy stored in its
magnetic field.

But gradually, an inductor will accept change. And after a very long
time it acts like a wire or short allowing current only limited by other
devices in the circuit to pass through it.

## Capacitor Initial Conditions

Every capacitor has two initial conditions: voltage and current. When a
switch is thrown that eliminates all power supplies, (or adds power) the
capacitor can turn into a power supply itself. A capacitor maintains
it\'s voltage polarity and value between $t(0_-)$ and $t(0_+)$, but the
current may instantaneously switch directions and may switch magnitude.

A capacitor reacts to energy changes by instantly turning itself into a
short or an ideal wire with no resistance. A capacitor doesn\'t care
about the current flowing through it. A capacitor doesn\'t want the
energy stored in the electric field between its plates to change. So the
voltage is maintained, but the current can switch direction and
magnitude. The current will only be limited by other devices in the
circuit.

But after a very long time, a capacitor gradually adapts to change and
eventually develops a voltage that the rest of the circuit doesn\'t try
to change. At this point the capacitor turns into an open.

Inductors and capacitors both react to energy changes, but in exactly
the opposite ways.

## Particular Solution

The particular solution in response to a step function turns into a set
of conditions that have to be present at t = ∞.

These conditions should be true at all times .. and can be used to help
evaluate constants.

## Progression

Start with an expression with a voltage across the capacitor. This way
the progression through all possible initial conditions requires taking
derivatives:

$$H(s)=\frac{\mathbb{V}_C}{\mathbb{V}_s} \Rightarrow V_C(t) \Rightarrow i(t) = C{d V_C(t) \over dt} \Rightarrow V_L = L{d i(t) \over dt}$$
Starting at V_L means evaluating integrals and their constants:

$$H(s)=\frac{\mathbb{V}_L}{\mathbb{V}_s} \Rightarrow V_L(t) \Rightarrow i(t) = \frac{1}{L}\int V_L dt \Rightarrow V_C = \frac{1}{C}\int i(t) dt$$
Starting at the current means that may have to do both a derivative and
an integral to evaluate all constants.

This detail is displayed by doing one example
problem
four different ways.

## Summary

  t=0~-~ t=0~+~             source                   energy imbalance response   value                               starting point
  ------------------------- ------------------------ --------------------------- ----------------------------------- -----------------------------------------
  V~c~(0~-~) = V~c~(0~+~)   capacitor itself         short                       problem statement/assume 0          particular solution to previous problem
  I~c~(0~-~) ≠ I~c~(0~+~)   circuit cap is in        doesn\'t care               determined by rest of circuit       capacitor terminal relation, node, mesh
  I~L~(0~-~) = I~L~(0~+~)   inductor itself          open                        problem statement/assume 0          particular solution to previous problem
  V~L~(0~-~) ≠ V~L~(0~+~)   circuit inductor is in   doesn\'t care               determined by the rest of circuit   inductor terminal relation, node, mesh


# Circuit Theory/Time Constants

Homogeneous equations are exponential. A homogeneous differential
equation is discharging or charging (0 value constant DC source). A
non-homogeneous differential equation has a sinusoidal source. It can be
solved by splitting into a homogeneous solution plus a particular
solution. The steady state solutions earlier were particular solutions.

:   **homogeneous equation ⇒ discharging (DC source) ⇒ homogeneous
    solution**

\
:**non-homogeneous equation ⇒ AC source ⇒ particular (steady state) +
homogeneous (discharging) solution**

The proof of the exponential solution to the discharging circuit is is
hard:

-   guess solution
-   see if it is possible
-   if possible assume it is the solution

In this case it works because there is only one guess:

!Capacitor voltage
step-response.{width="230"}
!Resistor voltage
step-response.{width="230"}

that we know of.

A first order differential looks like this:

$$g(t) +\tau \frac{d g(t)}{dt} = 0$$

A solution is:

$$g(t) = e^{- \frac{t}{\tau}}$$
(Gödel
proved that there are always other truths possible. We can not be
certain this is the only solution.)

Tau, τ, or $\tau$ has a name:

$$\tau$$ = time constant

The Steady State(particular) definition is:

$$t \ge 5*\tau$$ since for charging and discharging:

$$1-e^{-5} = .9933, e^{-5} = 0.0063$$

Try to write all answers in the form of

$$g(t) = e^{- \frac{t}{\tau}}$$ instead of:

$$g(t) = e^{number * t}$$ The reason is: looking at a number and taking
the inverse of it is hard. This makes it hard to look at an equation and
\"see\" it\'s time constant.

The units of any time constant are seconds. In circuits with both
inductors and capacitors, there are two time constants that are called
\"zeros\". They are called zero\'s because they are solutions to the
particular solution which sets the differential to zero. They are given
the symbol \"s\" and are identical to the complex frequency concept.


# Circuit Theory/1Initially Excited

Circuits are used to charge capacitors and inductors. Then the
inductor/capacitor is switched out of the charging circuit and into the
discharging circuit. There are three concepts:

-   charging circuit \... assume on a long time if time on not specified
    \... assume steady state so capacitors are opens and inductors are
    shorts
-   switching circuit (different for capacitors and inductors)
-   discharging circuit \... assume initially capacitors are shorts and
    inductors are opens

There are two circuits to analyse: charging and discharging:

-   Charging circuit \... Assume initial conditions zero, find steady
    state (particular) solution \... these become the initial conditions
    to the discharging circuit.
-   Discharging circuit find the (homogeneous solution).

Solving the discharging circuit has these steps:

-   assume the solution is an exponential
-   find an exponential solution
-   use the initial conditions and final value conditions to find the
    constants.
-   If an exponential solution can be found (i.e. there is a real part),
    then the assumption was valid.

## Capacitors

<File:Ch7CapSwitchingCircuit.png%7CCapacitor> charging and discharging
circuit separated by a switch <File:Ch7capcharging.png%7CEquivalent>
charging circuit <File:Ch7capswitched.png%7CMost> switches are
BBM (break before make) so
the capacitor is an open while the single pole is being thrown between
the two poles. Super
capacitors store lots of
energy, charge up very fast, discharge very fast and could replace
batteries. <File:Ch7capDischarging.png%7CEquivalent> discharging circuit

### Charge Analysis

Charge Analysis is steady state analysis. Assume the circuit has been on
a long time. The capacitor has had a long time to charge up.

What is different is that instead of a sinusoidal source, there is a DC
voltage source. There is going to be a DC steady state voltage across
the capacitor.

A capacitor looks like an open when fully charged, so the full source
voltage is going to be across the capacitor. So in this case the initial
voltage across the capacitor is 1 volt.

### Discharge Analysis

!Looking at a capacitor discharging, marking up the current direction
and voltage polarity consistent with the normal terminal relations ..
for wikibook circuit
theory
A trivial mesh or loop analysis (both result in the same equation) would
be:

$$V_R + V_c = 0$$

$$R*i + V_c = 0$$ From the capacitor terminal relationship:

$$i=C{d Vc \over dt}$$ So substituting:

$$RC{d Vc \over dt} + V_c =0$$

Of course, after a long time, the capacitor discharges, the resistor
dissipates all the energy and both current and voltage everywhere will
be zero. But what is the equation in the time domain that describes how
the voltage and current go to zero?

Notice that the current is going down while charging, but switches to
going up when discharging. This can be instantaneous.

#### finding time constant

The general technique is to assume this form:

$$V_c = A*e^{-\frac{t}{\tau}}$$

Substituting into the above differential equation:

$$-\frac{RCA}{\tau}e^{-\frac{t}{\tau}} + A*e^{-\frac{t}{\tau}} = 0$$
Dividing through by A and the exponential, have:

$$-\frac{RC}{\tau} + 1 = 0$$ Solving for tau:

$$\tau = RC$$

#### finding the constants

So the formula for voltage across the capacitor is now:

$$V_c = A*e^{-\frac{t}{RC}} + C$$ This includes the steady state
particular solution of 0 and the constant C that comes from solving a
differential equation.

The initial voltage across the capacitor is +1 volt at t=0~+~. This
means that:

$$V_c(0_+) = 1 = A + C$$

After a long period of time, the V_c(t) = 0. This helps us find find C:

$$V_c(\infty) = A*0 + C = 0$$ So C = 0 and A = 1 and:

$$V_c(t) = e^{-\frac{t}{RC}}$$

#### finding the current

!Looking at a capacitor discharging, marking up the current direction
and voltage polarity consistent with the normal terminal relations ..
for wikibook circuit
theory
V~c~=-V~r~ or could plug into the capacitor terminal relation

$$I = \frac{V_r}{R} = \frac{-Vc}{R} = -\frac{e^{-\frac{x}{RC}}}{R}$$
Thus for this circuit:

$$V_C = e^{-\frac{t}{RC}}=e^{-\frac{t}{10\mu s}}$$

$$V_r = -e^{-\frac{t}{10\mu s}}$$ And:

$$I = - \frac{e^{-\frac{t}{10\mu s}}}{10}$$

#### Interpreting the results

V~c~ is in the polarity indicated. V~R~ is opposite the polarity drawn.
The current is going in the opposite direction drawn, which makes sense
if the capacitor is acting like a voltage source and dumping it\'s
energy into the resistor. Both are going to be essentially zero after 5
time constants which is 50 μs.

The homogeneous solution was easy to find because a DC source was used
to charge the circuit. The particular solution of the discharge circuit
was 0 because there was no forcing function.

## Inductors

<File:Ch7IndustorSwitchingCircuit.png%7CThis> circuit shows an inductor
sitting between a charging circuit and discharging circuit. Because most
switches are BBM, a push button was added to short the inductor before
the SPDT switch is thrown. Both switches could be replaced by a single
SPDT MBB switch. However
simulation software typically just has BBM switches.
<File:Ch7InductorCharging.png%7CThe> equivalent inductor charging
circuit <File:Ch7IndustorSwitchingCircuitEffective.png%7CThe> equivalent
circuit after the push button switch is pressed, but before the SPDT BBM
switch is thrown. <File:Ch7InductorSwitched.png%7CThe> equivalent
circuit after the SPDT BBM switch is thrown while the push button switch
maintains contact. Superconductors can be energy
storage devices just like super capacitors. Current moves at the speed
of light through a circular wire that acts like a continuous inductor.
<File:Ch7InductorDischarging.png%7CThe> equivalent inductor discharging
circuit after the push button switch is released.

### Charge Analysis

!When inductor has same initial current as the current source, then no
current is going to flow through the short. Superposition says the
currents are going to cancel in the
short.
Charge Analysis is steady state analysis. Assume the circuit has been on
a long time. The inductor has had a long time to build up its magnetic
fields.

What is different is that instead of a sinusoidal source, there is a DC
current source. There is going to be a DC steady state current through
the inductor.

An inductor looks like a short when fully charged, so the full source
current is going through the inductor. So in this case the initial
current is 1 amp.

### Shorted source and inductor Analysis

!An inductor stores it\'s energy in a magnetic field, current has to
continue to move to keep the magnetic field from collapsing \... this is
the basis of a
superconductor
!Inductor with initial current discharging through resistor, for
wikibook circuit
theory
Shorting an inductor and current source by pushing the button of SW1 is
safe. (It is dangerous to open wires to an inductor or current source).
With ideal components, there will be no current through the short.
However current through the inductor remains the same and the inductor
remains charged up.

### Shorted inductor energy storage

The instant the SPDT switch cuts out the current source, the inductor\'s
current appears in the short. The inductor and shorting wire do not
store energy very long (unless frozen because the
wire acts like a resistor).

### Discharge Analysis

Immediately after SW2 has completed moving the throw over to the second
pole and the push button switch is released, the current of 1amp still
flows through the inductor. A voltage instantly appears across the
inductor and resistor. A trivial mesh or loop analysis (both result in
the same equation) would be:

$$V_R - V_L = 0$$ Looking at the circuit markup, the current and voltage
don\'t have the positive sign convention relationship so the inductor\'s
terminal relationship has a negative sign:

$$V_L= - L\frac{di}{dt}$$ So:

$$R*i + L\frac{di}{dt} = 0$$ Of course, after a long time, the inductor
discharges, the resistor dissipates all the energy and both current and
voltage everywhere will be zero. But what is the equation in the time
domain that describes how the voltage and current go to zero?

Notice that the voltage is positive on top of the inductor but switches
polarity when discharging. This can be instantaneous.

#### finding time constant

The general technique is to assume this form:

$$i = A*e^{-\frac{t}{\tau}}$$

Substituting into the above differential equation:

$$R*A*e^{-\frac{t}{\tau}} + L*\frac{d (A*e^{-\frac{t}{\tau}})}{dt} = 0$$
Dividing through by A and then evaluating the derivative, have:

$$R*e^{-\frac{t}{\tau}} - \frac{L*e^{-\frac{t}{\tau}}}{\tau} = 0$$
Dividing through by the exponential:

$$R - \frac{L}{\tau}=0$$ Solving for tau:

$$\tau = \frac{L}{R}$$

#### finding the constants

So the formula for current now is:

$$i = A*e^{-\frac{t}{\frac{L}{R}}} + C$$ The steady state particular
solution is 0, and the constant C comes from solving the differential
equation.

The initial current is 1 amp at t=0~+~. This means that:

$$1 = A + C$$ After a long time, there is nothing going on in the
circuit so:

$$i(\infty) = A*0 + C$$ So A=1 and C=0 thus:

$$i(t) = e^{-\frac{t}{\frac{L}{R}}}$$

#### finding the voltage across the Inductor/Resistor

V~L~=V~r~ or could plug into the inductor terminal relation

$$V_R = R*i = R * e^{-\frac{t}{\frac{L}{R}}}$$ of plugging into the
terminal relation:

$$V_L = - L*\frac{d (e^{-\frac{t}{\frac{L}{R}}})}{dt} = -L*(\frac{-R}{L})e^{-\frac{t}{\frac{L}{R}}} = Re^{-\frac{t}{\frac{L}{R}}}$$
So in summary:

$$V_R = V_L = 10*e^{-\frac{t}{0.1\mu s}}$$

$$i = e^{-\frac{t}{0.1\mu s}}$$

#### Interpreting the results

Maintaining the current and magnetic field energy of an inductor
requires shorting it during the switching between circuits. This would
be just as simple as switching a capacitor, but a different type of
switch is required: \... a make before break switch .. so that two
circuits are connected simultaneously.

The discharge circuit was marked up with the final directions and
polarity of everything. But the terminal relationship for the inductor
had to have a negative sign in it because the voltage and current
directions did not follow the positive sign convention.

Again, the homogeneous solution was easy to find because a DC source was
used to charge the circuit. The particular solution of the discharge
circuit was 0 because there was no forcing function.


# Circuit Theory/1Source Excitement

Phasors:

:   Called the **\"Steady State Solution\"** solution
:   Sometimes the **\"Steady State Solution\"** resulted in a complete
    solution, sometimes a partial solution.
:   Full **\"Steady State Solutions\"** involved integrals and
    derivatives
:   Partial **\"Steady State Solutions\"** involved non-homogeneous
    ODE
    differential equations
:   The partial **\"Steady State Solution\"** is called the
    **\"Particular solution\"**.
:   The **Laplace Solution** is a complete solution that is identical to
    **Phasor/Complex Frequency** when eliminating operators in a
    differential equation (s or jω), but translates the driving function
    (current or voltage source) into the **Laplace domain** differently.
    The **Laplace Solution** can translate any driving function.
    **Phasors** can only translate sinusoidals. The **Convolution
    Integral** (coming up) is easier than either.

Now we are going to finish solving the some of the incomplete,
particular **\"Steady State Solutions.\"**

:   The non-homogeneous ODE equation is turned **homogeneous** by
    setting the driving function (voltage or current source) to zero and
    then using either the \"Method of undetermined coefficients\" or
    \"Variation of parameters\" to find the overall solution. The method
    illustrated here is the **\"Method of undetermined coefficients\"**.
:   This is called the **\"Transient\"** or **Homogeneous Solution**.
:   The **Homogeneous Solution** is found in the time domain, not phasor
    domain
:   Reduce circuit to thevenin or norton equivalent and solve for a
    single component (or group or components)
:   Add **Particular** + **Homogeneous Solution**, then evaluate
    **constants**.

Click on the numeric solutions to see where they came from. Clicking on
particular solutions or non-diff-eq solutions will bounce back to
phasor examples.

+-------------+-------------+-------------+-------------+-------------+
| Calculus    | diff eq     | LR          | LR Solution | Similar RC  |
+=============+=============+=============+=============+=============+
| ${\        | $\texts     | !          | [           | ![          |
| textstyle d | tyle \surd$ |  | $V_s(t) = 1 |  |
|  \over dt}$ |             |             | 20 \sqrt{2} |             |
| ](Circuit_T |             |             |  cos(377t+1 |             |
| heory/Phaso |             |             | 20^\circ)$\ |             |
| rs/Examples |             |             | $V_s(t) =   |             |
| /Example_7  |             |             | R * i(t) +  |             |
| "wikilink") |             |             | L * {d \ove |             |
|             |             |             | r dt}i(t)$\ |             |
|             |             |             | $i_{        |             |
|             |             |             | S_P}(t) = 1 |             |
|             |             |             | 5.9 cos(377 |             |
|             |             |             | t + 1.73)$] |             |
|             |             |             | (Circuit_Th |             |
|             |             |             | eory/Phasor |             |
|             |             |             | s/Examples/ |             |
|             |             |             | Example_7 " |             |
|             |             |             | wikilink")\ |             |
|             |             |             | \           |             |
|             |             |             | $i         |             |
|             |             |             | _{S_H}(t) = |             |
|             |             |             |   2.5781*e^ |             |
|             |             |             | {-\frac{t}{ |             |
|             |             |             | 0.001}}$ |             |
+-------------+-------------+-------------+-------------+-------------+
| ${\        |             | !          | [           | ![          |
| textstyle d |             |  | $I_s(t) = 1 |  |
|  \over dt}$ |             |             | 20 \sqrt{2} |             |
| ](Circuit_T |             |             |  cos(377t+1 |             |
| heory/Phaso |             |             | 20^\circ)$\ |             |
| rs/Examples |             |             | $V_s(t) =   |             |
| /Example_8  |             |             | R * i(t) +  |             |
| "wikilink") |             |             | L * {d \ove |             |
|             |             |             | r dt}i(t)$\ |             |
|             |             |             | $V_s = 1    |             |
|             |             |             | 814cos(377t |             |
|             |             |             | +2.45)$](Ci |             |
|             |             |             | rcuit_Theor |             |
|             |             |             | y/Phasors/E |             |
|             |             |             | xamples/Exa |             |
|             |             |             | mple_8 "wik |             |
|             |             |             | ilink")\<br |             |
|             |             |             | \\\>\<br    |             |
|             |             |             | \\\>already |             |
|             |             |             | solved \... |             |
|             |             |             | no          |             |
|             |             |             | d           |             |
|             |             |             | ifferential |             |
|             |             |             | equation!   |             |
+-------------+-------------+-------------+-------------+-------------+
| ${\texts   |             | !          | [           | ![          |
| tyle \int}$ |             |  | $V_s(t) = 1 |  |
| ](Circuit_T |             |             | 20 \sqrt{2} |             |
| heory/Phaso |             |             |  cos(377t+1 |             |
| rs/Examples |             |             | 20^\circ)$\ |             |
| /Example_9  |             |             | ${          |             |
| "wikilink") |             |             | dI_s(t) \ov |             |
|             |             |             | er dt}= \fr |             |
|             |             |             | ac{1}{R}{dV |             |
|             |             |             | _s \over dt |             |
|             |             |             | } + \frac{V |             |
|             |             |             | _s}{L}$\<br |             |
|             |             |             | \\\>$i_s    |             |
|             |             |             | (t) = 48.1  |             |
|             |             |             | cos(377t +  |             |
|             |             |             | 0.844)$](Ci |             |
|             |             |             | rcuit_Theor |             |
|             |             |             | y/Phasors/E |             |
|             |             |             | xamples/Exa |             |
|             |             |             | mple_9 "wik |             |
|             |             |             | ilink")\<br |             |
|             |             |             | \\\>\<br    |             |
|             |             |             | \\\>already |             |
|             |             |             | solved \... |             |
|             |             |             | no          |             |
|             |             |             | d           |             |
|             |             |             | ifferential |             |
|             |             |             | equation!   |             |
+-------------+-------------+-------------+-------------+-------------+
| [${\textst  | $\texts     | ![          | [           | ![          |
| yle \int}$] | tyle \surd$ | ](PILR.xcf) | $I_s(t) = 1 | ](SVRC.xcf) |
| (Circuit_Th |             |             | 20 \sqrt{2} |             |
| eory/Phasor |             |             |  cos(377t+1 |             |
| s/Examples/ |             |             | 20^\circ)$\ |             |
| Example_10  |             |             | ${          |             |
| "wikilink") |             |             | dI_s(t) \ov |             |
|             |             |             | er dt}= \fr |             |
|             |             |             | ac{1}{R}{dV |             |
|             |             |             | _s \over dt |             |
|             |             |             | } + \frac{V |             |
|             |             |             | _s}{L}$\<br |             |
|             |             |             | \           |             |
|             |             |             | \\>$V_{S_P} |             |
|             |             |             | (t) = 599 \ |             |
|             |             |             | cos(377t +  |             |
|             |             |             | 3.30)$](Cir |             |
|             |             |             | cuit_Theory |             |
|             |             |             | /Phasors/Ex |             |
|             |             |             | amples/Exam |             |
|             |             |             | ple_10 "wik |             |
|             |             |             | ilink")\<br |             |
|             |             |             | \\\>\<br    |             |
|             |             |             | \\\>$V_{   |             |
|             |             |             | S_H}(t) = - |             |
|             |             |             |  258 * e^{\ |             |
|             |             |             | frac{-t}{0. |             |
|             |             |             | 0001}}$ |             |
+-------------+-------------+-------------+-------------+-------------+


# Circuit Theory/2Initially Excited

!full circuit with charging section, discharging section and two
switches
!charging circuit (sw1 closed, sw2
open)")
!discharging circuit (sw1 open, sw
closed)")

## Charging

The source voltage could be DC. In this case the initial capacitor
voltage is going to be V~s~ and the derivative of the voltage is going
to be zero.

The source voltage could be AC in which case the exact time or more
precise phase angle of the switch over is going to determine V~s~ and
the derivative of the voltage values.

## Discharging

The initial inductor current is going to be zero and derivative is going
to be zero.

After a long time nothing will be going on. The steady state particular
solution is going to be zero.

The current is going to be the same throughout. Goal should be to find
an expression for the current. However, any voltage could also be found
and then the current. Doesn\'t matter.

In summary, there will be no initial current in the discharging circuit,
there will be a voltage across the capacitor. The inductor is going to
act like an open at t=0~+~ so this entire voltage will appear across the
inductor and instantly (between t=0~-~ and t=0~+~) cause a change in the
derivative of the current through the inductor.

The equation for the current for first order circuits would be:

$$V_c(t) = A e^{-\frac{t}{\tau}}$$ However, this is a 2nd order circuit
(with both capacitors and inductors), thus:

$$V_c(t) = A e^{-st}$$ The complex frequency s has replace tau. The time
constant concept disappears. An intuitive interpretation of s exists,
but is more complicated. Remember:

$$s = \sigma + j\omega$$

## The differential equation

Go back to the complex frequency domain to find the time constant. Start
with the loop equation:

$$V_c + V_r + V_L =0$$ Substitute terminal equation for V~r~ and V~L~
but not for V~c~ because want to avoid an integral:

$$V_c + i(t)R + L{d i(t) \over dt} = 0$$ From the terminal relation of a
capacitor, know that:

$$i(t) = C {d V_c \over dt}$$ So substituting in, have a differential
equation for V~c~:

$$V_c + RC{d V_c \over dt} + LC{d^2 V_c \over dt^2} = 0$$ Can see the
second order now.

## Finding the time constant or zeros

A zero is like a time constant, but there are more than one zero\'s
possible. They might each influence the circuit differently.

Need to find V~c~. The particular solution (steady state) is going to be
zero. (Where the name zero comes from).

The homogeneous solution is going to be of this form:

$$V_c(t) = Ae^{st}$$ Plugging into the differential equation:

$$Ae^{st} + RCAse^{st} + LCAs^2e^{st} = 0$$ Dividing out Ae^st^ have:

$$1 + RCs + LCs^2 = 0$$

$$s^2 + \frac{Rs}{L} + \frac{1}{LC} = 0$$ The zero\'s of this equation
are:

$$s_{1,2} = -\frac{R}{2L} \pm \sqrt{(\frac{R}{2L})^2 - \frac{1}{LC}} = -(\sigma \pm j\omega)$$
From your experience with quadratics you know that ~1,2~ come in three
types of pairs:

  Pair Type         Revised equation for V~c~                            interpretation
  ----------------- ---------------------------------------------------- -------------------------------------------------------------------------------------
  real, not equal   $A_1e^{s_1t} + A_2e^{s_2t}$                          overdamped
  equal             $A_1e^{st} + A_2te^{st}$                             critically damped
  complex           $e^{-\sigma t}(A_1\cos\omega t + A_2\sin\omega t$)   underdamped

The revised equations (guesses) come from math proofs, and some courses
derive these from Laplace transformations. Just remember this table.

There are two storage elements with two initial conditions each, so
there could be four equations and four constants. A~1~ and A~2~ are two
of them. !for undamped (blue), under-damped (green), critically damped
(red), and over-damped (cyan)
cases, under-damped (green), critically damped (red), and over-damped (cyan) cases")
To understand damping, think of a car driving
over a curb. Undamped means the car bounces up and down for ever.
Under-damped is what happens when the shocks start leaking (car bounces
up and down for a while \... like riding in a boat). Critically damped
is why people hate sports cars (hurts their bottom). An over damped
response in a car gives feedback to a person driving a car. Circuits
like that above have been used to model shock obsorbers. These circuits
are called analog computers.

## Almost Resonance (Underdamped)

!Impact of R and L on
resonance

The most interesting of the above three is Underdamped. Something like
resonance occurs.

Satellites expand and contract depending upon which side is facing the
sun or the 2.7 kelvin of space. Repeated expansion and contraction
creates an oscillation that needs to be damped out by a motor that
flings a weight around that dampens the vibration. Otherwise everything
that can wiggle will wiggle more and more until parts begin to break
off. (A car on earth is no different).

Most control circuit input is an unbalanced situation. The output models
the desired behavior. The correcting (feedback control) circuits (not
talked being studied here) kick in to make sure the actual behavior
matches the desired behavior. Most often the objective is to design a
critically damped circuit, rather than merely predict what is going to
happen.

Resonance (or close to it) occurs when s~1~ and s~2~ are purely
imaginary.

$$s_{1,2} = -\frac{R}{2L} \pm \sqrt{(\frac{R}{2L})^2 - \frac{1}{LC}} = -(\sigma \pm j\omega)$$

So:

$$\sigma = \frac{R}{2L}$$ What is interesting is the radical term. It
determines the nature of the 2nd order response.

Pure resonance occurs when the real part of the quadratic solution is
zero which would only happen when R \<\< L.

!Crystals are modeled with a capacitor in parallel with a series RLC
network
The contents of the radical don\'t have to be zero, only the real part
has to be zero in order to be overdamped:

$$j\omega = \sqrt{(\frac{R}{2L})^2 - \frac{1}{LC}}$$

$$j\omega = j\sqrt{\frac{1}{LC} - (\frac{R}{2L})^2}$$ The j\'s cancel,
and we have already assumed R \<\< L, so:

$$\omega = \sqrt{\frac{1}{LC} - (\frac{R}{2L})^2}$$ Which called the
damped, ringing, or undamped frequency.

When R \<\< L, then this turns into the resonate frequency:

$$\omega = \sqrt{\frac{1}{LC}}$$

Mechanical engineers try to predict ω for a given structure and
materials. It could be a building or motor mount. The math proves that ω
exists. Finding the exact ω usually requires testing. Instead of
capacitors and inductors, mechanical engineers model everything with
springs and dampers. Finding ω can be hard. This why there is an entire
industry of shake tables.

The spring and damper values in a structure determine how narrow or
muted the resonance is. When designing a building, mechanical engineers
want the envelope to be as wide and flat (muted) as possible. When
designing a notch filter the electrical engineer\'s design goal is the
opposite: a tall and narrow envelope. Electrical engineers call this
quality.

Most oscillators today are built from
crystals.


# Circuit Theory/2Source Excitement

Examples worked out:

-   LRC circuit #1
-   parallel RLC network with extra resistor in L
    leg

Working on this example: !Circuit analyzed earlier with
Kirchhoff\'s
laws
This circuit was earlier analyzed using
Kirchhoff. The
goal is to repeat the analysis using Node and Mesh \... then find
Thevenin\'s voltage, Norton\'s current and the equivalent impedance of
the circuit from R~3~\'s point of view.

The Kirchhoff goal is to find everything:

:   *Given that the voltage source is defined by
    $V_s(t) = 10cos(1000t + 30^{\circ})$ and the current source is
    defined by $I_s(t) = 0.5 sin(1000t + 45^{\circ})$, find all other
    voltages, currents and power of the sources.*

The /Node and Mesh/ analysis goal does not
find everything. Node voltages and mesh currents are the first things
found. Then everything else can be found.

/Thevenin and Norton/ look at the
rest of the circuit from just one component (or group of components)
point of view. So even fewer voltages and currents are found.


# Circuit Theory/Convolution Integral

!Examples of arbitrary sources that could drive a
circuit

## Impulse Response

So far circuits have been driven by a DC source, an AC source and an
exponential source. If we can find the current of a circuit generated by
a Dirac delta function or impulse
voltage source δ, then the convolution integral can be used to find the
current to any given voltage source!

## Example Impulse Response

The current is found by taking the derivative of the current found due
to a DC voltage source! Say the goal is to find the δ current of a
series LR circuit .. so that in the future the convolution integral can
be used to find the current given any arbitrary source. !Series LR
circuit with impulse δ function as voltage
source

Choose a DC source of 1 volt (the real Vs then can scale off this).
!Series LR circuit with unit μ step function voltage source

The particular homogeneous solution (steady state) is 0. The homogeneous
solution to the non-homogeneous equation has the form:

$$i(t) = Ae^{-\frac{t}{\frac{L}{R}}} + C$$ Assume the current initially
in the inductor is zero. The initial voltage is going to be 1 and is
going to be across the inductor (since no current is flowing):

$$v(t) = L{d i(t) \over dt}$$

$$v(0) = 1 = L * (-\frac{A R}{L})$$

$$A = -1/R$$ If the current in the inductor is initially zero, then:

$$i(0) = 0 = A + C$$ Which implies that:

$$C = -A = 1/R$$ So the response to a DC voltage source turning on at
t=0 to one volt (called the unit response μ) is:

$$i_\mu (t) = \frac{1}{R}(1 - e^{-\frac{t}{\frac{L}{R}}})$$ Taking the
derivative of this, get the impulse (δ) current is:

$$i_\delta (t) = \frac{e^{-\frac{t}{\frac{L}{R}}}}{L}$$ Now the current
due to any arbitrary V~S~(t) can be found using the convolution
integral:

$$i(t) = \int_0^t i_\delta (t-\tau) V_s(\tau) d\tau = \int_0^t f(t-\tau)g(\tau)d\tau + C_1$$
Don\'t think i~δ~ as current. It is really
${d \over dt}\frac{current}{1 volt}$. V~S~(τ) turns into a multiplier.

## LRC Example

!RLC problem for circuit theory
wikibook Find
the time domain expression for i~o~ given that I~s~ = cos(t + π/2)μ(t)
amp.

Earlier the
step response for this problem was found:

$$i_{o_\mu} = \frac{1}{2}(1 - e^{-t}(\cos t + \sin t))$$ The impulse
response is going to be the derivative of this:

$$i_{o_\delta} = {d i_{o_\mu} \over dt} = 0 + \frac{1}{2}e^{-t}(\cos t + \sin t) - \frac{1}{2}e^{-t}(-\sin t + \cos t)$$

$$i_{o_\delta} = \frac{1}{2}e^{-t}(\cos t + \sin t + \sin t - \cos t) = e^{-t}\sin t$$

$$I_s = 1 + \cos t$$

$$i_o(t) = \int_0^t i_{o_\delta} (t-\tau) I_s(\tau) d\tau + C_1$$

$$i_o(t) = \int_0^t e^{-(t-\tau)}\sin (t-\tau) (1 + \cos \tau) d\tau + C_1$$

$$i_o(t) = \frac{\cos t}{5} + \frac{2 \sin t}{5} - \frac{7 e^{-t}\cos t}{10} - \frac{11 e^{-t}\sin t}{10} + \frac{1}{2} + C_1$$
The Mupad code to solve the integral (substituting x for τ) is:

    f := exp(-(t-x)) *sin(t-x) *(1 + cos(x));
    S := int(f,x = 0..t)

## Finding the integration constant

$$i_o(0_+) = 0 = \frac{1}{5}  - \frac{7}{10} + \frac{1}{2} + C_1$$ This
implies:

$$C_1 = 0$$

## TO DO

$$i(t) = \int_0^t i_\delta (t-\tau) V_s(\tau) d\tau = \int_0^t f(t-\tau)g(\tau)d\tau$$
!Convolution of spiky function with
box2.gif

This was created with /matlab/, turned into a gif
with ImageMagick, cropped
with a photo editor and then released into the public
domain.

Several
others have
created an alternative animation.

-   The blue symbol $f(t)$ represents $i_\delta(t)$.
-   The red symbol $g(t)$ represents the arbitrary $V_s(t)$.
-   The current due to the V~S~ black (on top of the yellow).
-   The turn on event occurs at t = 5 seconds, not 0.
-   The voltage of the source is not on indefinitely. It turns on at
    zero and off at 5 time constants.


# Circuit Theory/TF Objectives

Thevenin/Norton impedance completely characterizes a circuit from a
load\'s point of view. Differential equations completely describe a
circuit. The impulse response of a circuit is all that is needed to use
the convolution integral. Phasors and complex frequencies completely
describe a circuit. And even while computing the transient response,
complex frequencies associated with the steady state sinusoidal response
appeared. Are they all related? Yes.

The goal is to understand all the above as a transfer function. Why?
Most engineering uses this concept. Here are some electrical
applications:

-   Analog Computers \... (modeling
    before digital computers)
-   Signal Processing "wikilink") \...
    (wireless, cable communication)
-   Control theory \... (motors don\'t
    die and don\'t spin out of control when the load changes)
-   Linear time-invariant system
    theory \... (general math model
    which assumes the values of resistors, inductors and capacitors
    don\'t vary over time, temperature, bias .. but provides a good
    starting point for establishing expectations and experimenting)

The goal is to introduce transfer functions in the context of
electronics.

## Transfer Function Definition

A **Transfer Function** is the ratio of the output of a system to the
input of a system. If we have an input function of *X(s)*, and an output
function *Y(s)*, we define the transfer function *H(s)* to be:

$$H(s) = {Y(s) \over X(s)}$$

## Four RLC Transfer Functions

In the context of RLC circuits, transfer functions are in a
phasor/complex frequency/laplace domain concept. They are not a time
domain concept. They are independent of the forcing function/source.
There are four possible RLC transfer patterns:

  $\frac{output}{input}$           Example Circuit                                                    Transfer Function
  -------------------------------- ------------------------------------------------------------------ --------------------------------------
  $\frac{V_{out}(s)}{I_{in}(s)}$   !impedance                                $H(s) = R + Ls$
  $\frac{I_{out}(s)}{V_{in}(s)}$   !admittance   $H(s) = \frac{1}{R} + Cs$
  $\frac{V_{out}(s)}{V_{in}(s)}$   !voltage divider                    $H(s) = \frac{Ls}{R + Ls}$
  $\frac{I_{out}(s)}{I_{in}(s)}$   !current divider                    $H(s) = \frac{Cs}{\frac{1}{R} + Cs}$

## Applications

The transfer function has many applications as we will soon see. But
it\'s immediate benefit is eliminating the need to find the differential
equation. Reviewing previous examples:

+----------------------+----------------------+----------------------+
| Example              | Differential         | Transfer Function    |
|                      | Equation             |                      |
+======================+======================+======================+
| convolution         | $$v(t) = L{d i(t)    | admittance$$ | ittance "wikilink"): |
| p                    |                      |                      |
| roblem = \frac{\mathbb{I} |
| ral#Example_Impulse_ |                      | (s)}{\mathbb{V}(s)}  |
| Response "wikilink") |                      | = \frac{1}{sL + R}$$ |
|                      |                      |                      |
| <File:Exa            |                      |                      |
| mple40a.png%7CGiven> |                      |                      |
| voltage source, find |                      |                      |
| total current        |                      |                      |
+----------------------+----------------------+----------------------+
| Second Order,       | $I_s = {d^2 i_o \    | current divider:     |
| Source               | over dt^2} + 2 {d i_ |                      |
| Excitem              | o \over dt} + 2 i_o$ | $$H(s) = \fra        |
| ent}{\ |
| 2Source_Excitement/E |                      | mathbb{I}_s(s)} = \f |
| xample46 "wikilink") |                      | rac{\frac{1}{R + Ls} |
|                      |                      | }{\frac{1}{R + Ls} + |
| <File:E              |                      |  \frac{1}{R} + Cs}$$ |
| xample46.png%7CFind> |                      |                      |
| i~o~ giving Is       |                      | $$H(s) = \frac{      |
|                      |                      | \mathbb{I}_o(s)}{\ma |
|                      |                      | thbb{I}_s(s)} = \fra |
|                      |                      | c{1}{s^2 + 2s + 2}$$ |
|                      |                      |                      |
|                      |                      |                      |
|                      |                      | R :=1; L :=1; C :=1; |
|                      |                      |     simplify(        |
|                      |                      | (1/(R + L*s))/(1/(R  |
|                      |                      | + L*s) + 1/R + C*s)) |
+----------------------+----------------------+----------------------+
| Second Order,       | $V_                  | Voltage Divider      |
| Source               | s(t) = L{d (\frac{V_ | $H(s) = \frac{\math  |
| Excitement \over dt}  | bb{V}_{cr}(s)}{\math |
| Theory/2Source_Excit | + LC {d^2 (V_{CR} \o | bb{V}_s(s)} = \frac{ |
| ement/Example45#Homo | ver dt^2}) + V_{CR}$ | \frac{1}{\frac{1}{R} |
| geneous.2FTransient_ |                      |  + Cs}}{\frac{1}{\fr |
| Solution "wikilink") |                      | ac{1}{R} + Cs}+Ls}$\ |
|                      |                      | $H(                  |
| <File:Exa            |                      | s) = \frac{1}{CLs^2  |
| mple45B.png%7CGiven> |                      | + \frac{Ls}{R} + 1}$ |
| V_s, find V_cr       |                      |                      |
+----------------------+----------------------+----------------------+

## Interpreting Complex Roots

After finding the transfer function, the next step is finding the time
constant or the complex frequency roots and from these guess the form of
the solution.

The homogeneous solution is found by setting the denominator of the
transfer function to zero. Factoring the denominator and finding the
complex frequency roots is called finding \"zeros.\"

The numerator (which was one in all the above examples) may have a
complex frequency polynomial (in complicated circuits) that can also be
set equal to zero. The roots are called \"poles.\" Poles influence the
circuit\'s response to different frequencies rather than the time domain
response.

## Summarizing Time

This ends the normal circuit theory course. Time domain analysis could
continue and this is hinted at in the following example. Before WWII it
was important to continue in order to model physical systems with analog
computers. But today, digital computers can model much more accurately.
So stopping time analysis here leaves further study for a specialized
class. Let\'s summarize what we have learned about circuits in the time
domain.

-   Superposition allows replacing multiple sources with one source at a
    time (zeroing the others) and then adding the results of all
    sources.
-   Impedance, admittance, voltage divider and current divider formulas
    lead directly to the differential equations \... which is the same
    math for phasor/complex frequency and the Laplace domain.
-   The Convolution integral eliminates the need to transform driving
    functions (particularly sinusoidal) into the phasor/complex
    frequency/Laplace domain. Instead the source is replaced with 1 volt
    or 1 amp, and the particular solution turns into a DC final
    condition (t = ∞) placed on the homogeneous solution and appears
    with in the differential equation constant.


# Circuit Theory/State Variables

New techniques are needed to solve 2nd order and higher circuits:

-   Symbolic solutions are so complicated, merely comparing answers is
    an exercise
-   Analytical solution techniques are more fragmented
-   The relationship between constants, initial conditions and circuit
    layout are becoming complicated

A change in strategy is needed if circuit analysis is going to:

-   Move beyond the ideal
-   Consider more complicated circuits
-   Understand limitations/approximations of circuit modeling software

The solution is \"State Variables.\" After a state variable analysis,
the exercise of creating symbolic solution can be simplified by
eliminating terms that don\'t have a significant impact on the output.

### State Space

The State Space approach to
circuit theory abandons the symbolic/analytical approach to circuit
analysis. The state variable model involves describing a circuit in
matrix form and then solving it numerically using tools like series
expansions, Simpson\'s
rule, and Cramer\'s
Rule. This was the original starting point
of matlab.

### State

\"State\" means \"condition\" or \"status\" of the energy storage
elements of a circuit. Since resistors don\'t change (ideally) and
don\'t store energy, they don\'t change the circuit\'s state. A state is
a snap shot in time of the currents and voltages. The goal of \"State
Space\" analysis is to create a notation that describes all possible
states.

### State Variables

The notation used to describe all states should be as simple as
possible. Instead of trying to find a complex, high order differential
equation, go back to something like Kirchhoff
analysis
and just write terminal equations.

State variables are voltages across capacitors and currents through
inductors. This means that purely resistive circuit cut
sets are
collapsed into single resistors that end up in series with an inductor
or parallel to capacitor. Rather than using the symbols v and i to
represent these unknowns, they are both called x. Kirchhoff\'s equations
are used instead of node or loop equations. Terminal equations are
substituted into the Kirchhoff\'s equations so that remaining
resistor\'s currents and voltages are shared with inductors and
capacitors.

### State Space Model

![](Typical_State_Space_Model_(CT).svg "Typical_State_Space_Model_(CT).svg")

This State Space Model describes the inputs (step function μ(t), initial
conditions X(0)), the output Y(t) and A,B,C and D. A-B-C-D are transfer
functions that combine as follows:

$$\frac{\mathbb{Y}}{\mathbb{\mu}} = B(s)\left(\frac{1}{s - A(s)}\right)C(s) + D(s)$$

A control
systems
class teaches how to build these block diagrams from a desired transfer
function. Integrals \"remember\" or accumulate a history of past states.
Derivatives predict future state and both, in addition to the current
state can be separately scaled. \"A\" represents feedback. \"D\"
represents feed forward. There is lots to learn.

Don\'t try to figure out how a negative sign appeared in the denominator
and where the addition term came from. How does the above help us
predict voltages and currents in a circuit? Let\'s start by defining
terms and do some examples:

-   A is a square matrix representing the circuit components (from
    Kirchhoff\'s equations.
-   B is a column matrix or vector representing how the source impacts
    the circuit (from Kirchhoff\'s equations).
-   C is a row matrix or vector representing how the output is computed
    (could be voltage or current)
-   D is a single number that indicates a multiplier of the source .. is
    usually zero unless the source is directly connected to the output
    through a resistor.

A and B describe the circuit in general. If X is a column matrix
(vector) representing all unknown voltages and currents, then:

$$\boldsymbol{\dot{X}} = \boldsymbol{A}\boldsymbol{X} + \boldsymbol{B}\boldsymbol{\mu}$$
At this point, X is known and represents a column of functions of time.
The output can be derived from the known X\'s and the original step
function μ using C and D:

$$y = \boldsymbol{C}\boldsymbol{X} + D*\boldsymbol{\mu}$$

### MatLab Implementation

!screen shot of matlab with simulink toolbox showing how to get to the
state-space block for wikibook circuit
analysis
This would not be a step forward without tools such as MatLab. These are
the relevant MatLab control system toolbox commands:

-   step(A,B,C,D) assumes the initial conditions are zero
-   initial(A,B,C,D,X(0)) just like step but takes into account the
    initial conditions X(0)

In addition, there is a simulink block called \"State Space\" that can
be used the same way.

### Video Introduction

-   41 minute introduction from digilent
    corp
-   5 minute application to a
    circuit

## Further reading

-   Control Systems/State-Space
    Equations
-   matlab help links


# Circuit Theory/Fourier Transform

right\|framed\|Joseph Fourier,
after whom the Fourier Transform is named, was a famous mathematician
who worked for Napoleon.

This course started with phasors. We learned how to transform forcing
sinusodial
functions such as voltage supplies into phasors. To handle more complex
forcing functions we switched to complex frequencies. This enabled us to
handle forcing functions of the form:

$$e^{st}\cos(\omega t + \phi)$$ where s is:

$$s=\sigma + j\omega$$ And the convolution integral can do anything.

Along the way \"s\" began to transform the calculus operators back into
algebra. Within the complex domain, \"s\" could be re-attached to the
inductors and capacitors rather than forcing functions. The transfer
function helped us use \"s\" to capture circuit physical
characteristics.

This is all good for designing a circuit to operate at a single
frequency ω. But what about circuits that operate at a variety of
frequencies? A RC car may operate at 27mhz, but when a control is
pressed, the frequency might increase or decrease. Or the amplitude may
increase or decrease. Or the phase may shift. All of these things happen
in a cell phone call or wifi/blue tooth/xbee/AM/FM/over the air tv, etc.

How does a single circuit respond to these changes?

## Fourier analysis

Fourier analysis says we don\'t have to answer all the above questions.
Just one question has to be answered/designed to. Since any function can
be turned into a series of sinusoidals added together, then sweeping the
circuit through a variety of omegas can predict its response to any
particular combination of them.

So to start this we get rid of the exponential term and go back to
phasors.

Set σ to 0:

$$s = j\omega$$

The variable ω is known as the \"radial frequency\" or just frequency.
With this we can design circuits for cell phones that all share the air,
for set-top cable TV boxes that pack multiple channels into one black
cable. Every vocal or pixel change during transmission or reception can
be designed for within this framework. All that is required is to sweep
through all the frequencies that a sinusoidal voltage or current source
can produce.

Analysis stays in the frequency domain. Because everything repeats over
and over again in time, there is no point in going back to the time from
a design point of view.

## Radial Frequency

In the Fourier transform, the value $\omega$ is known as the **Radial
Frequency**, and has units of radians/second (rad/s). People might be
more familiar with the variable f, which is called the \"Frequency\",
and is measured in units called Hertz (Hz). The conversion is done as
such:

$$\omega = 2\pi f$$ For instance, if a given AC source has a frequency
of 60 Hz, the resultant radial frequency is:

$$\omega = 2\pi f = 2\pi(60) = 120\pi$$

## Fourier Domain

The Fourier domain then is broken up into two distinct parts: the
**magnitude graph**, and the **phase graph**. The magnitude graph has jω
as the horizontal axis, and the magnitude of the transform as the
vertical axis. Remember, we can compute the magnitude of a complex value
C as:

$$C = A + jB$$

$$|C| = \sqrt{A^2 + B^2}$$

The Phase graph has jω as the horizontal axis, and the phase value of
the transform as the vertical axis. Remember, we can compute the phase
of a complex value as such:

$$C = A + jB$$

$$\angle C = \tan^{-1}\left(\frac{B}{A}\right)$$

The phase and magnitude values of the Fourier transform can be
considered independent values, although some abstract relationships do
apply. Every fourier transform must include a phase value and a
magnitude value, or it cannot be uniquely transformed back into the time
domain.

The combination of graphs of the magnitude and phase responses of a
circuit, along with some special types of formatting and interpretation
are called Bode Plots.


# Circuit Theory/Bode Plots

## Bode Plots

Bode plots plot the transfer function. Since the transfer function is a
complex number, both the magnitude and phase are plotted (in polar
coordinates). The independent variable ω is swept through a range of
values that center on the major defining feature such as time constant
or resonant frequency. A magnitude plot has dB of the transfer function
magnitude on the vertical axis. The phase plot typically has degrees on
the vertical axis.

!voltage across capacitor and resistor parallel combination is the
output
!Bode plot for V~CR~ compared to V~S~ which looks like a passive, low
pass filter with slope of -40dB/decade, the cut off frequency looks to
be 10^0^ = 1 radian/sec. The resistor dominates at DC and the capacitor
dominates at very high frequencies.

!find current through
R~3~

## MatLab tr and bode

### Example 1

Previously the
transfer function was found to be:

$$H(s) = \frac{\mathbb{V}_{cr}(s)}{\mathbb{V}_s(s)} = \frac{1}{CLs^2 + \frac{Ls}{R} + 1} = \frac{1}{s^2 + 2s + 1}$$
MatLab has a short hand notation method for entering this information
where the coefficients are listed (high power to low power)(numerator
first, then denominator). For this example

    f = tf([1],[1 2 1])

Leaving the colon off the end should display the transfer function. The
next step is to plot it:

    grid on
    bode(f)

The result is a low pass filter. Rather than understand how to create
these plots (not trivial), the goal is to interpret the plot .. (which
is almost the same thing). But at this point, the goal is to exercise
MatLab. !Bode diagram of R3 current versus V~s~, looks like a notch
filter at around 1K
radians/sec

### Example 2

Previously the transfer
function was found to be:

$$\frac{\mathbb{I}_o}{\mathbb{V}_s} = \frac{1000s^3 + 5*10^9s}{s^4 + 5*10^6*s^3 + 2.000015*10^{12}*s^2 + 3.5*10^{13}*s + 5*10^{13}}$$

    f = tf([1000 0 5*10^9 0],[1 5*10^6 2.000015*10^12 3.5*10^13 5*10^13])
    grid on
    bode(f)

### Magnitude Graph

Bode magnitude plots are dB which is both a measure of power and voltage
and current simultaneously. The vertical dB axis is not an approximation
or relative to anything. The vertical axis is an accurate number. The
horizontal, dependent axis could be radians/sec or Hz.

### Phase Graph

The Bode Phase Plot is a graph where the radial frequency is plotted
along the X axis, and phase shift of the circuit *at that frequency* is
plotted on the Y-axis. Axis could be in radians or degrees, frequency
could be in radians per second or Hz.

## Poles and Zeros

A transfer function has 7 features that can be realized in circuits.
Before looking at these features, the terms pole, zero and origin need
to be defined. Start with this definition of a transfer function:

$$H(j\omega) = \frac{Z(j\omega)}{P(j\omega)}$$

-   Zeros are roots in the numerator.
-   Poles are roots in the denominator.
-   The origin is where s = jω = 0 (no real part in a Bode analysis).
    When the frequency is zero, the input is DC. This is where after a
    long time caps open and inductors short.

The 7 possible features in a transfer function are:

-   A constant
-   Zeros at the origin (s in the numerator)
-   Poles at the origin (s in the denominator)
-   Real Zero (an s+a factor in the numerator)
-   Real Pole (an S+a factor in the denominator)
-   Complex conjugate poles
-   Complex conjugate zeros

The bode and bodeplot functions are available in the MatLab Control
system toolbox.
BodePlotGui does the
same thing and is discussed here. BodePlotGui was developed at
Swarthmore through an NSF grant. There is a summary of the Swathmore
Bode Diagram tutorial.

Circuit simulation software can plot bode diagrams
also.

## Bode Equation Format

let us say that we have a generic transfer function with poles and
zeros:

$$H(j\omega) = \frac{(\omega_A + j\omega)(\omega_B + j\omega)}{(\omega_C+ j\omega)(\omega_D + j\omega)}$$

Each term, on top and bottom of the equation, is of the form
$(\omega_N + j\omega)$. However, we can rearrange our numbers to look
like the following:

$$\omega_N(1 + \frac{j\omega}{\omega_N})$$

Now, if we do this for every term in the equation, we get the following:

$$H_{bode}(j\omega) = \frac{\omega_A \omega_B}{\omega_C \omega_D}
      \frac{(1 + \frac{j\omega}{\omega_A})(1 + \frac{j\omega}{\omega_B})}
           {(1 + \frac{j\omega}{\omega_C})(1 + \frac{j\omega}{\omega_D})}$$

This is the format that we are calling \"Bode Equations\", although they
are simply another way of writing an ordinary frequency response
equation.

## DC Gain

The constant term out front:

$$\frac{\omega_A \omega_B}{\omega_C \omega_D}$$

is called the \"DC Gain\" of the function. If we set $\omega \to 0$, we
can see that everything in the equation cancels out, and the value of H
is simply our DC gain. DC then is simply the output when the input\'s
frequency is zero.

## Break Frequencies

in each term:

$$(1 + \frac{j\omega}{\omega_N})$$

the quantity $\omega_N$ is called the \"Break Frequency\". When the
radial frequency of the circuit equals a break frequency, that term
becomes (1 + 1) = 2. When the radial frequency is much higher than the
break frequency, the term becomes much greater than 1. When the radial
Frequency is much smaller than the break frequency, the value of that
term becomes approximately 1.

### Approximations

Bode diagrams are constructed by drawing straight lines (on log paper)
that approximations of what are really curves. Here is a more precise
definition.

The term \"much\" is a synonym for \"At least 10 times\". \"Much
Greater\" becomes \"At least 10 times greater\" and \"Much less\"
becomes \"At least 10 times less\". We also use the symbol \"\<\<\" to
mean \"is much less than\" and \"\>\>\" to mean \"Is much greater
than\". Here are some examples:

-   1 \<\< 10
-   10 \<\< 1000
-   2 \<\< 20 Right!
-   2 \<\< 10 WRONG!

For a number of reasons, Electrical Engineers find it appropriate to
approximate and round some values very heavily. For instance,
manufacturing technology will never create electrical circuits that
perfectly conform to mathematical calculations. When we combine this
with the \<\< and \>\> operators, we can come to some important
conclusions that help us to simplify our work:

If A \<\< B:

-   A + B = B
-   A - B = -B
-   A / B = 0

All other mathematical operations need to be performed, but these 3
forms can be approximated away. This point will come important for later
work on bode plots.

Using our knowledge of the Bode Equation form, the DC gain value,
Decibels, and the \"much greater, much less\" inequalities, we can come
up with a fast way to approximate a bode magnitude plot. Also, it is
important to remember that these gain values are not constants, but rely
instead on changing frequency values. Therefore, the gains that we find
are all *slopes* of the bode plot. Our slope values all have units of
\"decibel per decade\", or \"db/decade\", for short.

## At Zero Radial Frequency

At zero radial frequency, the value of the bode plot is simply the DC
gain value *in decibels*. Remember, bode plots have a log-10 magnitude
Y-axis, so we need to convert our gain to decibels:

$$Magnitude = 20\log_{10}(DC Gain)$$

## At a Break Point

We can notice that each given term changes its effect as the radial
frequency goes from below the break point, to above the break point.
Let\'s show an example:

$$(1 + \frac{j\omega}{5})$$

Our breakpoint occurs at 5 radians per second. When our radial frequency
is *much less* than the break point, we have the following:

$$Gain = (1 + 0) = 1$$

$$Magnitude = 20\log_{10}(1) = 0db/decade$$

When our radial frequency is equal to our break point we have the
following:

$$Gain = |(1 + j)| = \sqrt{2}$$

$$Magnitude = 20\log_{10}(\sqrt{2}) = 3db/decade$$

And when our radial frequency is much higher (10 times) our break point
we get:

$$Gain = |(1 + 10 j)| \approx 10$$

$$Magnitude = 20\log_{10}(10) = 20db/decade$$

However, we need to remember that some of our terms are \"Poles\" and
some of them are \"Zeros\".

### Zeros

Zeros have a positive effect on the magnitude plot. The contributions of
a zero are all positive:

Radial Frequency \<\< Break Point : 0db/decade gain.\
Radial Frequency = Break Point : 3db/decade gain.\
Radial Frequency \>\> Break Point : 20db/decade gain.

### Poles

Poles have a negative effect on the magnitude plot. The contributions of
the poles are as follows:

Radial Frequency \<\< Break Point : 0db/decade gain.\
Radial Frequency = Break Point : -3db/decade gain.\
Radial Frequency \>\> Break Point : -20db/decade gain.

## Conclusions

To draw a bode plot effectively, follow these simple steps:

1.  Put the frequency response equation into bode equation form.
2.  identify the DC gain value, and mark this as a horizontal line
    coming in from the far left (where the radial frequency conceptually
    is zero).
3.  At every \"zero\" break point, increase the slope of the line
    upwards by 20db/decade.
4.  At every \"pole\" break point, decrease the slope of the line
    downwards by 20db/decade.
5.  at every breakpoint, note that the \"actual value\" is 3db off from
    the value graphed.

And then you are done!