Design Article
A virtual analog computer for your desktop
Arthur Glazar
6/29/2012 1:27 PM EDT
Editor's Note: This article came about from another article called "Circuits without wires" in which a comment by Arthur Glazar led to my discovery of this gem of an article, thanks to my colleague Margery Conner.
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:
INTEGRATOR
DIFFERENTIATOR
SUMMER
INVERTER
MULTIPLIER
DIVIDER
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


LHH
7/2/2012 7:54 PM EDT
I hope I can find time for this soon! I still have a precious gift my family gave me one Christmas, a Heathkit EC-1, waiting for restoration one of these days! I had to wait until my first year in college to get access to an oscilloscope for the "bouncing ball" simulation. What a thrill it was to see that! I had considered "upgrading" the EC-1 with improved SS amplifiers but this virtual solution might suffice and I can preserve the warm and friendly glow of all those old vacuum tubes to show my grandkids!
Sign in to Reply
mehcaver
8/8/2012 9:12 PM EDT
Thanks, Arthur, for this unique article. No doubt you can use a simulator to plan a setup, but it's no substitute for the real thing. I'm told that an analog computer was once programmed to solve Schrodinger equations, allowing quantum mechanics problems to be solved with ACs.
I remember not so long ago, when a Mig fighter pilot defected to the West along with his plane. Reverse-engineers soon found that it used vacuum tube avionics! How primitive. But then, the tube versions were naturally radiation-hardened, as the ss versions were not. If I'm ever in the Garden City neighborhood, I'll have to drop in the museum.
Sign in to Reply
Arthur.Glazar
8/29/2012 12:10 PM EDT
I appreciate your comments and interest. If you plan to visit the museum, drop me an email.
Sign in to Reply
LHH
7/2/2012 11:49 PM EDT
I did learn a lot of interesting things while building and exploring the EC-1 at the age of 11-12 or so. One of the longest lasting lessons is not to touch terminal strips with unknown voltages on them! I'm lucky I didn't kill myself but I've been much more cautious ever since so it was a good lesson learned.
Sign in to Reply
CCarpenter
7/3/2012 1:25 PM EDT
OH NO! Another interesting project for the backlog! Great idea!
When I was in school, we had an Analog Computer lab with a beautiful, room-filling analog computer -- and a professor that loved it like a first-born child. Plugging up your equations, setting your pots and then watching the simulation on a scope screen was magical, and made all those differential equations (ordinary and partial!) come alive
I'll definitely try this soon!
Sign in to Reply
Subramanian.Sivaramakrishnan
7/3/2012 6:26 PM EDT
Interesting idea of using SPICE (or any variant) simulator to solve differential equations. But then, you can do the same thing with more modern tools like Simulink using the same approach and much more!
Sign in to Reply
antolin.agatep_#3
7/3/2012 9:29 PM EDT
The point is not about tools, but in the methodologies that are being presented, i.e. analog computers were used in solving for "analytical" solutions to differential equations, which required the "programmer" to understand the phenomena in differential or Laplace transform representation. And, over many years, and advent of the digital computer programming, the analog computer approach has fallen into disuse, but its foundations are solid and does rival the digital computer approach although it is very cumbersome the way it was. Think of operational amplifiers when you think of analog computers. That's one of their most popular uses. But I have to say, since I've also studied analog circuits and design that this methodology is far from dead.
Sign in to Reply
hspence
7/3/2012 9:38 PM EDT
Scilab is a free simulation tool that is similar to matlab/simulink. Someone pointed out that digital computers are nothing more than large analog computers in which all the amplifiers are saturated.
Sign in to Reply
TTCSTim
7/13/2012 2:54 PM EDT
I thought I'd post this comment here, as well as on the file download page.
I found there was an error with the 3summer.asy file. Apparently this was adapted from a "7Summer" file, somewhat incompletely. If you edit the attributes in the 3Summer.asy file to refer to the 3Summer.sub file (instead of 7Summer.sub), then edit each of the pins to match the subcircuit interface description in Sumer3.sub, the file works and the output of the analog computer matches the actual inductor current exactly.
Sign in to Reply
Arthur.Glazar
7/16/2012 10:19 AM EDT
Thanks for pointing that out... I appreciate it. You're right about the origin of the error. I thought I had cleaned out all of the unused by-products.
Sign in to Reply
TTCSTim
7/22/2012 4:58 PM EDT
Mr. Glazar,
You're more than welcome. I figured you were just testing us.
By the way, thank you for a very interesting article. For some reason, I've been intrigued by the concept of analog computers ever since I came across the term, even though I was born about the time they were fading from the scene. I am a technician, and I spent most of my career on the digital side, but for the past 5 years, I've been working exclusively in the analog domain on high-voltage dc-to-dc converters.
Since reading your article, I've jumped in with both feet. I did a quick search and found some great resources. I received my copy of Johnson's book from 1963 (in good condition, considering it's nearly as old as I am) this week, and I just ordered a copy of Korn and Korn from about the same year. I also downloaded the old Philbrick book from Analog Devices' website. Fascinating material. It looks like 90% of what is covered in a modern op amp text book was already covered extensively in these three books fifty years ago. And it's all still pertinent.
I also came across a Users Manual for the Heathkit EC-1 that some contributors had mentioned. I just ran the "falling body" problem in SPICE and, of course, got the same result. This is a very interesting approach to DE's, at least for me. Now I've got to figure out the "bouncing ball" problem. It's interesting seeing the single-ended, inverter-only, vacuum tube op amp configuration. I think I had heard of that in a book by Jung, and I learned a little about tubes in my USMC technician training, but I never realized it's significance until now. You've got to be careful how you set up your DE if everything gets inverted. (Another reason your SPICE technique is preferable.)
I've blathered on enough. Thanks again for an eye-opening article. I'll get a lot of use out of this technique in my ongoing studies of op amp design and control theory. I might even try to build my own analog computer.
Sign in to Reply
Arthur.Glazar
7/23/2012 4:31 PM EDT
That's not blather! I greatly enjoyed your comments. I had a lot of fun using a state-of-the-art EAI 231-R analog machine (actually 3 of them bundled into one installation) back in the sixties. I hoped that my article would stir up interest and, by golly, it did. I will forward your comments to a colleague who also will enjoy them. By the way, building your own may sound like fun, but the devil is in the details! Also, the bouncing ball and an automobile front wheel spring/mass/damper are fun simulations.
Art
Sign in to Reply