Analog Updates (publ. 2025-04-30)
Home made board
Progress was delayed a lot on the home-built analog computer, due to busyness with other things, lack of funds, and delays trying to figure out what was wrong with the comparator design. Eventually I just gave up on that (the comparator). I didn't want to do more troubleshooting until I had some fresh analog switch chips, thinking I might have damaged the two I had, but I can't afford another order right now.
I did wire up another open-amplifier/invert module. So, if I skip the comparator, I can proceed with getting the board wired up to the patch panel I made. I ran short on banana jacks, as the pack I bought had only 40 and I have 48 holes on the panel. Fortunately I have another eight on hand, but they are a different model that is too small for the holes I drilled, so I'll need to see if I have enough washers available to make that work.
PyDDA
I worked recently on getting PyAnalog setup, and I have been learning how to use PyDDA, one of the programs that comes with it. PyDDA a program that simulates a Digital Differential Analyzer, i.e., you feed it differential equations, and it does a numerical simulation.
PyAnalog repository
Here is a DDA file I came up with for the damped oscillator model, that I feed into PyDDA:
dt = const(0.1)
# y0 = const(1)
d = const(0.2)
k = const(0.5)
m = const(0.5)
dx0 = const(0)
x0 = const(1)
# ẍ = -(d*ẋ + k*x) / m
# = (-d*ẋ - k*x) / m
# = (a + b) / m
dx = neg(int(ddx, dt, dx0))
x = neg(int(dx, dt, x0))
a = mult(neg(d), dx)
b = mult(neg(k), x)
ddx = div(neg(sum(a, b)), m)
And this is out I told it to spit out the CSV data (actually TSV):
~/Repos/anabrid/pyanalog $ python3 -m dda.scipy -m RK45 -t 20 ~/Documents/dda/damped_oscillator/damped_oscillator.dda
t int_1 int_2
0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00
9.990009990009990001e-04 -9.988012588515080524e-04 9.999995010650039040e-01
1.098901098901098813e-02 -1.096467398233666977e-02 9.999397097958125924e-01
1.108891108891108673e-01 -1.082436471658202726e-01 9.939478926381143387e-01
8.320026055141191978e-01 -6.289520812667039884e-01 7.063723852832948236e-01
1.786038022167551365e+00 -7.023406864422785389e-01 1.579885176836259841e-02
2.741980259866538816e+00 -2.589339763447263132e-01 -4.669475202242487355e-01
3.658096897546880388e+00 2.101808036609348340e-01 -4.763354205989834278e-01
4.499806303778692396e+00 3.955734691474824816e-01 -2.004137799229915307e-01
5.351810035962899725e+00 3.012833771322688814e-01 1.132968742219785385e-01
6.203813768147107055e+00 5.984514096884460677e-02 2.707515502374049365e-01
7.145135933440451836e+00 -1.605272920628548483e-01 2.122094578184471891e-01
8.035818411191252508e+00 -2.041393451049871577e-01 3.687066163331342850e-02
9.008365972643471054e+00 -9.459975244851728804e-02 -1.171377859439316216e-01
9.898466093955400780e+00 3.805820396782541581e-02 -1.402212646895321657e-01
1.078082504254657792e+01 1.069936106029738127e-01 -6.974655921634265177e-02
1.176549092351191739e+01 8.331823822433050142e-02 3.146984070222387520e-02
1.265404507186793026e+01 1.349037871002671529e-02 7.551463607363437247e-02
1.359606910397879709e+01 -4.596897914467040075e-02 5.699813402528286499e-02
1.449921882983620414e+01 -5.580717408457265549e-02 7.339926500033379375e-03
1.546853511293667438e+01 -2.412597279264019207e-02 -3.362639729447319120e-02
1.637162178054430939e+01 1.259154415839740943e-02 -3.810965887411374431e-02
1.724732567835968666e+01 2.997204150327307734e-02 -1.769285150212794588e-02
1.812907521181310599e+01 2.392422804843105655e-02 7.564065019069646928e-03
1.901082474526652533e+01 4.989691181814061294e-03 2.066384702696474895e-02
1.995934709269948826e+01 -1.218047256308789350e-02 1.639266821506582539e-02
2.000000000000000000e+01 -1.263488889047444455e-02 1.588816540369838645e-02
If I output this into a file, I could then open it in LibreOffice and view it with an X-Y line chart, like in this screenshot:
the damped spring simulation data viewing in LibreOffice with a chart
Generally speaking, for multiple runs, it would be more sensible to feed the data into gnuplot, or some other automated approach.
There are some things that confuse me about the program, in particular the relationship between the infinitesimal parameter in the int() function, the approximation method specified on the command line, and the actual output. Changing the constant fed into that parameter didn't seem to have any effect on the program output. I sent off an e-mail trying to get more information about that.
Copyright
This work © 2025 by Christopher Howard is licensed under Attribution-ShareAlike 4.0 International.
CC BY-SA 4.0 Deed