[scilab-Users] Scilab crashes with the use of neldermead function

Samuel Gougeon Samuel.Gougeon at univ-lemans.fr
Thu Feb 25 18:59:09 CET 2010


Carlos Eduardo Celia de Lima <carlosedlima at gmail.com> a écrit :

> Hi,
>
> I am trying to run an optimization using Scilab but it crashes when I
> execute it.

Hello Carlos,
Just having a look at your script and embedded function definitions,
some questions arise, that may be of concern for the crash:
* In function xdot=f(t,x,u), you are using z=u(t)
   while latter in the script, you define function ut=u(t,alpha).
   I guess that z=u(t) adresses the u passed as an input
   parameter of f(), and not the function u(). But this is not obvious,
   and there may be a confusion.
* Same thing inside function ut=u(t,alpha) : with
   u(1)=alpha(1);  // line 55)
   u((c*i)+1)=alpha(i+1); // line 57
   While both lines could be interpreted as recursive calls to the
   _function_ u() only by a not enough clever parser (since u() is here
   Left Hand Side argument), the next case on line 63 in stranger:
   u(i+1)=u(i)+ (((time0(i+1)-time0(i))/(time0(w+2)-time0(i)))*(u(w+2)-u(i)));
   where u(i) and u(w+2) may be understood as recursive calls to the  
function u().
   Finally, line 66:
   ut=u'; // Whether the parser understands u as the function, then transposing
   a function could be an issue for it.

I don't know if the confusion between both u() as a function and as a vector
is the issue. Nevertheless, it could be worthwhile to rename one of both,
and then try again.

HTH
Samuel




More information about the users mailing list