Re: Vector analysis and bode plots



Hello Ron, hello Jon,

I've made a little script to make Bode gain and phase plots.
You can get it via the cvs web interface:
http://cvs.sourceforge.net/viewcvs.py/maxima/maxima/share/contrib/bode.mac?view=markup
Click the (download) link to get a copy without all the web markup stuff.

bode.mac uses the log-axis stuff (Gnuplot mode only) which is
not in Maxima 5.9.2, but you can download the current cvs version
of plot.lisp and load that to get the log-axis. There is a note in the
comments in bode.mac about that.

The only gotcha is that the carg (argument, i.e., angle of complex number)
function attempts to return a single answer when the right answer is something
like "if in this domain then answer1 else if in that domain then answer2".
This is a shortcoming of the carg function. In the examples I tried
(in comments of bode.mac) that only happened for one example, so
maybe it's not a big deal.

Example:
load ("bode.mac");
bode_gain (1 / (1 + s/10 + s^2), [w, 1/100, 100]);
bode_phase (1 / (1 + s/10 + s^2), [w, 1/100, 100]);

I think I got the scaling right, let me know if something doesn't look right.

Hope this helps,
Robert Dodier