[scilab-Users] the strangest bug I ever experienced

François Vogel fvogelnew1 at free.fr
Thu Aug 11 00:17:28 CEST 2011


I would suggest you start here:
   http://bugzilla.scilab.org/show_bug.cgi?id=3835

More specifically, look at this:

-->[4*X(7) + X(2) - 1]
  ans  =

   - 0.3

-->[4*X(7) + X(2) -1]
  ans  =

     0.7  - 1.

(see the difference? the space was removed between the minus sign and 
the 1)

I'm not saying this behavior is wrong or fine, just explaining what 
you're seeing.

F.


Peter Hinow said on 10/08/2011 22:09:
> Dear fellows,
>
> can somebody please try to run the little code below? The function fff should take a 7-dimensional vector and return another 7-dimensional vector,
> namely
>    - 0.4  - 0.3   - 0.5    - 0.28  - 0.07  - 0.07  - 0.0796 .
> But what it does it returns a 9-dimensional vector
>    - 0.4  - 0.3    0.5  - 1.    0.72  - 1.  - 0.07  - 0.07  - 0.0796
> where for example -0.5 is written as "0.5 - 1". Of course then the fsolve does not work.
> What could be the cause of this?
> Thank you and best regards,
>         Peter
>
> function y=fff(X) // X = [d1 h1 d2 h2 d3 h3 r]
>    y=[2*X(7) + X(1) + 2*X(3)-1, ..
>       4*X(7) + X(2) - 1, ..
>       2*X(7) + X(4) + X(6) -1, ..
>       4*X(7) + X(3) + X(5) -1, ..
>       X(1)^2+X(2)^2-4*X(7)^2, ..
>       X(3)^2+X(4)^2-4*X(7)^2, ..
>       X(5)^2+X(6)^2-4*X(7)^2];
> endfunction
> X = [0.1, 0.1, 0.1, 0.1, 0.02, 0.1, 0.15];
> fff(X)
>
> xx = fsolve([0.1, 0.1, 0.1, 0.1, 0.02, 0.1, 0.15],fff);
> d1 = xx(1); h1 = xx(2); d2 = xx(3); h2 = xx(4);
> d3 = xx(5); h3 = xx(6); r = xx(7)
>



More information about the users mailing list