|Symbolic Circuit Simulation|
V=I*RSolve for I. This turns out to be a general problem in simulation, that is, get the currents on the right side of the equation to sit over to the left by themselves.
In using Maxima, I always like to use variables with three-letter names. This makes things easier to work on in the long run. So the above problem in Maxima looks like this:
(C1) vin=iin*rin; (D1) vin = iin rin (C2) solve([D1],[iin]); vin (D2) [iin = ---] rinI typed in the parts that are in bold, the rest is Maxima.
I have found that it is easier to use Maxima if I avoid using the equals sign. This is easy to do, because the solve() function assumes that the expressions without and equals sign is actually an equation that is implicitly equal to zero. So I prefer it this way:
(C1) vin-iin*rin; (D1) vin - iin rin (C2) solve([D1],[iin]); vin (D2) [iin = ---] rinHere's a voltage divider:
(C1) vin-vout-iin*rin; (D1) - vout + vin - iin rin (C2) vout-iin*rsh; (D2) vout - iin rsh (C3) solve([D1,D2],[iin,vout]); vin rsh vin (D3) [[iin = ---------, vout = ---------]] rsh + rin rsh + rinThis set of equations has two Ohm's law equations, two unkowns (iin and vout), and three knowns (vin, rin, and rsh). I always start with a little table like this:
(implicit = 0)
The networks can get quite large, and they can have many different types of components, such as opamps, transistors, and reactive components. The danger of this approach is that you get very large solutions to the equations, and you wonder, 'What am I going to do with this huge symbolic solution?' These are called wallpaper functions, because the only thing they are good for is printing out and using as wallpaper. Actually, there are nice things that you can do to tame wallpaper functions and make them useful:
More later! Meanwhile, Download Maxima and try it out!
More about the divider, KCL, and the vout node.
A larger circuit
reactive components, tank circuit with capacitive coupling.
automation of equation generation
comparison with numerical simulation for results and performance