Shortcuts for doing audio/electronics calculations in Maxima. This loads automatically at startup if placed in a directory like this:
C:\Documents and Settings\User Name\maxima\maxima-init.mac(XP)C:\Users\User Name\maxima\maxima-init.mac(Windows 7)~/.maxima/maxima-init.mac(Ubuntu)
|| infix binding power is set to happen after multiplication, but before addition.
I think it might be best if it happened before division, but * and / are both 120,
so I'm not messing with that until I understand it better. In other words:
a * b || c=(a * b) || ca / b || c=a / (b || c)a + b || c=a + (b || c)
I added multipliers like k and M as an experiment. The unit package would seem to be the standard way to do this, but it doesn't exactly work for quick calculations. I'd have to set up abbrevations for things like "mA", "uF", "kohm" etc anyway, and then it still wouldn't work:
(%i1) ((20*kiloohm||5*kiloohm)+6.8*kiloohm) || ((20*kiloohm||5*kiloohm)+6.8*kiloohm);
* long pause *
(%o1) Maxima encountered a Lisp error:
Error in COND [or a callee]: Invocation history stack overflow.
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
Much simpler:
(%i1) ((20k||5k)+6.8k) || ((20k||5k)+6.8k);
(%o1) 5899.375156210947
but I disabled it:
Incorrect syntax: K is not a prefix operator