# Circuit Theory/Sinusoidal Sources
## Steady State

"Steady State" means that we are not dealing with turning on or turning off circuits in this section. We are assuming that the circuit was turned on a very long time ago and it is behaving in a pattern. We are computing what the pattern will look like. The "complex frequency" section models turning on and off a circuit with an exponential.

## Sinusoidal Forcing Functions

Let us consider a general AC forcing function:
    $v(t)=M\sin(\omega t+\phi )$
In this equation, the term M is called the "Magnitude", and it acts like a scaling factor that allows the peaks of the sinusoid to be higher or lower than +/- 1. The term ω is what is known as the "Radial Frequency". The term φ is an offset parameter known as the "Phase".
Sinusoidal sources can be current sources, but most often they are voltage sources.

## Other Terms

There are a few other terms that are going to be used in many of the following sections, so we will introduce them here:

### Period

    The period of a sinusoidal function is the amount of time, in seconds, that the sinusoid takes to make a complete wave. The period of a sinusoid is always denoted with a capital T. This is not to be confused with a lower-case t, which is used as the independent variable for time.

### Frequency

    Frequency is the reciprocal of the period, and is the number of times, per second, that the sinusoid completes an entire cycle. Frequency is measured in Hertz (Hz). The relationship between frequency and the Period is as follows:
       $f={\frac {1}{T}}$
    Where f is the variable most commonly used to express the frequency.

### Radian Frequency

    Radian frequency is the value of the frequency expressed in terms of Radians Per Second, instead of Hertz. Radian Frequency is denoted with the variable $\omega$. The relationship between the Frequency, and the Radian Frequency is as follows:
       $\omega =2\pi f$

### Phase

    The phase is a quantity, expressed in radians, of the time shift of a sinusoid. A sinusoid phase-shifted $\phi =+2\pi$ is moved forward by 1 whole period, and looks exactly the same. An important fact to remember is this:
       $\sin({\frac {\pi }{2}}-t)=\cos(t)$ or $\sin(t)=\cos(t-{\frac {\pi }{2}})$
Phase is often expressed with many different variables, including $\phi ,\psi ,\theta ,\gamma$ etc... This wikibook will try to stick with the symbol $\phi$, to prevent confusion.

## Lead and Lag

A circuit element may have both a voltage across its terminals and a current flowing through it. If one of the two (current or voltage) is a sinusoid, then the other must also be a sinusoid (remember, voltage is the derivative of the current, and the derivative of a sinusoid is always a sinusoid). However, the sinusoids of the voltage and the current may differ by quantities of magnitude and phase.
If the current has a lower phase angle than the voltage the current is said to lag the voltage. If the current has a higher phase angle then the voltage, it is said to lead the voltage. Many circuits can be classified and examined using lag and lead ideas.

## Sinusoidal Response

Reactive components (capacitors and inductors) are going to take energy out of a circuit like a resistor and then pump some of it back into the circuit like a source. The result is initially a mess. But after a while (5 time constants), the circuit starts behaving in a pattern. The capacitors and inductors get in a rhythm that reflects the driving sources. If the source is sinusoidal, the currents and voltages will be sinusoidal. This is called the "particular" or "steady state" response. In general:
    $A_{in}\cos(\omega _{in}t+\phi _{in})\to A_{out}\cos(\omega _{out}t+\phi _{out})$
What happens initially, what happens if the capacitor is initially charged, what happens if sources are switched in and out of a circuit is that there is an energy imbalance. A voltage or current source might be charged by the initial energy in a capacitor. The derivative of the voltage across an Inductor might instantaneously switch polarity. Lots of things are happening. We are going to save this for later. Here we deal with the steady state or "particular" response first.

## Sinusoidal Conventions

For the purposes of this book we will generally use cosine functions, as opposed to sine functions. If we absolutely need to use a sine, we can remember the following trigonometric identity:
    $\cos(\omega t)=\sin(\pi /2-\omega t)$
We can express all sine functions as cosine functions. This way, we don't have to compare apples to oranges per se. This is simply a convention that this wikibook chooses to use to keep things simple. We could easily choose to use all sin( ) functions, but further down the road it is often more convenient to use cosine functions instead by default.

## Sinusoidal Sources

There are two primary sinusoidal sources: wall outlets and oscillators. Oscillators are typically crystals that electrically vibrate and are found in devices that communicate or display video such as TV's, computers, cell phones, radios. An electrical engineer or tech's working area will typically include a "function generator" which can produce oscillations at many frequencies and in shapes that are not just sinusoidal.
RMS or Root mean square is a measure of amplitude that compares with DC magnitude in terms of power, strength of motor, brightness of light, etc. The trouble is that there are several types of AC amplitude:
* peak
* peak to peak
* average
* RMS
Wall outlets are called AC or alternating current. Wall outlets are sinusoidal voltage sources that range from 100 RMS volts, 50 Hz to 240 RMS volts 60 Hz worldwide. RMS, rather than peak (which makes more sense mathematically), is used to describe magnitude for several reasons:
* historical reasons related to the competition between Edison (DC power) and Tesla (Sinusoidal or AC power)
* effort to compare/relate AC (wall outlets) to DC (cars, batteries) .. 100 RMS volts is approximately 100 DC volts.
* average sinusoidal is zero
* meter movements (physical needles moving on measurement devices) were designed to measure both DC and RMS AC
RMS is a type of average: $p_{\mathrm {rms} }={\sqrt {{1 \over {T_{2}-T_{1}}}{\int _{T_{1}}^{T_{2}}{[p(t)]}^{2}\,dt}}}$
Electrical power delivery is a complicated subject that will not be covered in this course. Here we are trying to define terms, design devices that use the power and understand clearly what comes out of wall outlets.