# Circuit Theory/Analog Computer

## Goal

Design an analog computer that generates
a solution to this differential equation:

$$a_2{d^2 v(t) \over dt^2} + a_1{d v(t) \over dt} + a_ov(t) = f(t)$$

:   f(t) is the input, the bump the car is going over
:   v(t) is the output, the vertical motion of the car in response to
    the bump
:   a~2~ is related to the spring constant of a shock absorber
:   a~1~ is related to the damping coefficient and viscosity of the oil
:   a~o~ is varied depending upon the desired ride

```{=html}
<!-- -->
```

:   The goal is to vary a~2~, a~1~, and a~o~ electronically, rather than
    build many models physically. This is modeling as done before WWII
    instead of using matlab or similar software.

```{=html}
<!-- -->
```

:   Modern applications of this include control systems (opening and
    closing valves in an industrial process, turning off and on motors,
    controlling a nuclear power plant).

## Organizing

At first glance, need 6 op-amps, 2 for differentiation, 3 for scaling, 1
for adding.

But the adder can do scaling also.

Need to think about the overall circuit design too. The desired output
is v(t). The function f(t) is an input. The derivatives are temporary
values that are built from the output being feed back. So the math is
going to look something like this:

$$\frac{a_2}{a_o}{d^2 v(t) \over dt^2} + \frac{a_1}{a_o}{d v(t) \over dt} -\frac{1}{a_o}f(t) = v(t)$$

Need to feed the output back into the input also \... and will take
first derivative, then second, then feed into the adder with f(t). So
the math would look more like this:

$$-(-\frac{a_1}{a_o}{d v(t) \over dt} - \frac{a_2}{a_o}{d^2 v(t) \over dt^2} + \frac{1}{a_o}f(t)) = v(t)$$

<File:Op-Amp> Differentiating Amplifier.svg\|this takes the input and
differentiates it so output is $-{d v(t) \over dt}$
<File:Op-Amp_Inverting_Amplifier.svg%7Cthis> takes output of the first
derivative which is negative and makes it positive again, so the second
derivative will be negative also <File:Op-Amp> Differentiating
Amplifier.svg\|this generates the second derivative
${d^2 v(t) \over dt^2}$ which is now negative like the first derivative
<File:Op-Amp> Summing Amplifier.svg\|this will take the negative
${d v(t) \over dt}$ and the negative (because was inverted)
$-{d^2 v(t) \over dt^2}$ terms and adds them to a positive f(t), scaling
appropriately to generate $v(t)$

## Simulating

![](ShockAbsorber1.png "ShockAbsorber1.png") Assume the output of OA4 is
v(t).

Then the output of OA1 is:

$$-R_1C_1{d v(t) \over dt}$$

The output of OA2 is:

$$-\frac{R_3}{R_2}(-R_1C_1{d v(t) \over dt}) = \frac{R_3R_1}{R_2}C_1{d v(t) \over dt}$$

The output of OA3 is:

$$-R_4C_2{d (\frac{R_3R_1}{R_2}C_1{d v(t) \over dt}) \over dt} = -\frac{R_4R_3R_1}{R_2}C_1C_2{d^2 v(t) \over dt^2}$$

Assume V~14~ is f(t). Then the output of OA4, the adder is:

$$-R_8(\frac{f(t)}{R_7} + \frac{-\frac{R_4R_3R_1}{R_2}C_1C_2{d^2 v(t) \over dt^2}}{R_5} + \frac{-R_1C_1{d v(t) \over dt}}{R_{56}}) = \frac{R_8R_1}{R_{56}}C_1{d v(t) \over dt} + \frac{R_8R_4R_3R_1}{R_5R_2}C_1C_2{d^2 v(t) \over dt^2} - \frac{R_8}{R_7}f(t)$$

Comparing this to:

$$\frac{a_1}{a_o}{d v(t) \over dt} + \frac{a_2}{a_o}{d^2 v(t) \over dt^2} - \frac{1}{a_o}f(t) = v(t)$$

We can see that:

$$\frac{a_1}{a_0} = \frac{R_8R_1}{R_{56}}C_1$$

$$\frac{a_2}{a_o} = \frac{R_8R_4R_3R_1}{R_5R_2}C_1C_2$$

$$\frac{1}{a_0} = \frac{R_8}{R_7}$$

There are three knowns a~0~, a~1~, and a~2~, 10 unknowns and 3
equations. So the problem is under constrained, meaning that other
requirements can be used to pick the resistor and capacitor values.

