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

Carlos Eduardo Celia de Lima carlosedlima at gmail.com
Thu Feb 25 20:06:28 CET 2010


Samuel,

Thanks for your reply.

If I understood you correctly, I did the change as you suggested but it
still crashes. You were right, my function u(t) returned a vector, and I
picked the correct value inside the other function.
Now, my function u(t) returns the exact value for u(t), a scalar.
I can simulate all the functions normally with no error, but whenever I try
to optimize it with nelder_mead, Sci-lab crashes. Unfortunately, it's too
fast for me to see the error message. Is there a log file that I can check?
Since the file is pretty small, I attached the file.

Thank you.
Carlos

On Thu, Feb 25, 2010 at 12:59 PM, Samuel Gougeon <
Samuel.Gougeon at univ-lemans.fr> wrote:

>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100225/13c9a653/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function_ode.sce
Type: application/octet-stream
Size: 2080 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20100225/13c9a653/attachment.obj>


More information about the users mailing list