[Maxima] plotting modulus of complex function

Bart Vandewoestyne Bart.Vandewoestyne at telenet.be
Thu May 3 06:18:39 CDT 2012

```Hello list,

Using wxMaxima 0.8.5, I'm trying to plot the modulus of two complex
function on the positive real axis.:

d: 1e-3\$
f: 10^6\$
omega: 2*%pi*f\$
epsilon[0]: 8.8541878176e-2\$
mu[0]: 4*%pi*10^(-7)\$
v[0]: 1/sqrt(epsilon[0]*mu[0])\$
k[0]: 2*%pi*f/v[0]\$
epsilon[sub]: 12.9*epsilon[0]\$

Z_TE_sub(s) := %i*omega*mu[0]/(k[0]*sqrt(s^2-epsilon[sub]/epsilon[0]))\$
Z_TE_0(s) := %i*omega*mu[0]/(k[0]*sqrt(s^2-1))\$
Z_TM_sub(s) :=
(k[0]*sqrt(s^2-epsilon[sub]/epsilon[0]))/(%i*omega*epsilon[sub])\$
Z_TM_0(s) := (k[0]*sqrt(s^2-1))/(%i*omega*epsilon[0])\$
vTE(s) := (Z_TE_sub(s)*Z_TE_0(s))/(Z_TE_sub(s) +
Z_TE_0(s)*coth(d*k[0]*sqrt(s^2-epsilon[sub]/epsilon[0])))\$
vTM(s) := (Z_TM_sub(s)*Z_TM_0(s))/(Z_TM_sub(s) +
Z_TM_0(s)*coth(d*k[0]*sqrt(s^2-epsilon[sub]/epsilon[0])))\$
Gm(s) := -vTE(s)/(2*%pi)\$
Ge(s) := (vTE(s)-vTM(s))/(2*%pi*s*k[0])\$

plot2d(float(abs(Gm(s))), [s, 1e-1, 1e3]);
plot2d(float(abs(Ge(s))), [s, 1e-1, 1e3]);

Unfortunately, this fails.  I get the error:

(%i18) plot2d(float(abs(Gm(s))),[s,0.1,1000.0])
Maxima encountered a Lisp error:
Couldn't write to #<SB-SYS:FD-STREAM for "descriptor 9" {10061923A1}>:
Broken pipe
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i19) plot2d(float(abs(Ge(s))),[s,0.1,1000.0])
Maxima encountered a Lisp error:
Couldn't write to #<SB-SYS:FD-STREAM for "descriptor 9" {10061923A1}>:
Broken pipe
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

Unfortunately, from the error I cannot make up what I'm doing wrong.
Could someone explain it to me?  My .mac file can also be found at
https://www.dropbox.com/s/934yxkm4bq3bcg9/bartfile.mac

Kind regards,
Bart
```