problems with abs() and cabs()



On Thu, Jan 07, 2010 at 10:10:20AM -0500, Stavros Macrakis wrote:
> Until the cabs/abs problem is resolved, there is a workaround for your problem,
> namely to define a function which first calculates the complex numerical value,
> and only then calls abs, something like this:
> 
> Instead of
> 
> ?????? plot3d( abs(f(x,y)), ...)
> 
> use
> 
> ?????? fff(x,y) := block([temp], temp: float(f(x,y)), cabs(temp) )
> ?
> ?????? plot3d( '(fff(x,y)), ...)
> 
> Let us know if this helps.

I have tried the following. I appended these lines to the code I sent to
this list earlier:

f(ky,kz) := ''(subst(k0=%i,Ree));

abs_f(ky,kz) := cabs(f(ky,kz));

plot3d(abs_f,[ky,-3,3],[kz,-3,3]);

plot3d(cabs(f(ky,kz)),[ky,-3,3],[kz,-3,3]);

The first plot works, the second one runs forever.

-- 
Stanislav