find_root



I don't really know the solution but here are some remarks.

First of all you  probably need to quote the first argument

plot2d('(g(z)),[z,zmin,zmax]);

Otherwise g(z) will be immediately evaluated at the
symbol z which may have some unintended consequences.

 Secondly, you can put print statements in the body of
g(z). That way you can find out if g(z) is really doing
what you think it is.

Michel