#2740 demo(romberg) fails

None
open
nobody
None
5
2014-05-30
2014-05-30
Sergey Litvinov
No

demo(romberg) fails. Here is a transcript:

Maxima branch_5_33_base_76_ge99672b http://maxima.sourceforge.net
using Lisp CLISP 2.49 (2010-07-07)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) demo(romberg);

read and interpret file: /home/vital303/prefix-maxima-main/share/maxima/branch_5_33_base_76_ge99672b/demo/romberg.dem

At the '_' prompt, type ';' and <enter> to get next demonstration.
(%i2) define_variable(pi,apply('ev,[%pi,numer:true]),float)
_
(%i3) define_variable(freq,3.3,float,"the frequency in radians/second")
_
(%i4) v(x):=(mode_declare(x,float),x*abs(sin(freq*x)))
_
(%i5) h1(freq):=romberg('v,0,pi)
_
(%i6) h2(freq):=romberg(x*abs(sin(freq*x)),x,0,pi)
_
(%i7) h1(5.5)
(%o7)                          3.14872822195275
_
(%i8) h2(5.5)
(%o8)     
                     3.14872822195275
_(%i9) translate(h1,v,h2)
warning: encountered undefined variable pi in translation.
warning: encountered undefined variable freq in translation.
warning: encountered undefined variable x in translation.
warning: encountered undefined variable pi in translation.
_
(%i10) h1(5.5)
(%o10)                         3.14872822195275
_
(%i11) h2(5.5)
Maxima encountered a Lisp error:

APPLY: argument list given to SYSTEM::ERROR-OF-TYPE is dotted (terminated by "Invalid lambda list element 0.0. A lambda list may only contain symbols and lists.")

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i12) compile(functions)
warning: encountered undefined variable freq in translation.
warning: encountered undefined variable pi in translation.
warning: encountered undefined variable pi in translation.
(%o12)                            [v, h1, h2]
_
(%i13) h1(5.5)
(%o13)                         3.14872822195275
_
(%i14) h2(5.5)
Maxima encountered a Lisp error:

APPLY: argument list given to SYSTEM::ERROR-OF-TYPE is dotted (terminated by "Invalid lambda list element 0.0. A lambda list may only contain symbols and lists.")

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%o15) /home/vital303/prefix-maxima-main/share/maxima/branch_5_33_base_76_ge99\
672b/demo/romberg.dem

Discussion

  • After

    (%i9) translate(h1,v,h2)
    

    "x" is bonded to 0.0 and "romberg" signals error:

    (%i1) trace(romberg)$
    (%i2) h2(5.5);
    1 Enter romberg [0.0, 0.0, 0, 3.141592653589793]
    Maxima encountered a Lisp error:
    
    APPLY: argument list given to SYSTEM::ERROR-OF-TYPE is dotted (terminated by "Invalid lambda list element 0.0. A lambda list may only contain symbols and lists.")
    
    Automatically continuing.
    To enable the Lisp debugger set *debugger-hook* to nil.
    
     
    Last edit: Sergey Litvinov 2014-05-30