Monday, June 23, 2014

Strange Attractors

I came across an interesting paper [1] which discusses the Lorenz model of general circulation of the atmosphere. The model comprises the following three nonlinear ordinary differential equations,

dX/dt = -Y2 - Z2 -aX +aF

dY/dt = XY - bXZ - Y + G

dZ/dt = bXY + XZ - Z.

Values of a = 1/4, b = 4 and G = 1 are used in [1]; F is given various values.

What's interesting (for me) is that these equations can be implemented on the analogue computer as it stands - just. It makes something of an interesting case to attempt on the computer in its current state. And a good set of equations to try and implement. The important thing is to have big sheets of paper!

Here's a sketch of how I converted the equations into a patching diagram. (At the moment, I am trying to avoid cases which need re-scaling, and so it's a very direct implementation of the set of equations.)


It uses seven of the eight integrator/summers (3 are configured as integrators), plus three of the four available summers, plus two of the three multipliers, and both squarers. Having never programmed an analogue compute before, it's interesting to see what parts of the machine are actually the most useful. For the current problem, the non-inverting summers proved particularly handy. And being able to configure the integrator/summers as either integrator or summer is very useful.

The biggest problem was a rather mundane one of nearly running out of banana leads (I have more on order):


The results (plotted on a Philips PM8043 X-Y recorder) are shown below, for three different values of parameter F, near to the value of 5.198 used for attractor N of reference [1]. Vertical axis is Z(t) , horizontal axis is X(t). a = 1/4, b = 4 and G = 1, as in [1].

F = 5.1 V

F = 5.2 V

F = 5.3 V

An immediate discovery was that the thing is pretty sensitive to the value of F - in particular, the left hand side of the plots. I guess that's chaos for you. Nevertheless, the right hand side in particular, looks pleasingly similar to that given in [1], reproduced below:

Finally, it's incredibly easy to change something - in this case the value of G from 1 to 2 - just by moving one banana plug...and yielding another interesting plot:

F = 5.2 V; G = 2 V

This whole area of chaotic dynamics obviously has a very great depth...and as Masoller et al rightly say, is a fascinating subject [1].


[1] 'Characterization of Strange Attractors of Lorenz Model of General Circulation of the Atmosphere', C. Masoller et al, Chaos, Solitons and Fractals, Vol. 6, 1995, pp. 357 - 366. 



Thursday, June 5, 2014

3/4 assembled...

Control unit (lower rack); integrators, summing amplifiers, multipliers and divider (middle rack); coefficient potentiometers (upper rack). The plan is to (perhaps) add wooden sides to the racking - plus rear panels need sorting out - including a big 26-way bus connector (none of your USB/e-SATA/Firewire on this beast!)


And there's space for another rack...with, inter alia, special functions...


Thursday, May 29, 2014

Another rack completed

Initially I thought this rack would be a few potentiometers in an otherwise rather empty box, but of course it turned out to be a bit more involved...



Well, that completes all the main electronics - for the time being - special functions are next - but before that I'll do a bit of the hardware to hold the three completed racks, plus making up the bus cable interconnects and some miscellaneous wiring (e.g. the two meter outputs are buffered and will appear at BNC sockets on the rear panel...)

Saturday, May 3, 2014

Coefficient Attenuators

Allows coefficients to be set in the range -1 to +1. There are fifteen of these circuits. Each uses a 10 turn potentiometer. Based on the circuit from Ulmann's book, Fig 4.26, right.

Of course nothing being as straightforward as it seems, it turned out that there was a problem when the gain is set to zero - i.e. with the potentiometer wiper halfway along its track. Had my retrospectoscope been fully operational maybe this would have been obvious (i.e. the op amp is attempting to find difference of two large voltages - not a problem at DC, but...). At several kHz noise becomes a big problem and the output isn't zero, but a noisy, relatively large amplitude (> 100 mV) waveform. Oddly, it doesn't seem connected with the fact the potentiometers are wire wound (and hence inductive).

Apparently, making an op amp circuit with zero gain is not as easy as it sounds, at least at several kHz. After much thought and some experimentation, the problem was solved with the addition of a small amount of capacitance from the non-inverting pin to ground. It's very specific - an 82 pF plus trimmer (5 - 60 pF) in parallel does the job. Adjusting the trimmer gets the output noise right down to a few mV, with the 10 turn potentiometer set halfway.


The switching (via relays) allows the op amp's output to be sent to the panel meter with either (a) input switched to an internal reference voltage (1 V or 10 V), or (b), input from panel jack. There is an (on) off (on) momentary switch on front panel to do this, which switches the relays. One switch for each op amp. Relays needed because an (on) on (on) double pole switch seemed impossibly difficult to procure, whereas I could obtain a huge number of dpdt relays via eBay at about 20 pence each(!). 

The switching idea is taken from Jackson (Analog Computation, 1960), Fig 12-41 (c).


And here's one of the trimmers, with 82 pF capacitor behind...


Sunday, April 20, 2014

Friday, April 18, 2014

The Butterfly Effect

Integrator rack completed. Banana plugs purchased and leads made up.

And now for a first attempt at a serious bit of programming. Following in the footsteps of many others suggests solving the Lorenz equations...three coupled, first-order, nonlinear differential equations which describe the trajectory of a particle through time, originally derived by Edward N. Lorenz (1963) as a model of atmospheric convection (there's even part of MIT named after him). (It's either that or 'hello world'!)

The equations describe the evolution of the spatial variables x, y, and z, given the parameters σ, β, and ρ, through the specification of the time-derivatives of the spatial variables:

dx/dt = σ(y − x)
dy/dt = x(ρ − z) − y
dz/dt = xy − βz .

Now, given I haven't built the potentiometer rack yet (it's next on my list), I am a bit limited as to parameter choice, and I can't readily use the values Mr Lorenz used (σ = 10, β = 8/3 and  ρ = 28). After some thought, I've opted for σ = 5, β = 1, and ρ = 7. These I can effect without the potentiometer rack: σ and β are integrator/summer input multiplicands and and ρ = 7 volts (which I can cook up from 2 x 3 V plus 1 V). Also, these values give a solution which (I thought) lies within +/- 10 volts, and also it's a reasonably interesting solution.

To get (minus) x we just integrate the first equation and so on. Two multipliers are used to create the xy and x(ρ − z) parts respectively, and all the bits are added together as required. Here's a sketch of my thinking:

...and here's the plugged up integrator rack:


which yields the plot, below right:


The left hand plot is taken from a very useful online resource written by Andrew Baxter:

http://highfellow.github.io/lorenz-attractor/attractor.html

for the above parameter values, the squares are 2.5 units (i.e. volts) for the left hand plot, and the oscilloscope is set at 2 V per division.

I think the discrepancy on the right side of output from the analog computer is because the thing went outside the -10 V limit on summing amplifier number 2 (this cooks up the xy − βz term). Clearly I have yet to get to grips with the mysterious business of scaling problems on the analog computer.





  

Sunday, April 6, 2014

Hooking up

In the midst of a lot of wiring...


...but eventually in a position to plug up my first program on the new front panel. This is Programming Example 8.1 from Ulmann's book Analog Computing (this is the example I used to test the integrator/summer boards back in October)...two integrators (left hand side) and one inverter (right hand side). It worked.

It really is beginning to look like an analogue computer!


Next step is to hook up the final four integrators (top left of panel)...trouble is that each integrator has a three way connector (null potentiometer), a nine way connector (toggle switch - selects INT or SUM mode), twelve banana jack connections plus three LED connections..that's a lot of soldering!