Editor's Note: This article came about from another article
without wires" in which a comment by Arthur Glazar led to my
discovery of this gem of an article, thanks to my colleague Margery
If you "do" circuit design, then you probably use PSPICE or one of its derivatives in your design process. If that's the case, you can easily add a powerful "virtual analog computer" (VAC) to your desktop.
Why would anyone want an analog computer, since they became extinct, for good reasons, back in the 1970s? The answer is first, analog computers are fun to use. Second, you can't beat an analog computer for solving, analyzing, manipulating and teaching differential equations. Finally, the limitations that led to the demise of traditional analog computers are eliminated in a PSPICE virtual implementation.
Traditional analog computers utilize operational amplifiers (op-amps) that are configured as functional blocks such as integrators and summers. But op-amp signals can only swing between the supply-voltage rails. As a consequence, traditional analog computer simulations must include "amplitude scaling" to keep all signals within that dynamic range. Similarly, "time scaling" is needed in a traditional analog computer to account for the frequency response of the functional blocks. These considerations vanish in the VAC, so that kilovolts and microvolts, hours and microseconds peacefully coexist in a simulation. Also, there are no leakage currents (and hence no integrator "drift"), no potentiometer loading effects, no limits on the number of integrators, multipliers. etc., etc. Examples will follow.
A final observation before getting into the implementation of the VAC: To avoid ambiguity, it is recommended that the International System of Units (abbreviated SI from French: Système international d'unités) of measure be used exclusively; that is, kilograms, meters, seconds, newtons, amperes, etc. By doing so, the voltage at any node of an analog simulation will be a one-to-one analog of kilograms, meters, newtons, etc. For convenience, various function blocks may be included to perform input/output conversions to and from SI. In short, although SI may be the "native" system of units, VAC can be customized to handle other systems of units as well.
I use LTSPICE(R), a product of Linear Technology Corporation. This is a world-class circuit simulator available from LTC as a free download from LTC.com. If you prefer a different "Alphabet-SPICE", that's ok as long as it includes the features that will be discussed.
In "building" a VAC the first step is to create a library of commonly-used functions. Other functions can be created as needed. Here is a basic list:
Figure 1 shows the symbols that I use for these functions. And of course, any of LTSPICE's existing library components can be used within a VAC simulation as we will show. For very complex simulations, the LTSPICE hierarchy methods can keep things organized.
Figure 1: The symbols for the library of common used functions in this analog computer
Let's now look at a simple example of a differential equation and how to set up and run it in LTSPICE. We'll use an electrical problem, but it could be a mechanical or mechatronic problem just as well.
Figure 2 shows a simple R-L-C series circuit together with the 2nd-order differential equation that relates the current, i, to the other elements.
Figure 2: A simple R-L-C series circuit together with the 2nd-order differential equation
R(di/dt) + L(d2i/dt2) + (1/C)i = dV/dt
In setting up a VAC simulation, the first step is to apply the following general rule:
RULE: Rearrange the differential equation so that the highest-order derivative is isolated on the right side of the equation.
Applying this Rule to the previous equation gives the following:
−(R/L)(di/dt) − (1/LC)i + (1/L)(dv/dt) = d2i/dt2
The notation in the above equations is not amenable to keyboard entry in LTSPICE, so instead, we will use "primes" to denote time derivatives and rewrite the equation as follows:
-(R/L)i' -(1/LC)i + (1/L)V' = i'' ..................... (1)
The three terms on the left side of equation (1) represent inputs to a summing amplifier, and the single term on the right side represents the output of the summing amplifier as shown in Figure 3.
Figure 3: The summing amplifier with inputs representing the left side of equation (1) and the output representing the right side of equation (1)
Since the output of the summing amplifier is i'' (the second derivative of current, i), it can be integrated once to obtain i' and twice to obtain i as shown in Figure 4. Then i' and i can be multiplied by -(R/L) and -(1/LC), respectively, and fed back to the appropriate input as shown in Figure 5.
Figure 4: Showing the inputs being integrated twice to give i as an output
Figure 5: Showing i' and i being multiplied by -(R/L) and -(1/LC), respectively, and fed
back to the appropriate input