# Circuit Theory/Phasors/Examples/Example 7

Given that the voltage source is defined by $V_{s}(t)=120{\sqrt {2}}cos(377t+120^{\circ })$, find all other voltages, currents and check power.

### Label Loops Junctions

The important point is that nothing changes even though the source is oscillating. + and - still have to capture the circuit topology and work their way into the equations.
What is interesting to note about this problem, is that it is talking about a wall outlet.
The angular frequency 377 $\omega$ is 60 Hz $f$:
       $f={\frac {\omega }{2\pi }}={\frac {377}{2\pi }}=60$
The $V_{RMS}={\frac {V_{peak}}{\sqrt {2}}}$ so $V_{peak}=V_{RMS}*{\sqrt {2}}$, so the magnitude of the problem matches a normal 120 volt rms wall outlet in Northern America.

## Knowns, Unknowns and Equations

    Knowns: $V_{s},R,L$
    Unknowns: $i,v_{R},v_{L}$
    Equations: $v_{R}(t)=R*i(t),v_{L}=L*{d \over dt}i(t),v_{R}(t)+v_{L}(t)-V_{s}(t)=0$

## Phasor Symbolic
### time domain

substitute the terminal equations into the loop equation to get this:
    $R*i(t)+L*{d \over dt}i(t)-V_{s}(t)=0$
Assume ${V_{s}}$ can be put in the form $\operatorname {Re} (V_{m}e^{j(\omega t+\phi )})$

### phasor domain

now transform into the phasor domain ..
    ${V_{s}}(t)\rightarrow {\mathbb {V} _{s}}=V_{m}\angle \phi$
    $i(t)\rightarrow \mathbb {I}$
    ${d \over dt}i(t)\rightarrow j\omega \mathbb {I}$
So:
    $R*\mathbb {I} +L*j\omega \mathbb {I} -{\mathbb {V} _{s}}=0$
Solving for $\mathbb {I}$
    $\mathbb {I} ={\frac {\mathbb {V} _{s}}{R+L*j\omega }}$
If:
    $R+L*j\omega ={\sqrt {R^{2}+(L\omega )^{2}}}\angle arctan({\frac {L\omega }{R}})$
Then:
    $\mathbb {I} ={\frac {\mathbb {V} _{s}}{R+L*j\omega }}={\frac {V_{m}\angle \phi }{{\sqrt {R^{2}+(L\omega )^{2}}}\angle arctan({\frac {L\omega }{R}})}}={\frac {V_{m}}{\sqrt {R^{2}+(L\omega )^{2}}}}\angle (\phi -\angle arctan({\frac {L\omega }{R}}))$
To make the above definition easier to read, going to introduce two new symbols for the magnitude and phase of the current phasor:
    $\mathbb {I} =I_{m}e^{j\alpha }$
Then:
    $I_{m}={\frac {V_{m}}{\sqrt {R^{2}+(L\omega )^{2}}}}$
and:
    $\alpha =\phi -\angle arctan({\frac {L\omega }{R}})$

### back to time domain

    $i(t)=\operatorname {Re} (\mathbb {I} e^{j\omega t})=\operatorname {Re} (I_{m}e^{j\alpha }e^{j\omega t})=\operatorname {Re} (I_{m}e^{j(\omega t+\alpha )})=I_{m}cos(\omega t+\alpha )$
    $v_{R}(t)=R*i(t)$
    $v_{L}(t)=L*{d \over dt}i(t)$

## Phasor Numeric
### time domain

substitute the terminal equations into the loop equation to get this:
    $R*i(t)+L*{d \over dt}i(t)-V_{s}(t)=0$
    $R=10$
    $L=.01$
    $\omega =377$
    $V_{s}=\operatorname {Re} (120{\sqrt {2}}e^{j(377t+120^{\circ })})$

### phasor domain

now transform into the phasor domain ..
    ${V_{s}}(t)\rightarrow {\mathbb {V} _{s}}=120{\sqrt {2}}\angle 120^{\circ }$
    $V_{m}=120{\sqrt {2}}$
    $\phi =\angle 120^{\circ }$
    $\mathbb {I} ={\frac {\mathbb {V} _{s}}{R+L*j\omega }}={\frac {V_{m}}{\sqrt {R^{2}+(L\omega )^{2}}}}\angle (\phi -\angle arctan({\frac {L\omega }{R}}))=I_{m}e^{j\alpha }$
Then:
    $I_{m}={\frac {V_{m}}{\sqrt {R^{2}+(L\omega )^{2}}}}$
and:
    $\alpha =\phi -\angle arctan({\frac {L\omega }{R}})$

### back to the time domain

    $\mathbb {I} =I_{m}e^{j\alpha }$
so:
    $i(t)=\operatorname {Re} (15.9e^{j(377t+1.73)})=15.9cos(377t+1.73)$
    $v_{R}(t)=R*i(t)=159cos(377t+1.73)$
    $v_{L}(t)=L*{d \over dt}i(t)=-59.9sin(377t+1.73)$

### check

at $t=0$ do the voltages add to zero?
    $159cos(1.73)-59.9sin(1.73)-120*{\sqrt {2}}cos(1.73)$
Yes! .. maybe with computer rounding errors because all numeric solutions are approximate

## Laplace Symbolic
### time domain

    $R*i(t)+L*{d \over dt}i(t)-V_{s}(t)=0$
rewriting
    $R*i(t)+L*{d \over dt}i(t)=V_{s}(t)$

### laplace domain

now transform both into the laplace domain ..
    ${V_{s}}(t)\rightarrow {\mathcal {L}}\left\{{V_{s}}(t)\right\}$
    $i(t)\rightarrow {\mathcal {L}}\left\{i(t)\right\}$
    ${d \over dt}i(t)\rightarrow s{\mathcal {L}}\left\{i(t)\right\}-i(0)\$
So:
    $R*{\mathcal {L}}\left\{i(t)\right\}+L*(s{\mathcal {L}}\left\{i(t)\right\}-i(0))={\mathcal {L}}\left\{{V_{s}}(t)\right\}$
Solving for ${\mathcal {L}}\left\{i(t)\right\}$
    ${\mathcal {L}}\left\{i(t)\right\}=$${\frac {{{\mathcal {L}}\left\{{V_{s}}(t)\right\}}+L*i(0)}{R+L*s}}$
At this point the Laplace symbolic solution has to stop. The next steps depend upon the form of ${{\mathcal {L}}\left\{{V_{s}}(t)\right\}}$.

### back to time domain

This can not be done without ${{\mathcal {L}}\left\{{V_{s}}(t)\right\}}$. The form of the function ${{\mathcal {L}}\left\{{V_{s}}(t)\right\}}$ determines the inverse mapping.

## Laplace Numeric
### time domain

substitute the terminal equations into the loop equation to get this:
    $R*i(t)+L*{d \over dt}i(t)-V_{s}(t)=0$
    $R=10$
    $L=.01$
    $\omega =377$
    $V_{s}=120{\sqrt {2}}cos(377t+120^{\circ })$

### laplace domain

now transform into the laplace domain ..
    ${V_{s}}(t)\rightarrow {\mathcal {L}}\left\{{V_{s}}(t)\right\}={\mathcal {L}}\left\{120{\sqrt {2}}cos(377t+120^{\circ })\right\}=-{\frac {(170.0*(0.5*s+326.0))}{(s^{2}+142129)}}$
    ${\mathcal {L}}\left\{i(t)\right\}={\frac {{\frac {-170.0*(0.5*s+326.0)}{(s^{2}+142129)}}+.01*i(0)}{10+.01*s}}$

### back to the time domain

    $i(t)={\mathcal {L}}^{-1}\left\{i(t)\right\}=(c+2.58)*e^{-{\frac {t}{.001}}}-15.7sin(377t)-2.58cos(377*t)$
Combining the cos and sin terms:
    $i(t)=15.9cos(377t+1.73)$
Which is the same as the steady state (particular solution).
Have to wait for the particular solution to show that C is zero and where the 2.58 comes from.
The time a period of 16.7 ms is more than 5 two time constants (5ms). This means that 99% of the initial energy imbalance is gone before getting through one third of an oscillation.
The sin term has to be positive so that the physical reality of voltage leading the current through an inductor is maintained. See phase check below for more discussion of this.

## Simulation

Vs,VL and I of the simulation graphed above.

### period check

The period above looks to be between 16ms and 17ms, closer to 17ms. This agrees with the formula:
    $\omega =2\pi *f$
    $f={\frac {\omega }{2\pi }}$
    $T={\frac {1}{f}}={\frac {2\pi }{\omega }}={\frac {2\pi }{377}}=16.7ms$

### magnitude check

The magnitude of Vs above appears to be between 150 and 200 volts, probably around 175 volts. This agrees with the math:
    $120*{\sqrt {2}}=169.7$
The magnitude of i(t) appears to be between 10 and 20 amps, closer to 15 amps. This agrees with the predicted 15.9 amps above.
The magnitude of VL appears to be between 0 and 100 volts, close to 50 volts. This agrees with the predicted 59.9 volts above.
Vr can not be graphed because of the choice of ground. This is true in the real world also. If ground were placed between the resistor and the inductor then Vr and VL could be measured with an oscilloscope or the above simulator, but their phase relationship would appear $\pi$ out of phase.

### transient response check

The transient response is obviously part of the simulation since all values start out at zero, but by the time the first cycle is finished, the values have separated and are never zero at the same time. Compare the period 16.7ms with the time constant (seen in the expondent associated with C in the inverse laplace transform) .001 or 1ms. After five time constants (2ms) the transient reponse is less than 99% of it's original value of 2.58 (the value of C). This is means that 5/16.7 = 35% into the first cycle the value of the transient is:
    $2.58*e^{-2}=.35volts$
and .0000001 volts by the end of the first cycle.

### phase check

Phase is word describing the angle in the calculations. Voltage will always lead the current through an inductor (think of the terminal relationship or ELI) by $90^{\circ },{\frac {pi}{2}}$ or ${\frac {1}{4}}$ of a period.
The inductor's voltage is orange and the inductor's current is in the bottom graph above. Voltage does lead the current. The time between their peaks is about 4ms which is approximately ${\frac {1}{4}}$ of the period 16.7ms.
The resistors voltage can not be seen in above, but it's phase is identical to the current. The source voltage has to be between the resistor and the inductor voltage (from the loop of Kirchhoff's law). And it is above. The circuit is being dominated by the resistor (voltage is 159 compared to 59), (resistor is 10 ohms, inductor is .01*377 = 3.77 ohms), thus the source voltage is closer to the resistor(current wave).

## Power Analysis

Power Analysis is rooted in the phasor domain! The phasor domain is limited to sinusoidal driving sources. This is why the discussion of RMS power and it's calculation is not part of this analysis.
    $\mathbb {V} _{s}=120{\sqrt {2}}\angle 2.09$
    $\mathbb {I} =15.9\angle 1.73$
    $\mathbb {I} ^{*}=15.9\angle -1.73$
if :$\mathbb {V} =M_{v}\angle \phi _{v}\quad$, and $\quad \mathbb {I} =M_{i}\angle \phi _{i}$ then
    $\mathbb {S} =\mathbb {V} \mathbb {I} ^{*}={\frac {M_{v}M_{i}}{2}}\angle (\phi _{v}-\phi _{i})={\frac {120{\sqrt {2}}*15.9}{2}}\angle (2.09-1.73)=135\angle 0.36=126+47.6j$
and
    $cos(.36)=.936$
In summary
| Value | Units | Description |
| $135$ | volt-ampere va | apparent power what utility companies manage: peak power they design for, peak power they have to deliver |
| $.936$ | unitless | power factor, ratio of real power to apparent power, ideally 1 |
| $126$ | watt W | real, average, active power ... what consumers want to pay for (watt-hours) |
| $47.6$ | volt-amp-reactive var | reactive power ... why not all outlets in a room are on the same circuit breaker |

## Intuition

ELI ... voltage leads the current through an inductor
Derivatives cause a lag ... a delay in time ... which is a positive angle in sinusoidal.