cobyla



I don't understand the gensym proposal -- under what circumstances would it
be useful to carry out plot2d(%pi,[%pi,0,1]) rather than giving an error?
 (Currently, it plots 3.14 for x=0..1!)

Every command that requires a symbolic variable argument should give an
error when called with a symbolic constant.  I see that we are doing a poor
job of this: shockingly, none of *diff, integrate, plot2d, taylor, at,
allroots* perform this common-sense check, though some other functions do (*:,
::, limit, tlimit, quad_qags*).  Careful: some name arguments can
meaningfully be symbolic constants *cf.* *solve, horner, partfrac*; and of
course *subst *allows arbitrary expressions to be substituted for.

                 -s


On Sat, Jul 27, 2013 at 12:45 PM, Leo Butler <l_butler at users.sourceforge.net
> wrote:

>    From: Raymond Toy <toy.raymond at gmail.com>
>    Date: Sat, 27 Jul 2013 09:05:18 -0700
>    Content-Type: text/plain; charset="us-ascii"
>
>    On 7/27/13 6:03 AM, jfr.maurel at gmail.com wrote:
>    > Hi,
>    >
>    > I cannot find a solution with cobyla of the following problem. I can
>    > solve it with python libraries.
>    > I played with rhobeg, rhoend and maxfun without luck.
>    >
>    > windows 7
>    > wxMaxima 13.04.2
>    > wxWidgets: 2.8.12
>    > Support unicode: no
>    > Version de Maxima:5.30.0
>    > Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
>    >
>    > Could you please tell me what I am doing wrong ?
>
>    In maxima, %gamma is Euler's constant, 0.577.  Change %gamma to
>    something else.  When I do this (changing %gamma to %g), I get the
>    solution
>
>    [[u = .03705430246865427, v = - .03357050298344191,
>                            %g = .001264520332765797], - .1276445445548629,
>    153, 0]
>
>    which satisfies the constraint.
>
>
> 
> Ahh, this is really quite hard to find the error even when you know
> that %gamma might be the source of the error, as you can see from my
> first message. I think the root source of this issue is that
> coerce-float-fun is with coerce-float-fun. It seems that when
> coerce-float-fun is fed an expression, it should either replace the
> input list of variables with gensyms in that expression; or, the list
> of variables should be scanned for constants and an error thrown if a
> constant is found.
>
> Here is the identity function:
>
>
> (%i1) :lisp (progn (defvar $FN) (setf (symbol-function '$FN)
> (coerce-float-fun '((mlist simp) $%GAMMA) '((mlist simp) $%GAMMA))))
> #<FUNCTION (LAMBDA ($%GAMMA)) {C67005D}>
> (%i1) fn(1);
> (%o1)                         [.5772156649015329]
>
> Ooops.
>
> (%i2) :lisp (progn (setf (symbol-function '$FN) (coerce-float-fun '((mlist
> simp) $?) '((mlist simp) $?))))
> #<FUNCTION (LAMBDA ($?)) {C6DF05D}>
> (%i2) fn(1);
> (%o2)                                [1.0]
>
> Ok.
>
> Leo
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>