Subject: Best way to use a compiled function in findroot
From: Robert Dodier
Date: Tue, 31 Aug 2010 10:31:18 -0600
On Tue, Aug 31, 2010 at 10:07 AM, Sergio Callegari
<sergio.callegari at gmail.com> wrote:
> (%i5) g(y):=block([x:gensym()],findroot('f(x)-y,x,-1,1));
> (%o5) ? ?g(y) := block([x : gensym()], findroot('f(x) - y, x, - 1, 1))
>
> I get:
>
> (%i6) g(0);
> (%o6) findroot(f(g900), g900, - 1, 1)
There is no findroot function. There is a function find_root, however.
> g(y) := block([x : gensym()], findroot(lambda([x], f(x) - y), x, - 1, 1))
>
> g(0) hangs forever...
Did you omit the final semicolon?
If the semicolon is present: launch maxima as maxima -g
(enable Lisp debugger), then, when g(0) (entered as g(0); of course)
is running, type control-C.
If all goes well, it opens the Lisp debugger.
Try to get a stack trace. Something like backtrace or :backtrace
or :bt (it varies from one Lisp to another).
Then post the stack trace.
best,
Robert Dodier