help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Precision of fsolve


From: Daniel Tourde
Subject: Re: Precision of fsolve
Date: Wed, 23 Sep 1998 09:17:55 +0200

> | I am using the function fsolve like this :
> |
> |   y(1) = 12*((x(3)*x(1))/2)/E - nlcoef(3);
> |   y(2) = 12*((x(3)*x(2)+x(1)*x(4))/6)/E - nlcoef(4);
> |   y(3) = 12*((P*x(3)/2+x(4)*x(2)+x(1)*x(5))/12)/E - nlcoef(5);
> |   y(4) = 12*((P*x(4)/2+x(5)*x(2))/20)/E - nlcoef(6);
> |   y(5) = 12*((P*x(5))/60)/E - nlcoef(7);
> |
> |
> | Some of my nlcoef values are very small (between 1e-7 and 1e-10) and it
> | happens that the solutions send back by fsolve can be wrong due to
> | rounding and precision errors.
> |
> | My question is the following :
> |
> | How can I increase the precision of fsolve, how can I lower the
> | admissible error ?
> 
> Try fsolve_options:
> 
>   octave:1> fsolve_options
> 
>   *** fsolve_options:
> 
>   fsolve_options (KEYWORD, VALUE)
> 
>   Set or show options for fsolve.  Keywords may be abbreviated
>   to the shortest match.
> 
>   Options for fsolve include:
> 
>     keyword                                  value
>     -------                                  -----
> 
>     tolerance                                1.49012e-08
> 
>   octave:2> fsolve_options ("tol", 1e-12)
>   octave:3> fsolve_options ("tol")
>   ans =  1.0000e-12


Thanks.

However, I did a test. If you take the following values for nlcoef :

nlcoef =

    4.9790e-07
    4.4823e-06
    3.5202e-05
    1.8460e-04
   -1.7591e-05
    5.5634e-07
   -5.8684e-09


Then it gives as an answer of the system with fsolve :

polcoef = fsolve("aerea_pl_nlsys6",[1,2,3,4,5]);

polcoef =

    1.8295e+02
   -3.8343e+00
    6.7378e-03
    1.0610e-01
   -1.8051e-02


with E = 210000 and P = 4.


If then I recompute the values of 


12*((polcoef(3)*polcoef(1))/2)/E 
12*((polcoef(3)*polcoef(2)+polcoef(1)*polcoef(4))/6)/E 
12*((P*polcoef(3)/2+polcoef(4)*polcoef(2)+polcoef(1)*polcoef(5))/12)/E
12*((P*polcoef(4)/2+polcoef(5)*polcoef(2))/20)/E  
12*((P*polcoef(5))/60)/E   


I obtain the following values :
ans =  3.5220e-05
ans = 0.00018461
ans =  -1.7599e-05
ans =  8.0401e-07
ans =  -6.8765e-08

It's quite clear that the last two ones are wrong. What can I do about
this ? Is it simply due to precision of the computation and then, how
can I improve it ?

Best regards


                                Daniel
-- 
*********************************************************************
Daniel TOURDE                                   E-mail : address@hidden
The Aeronautical Research Institute of Sweden   Tel : +46 8 634 13 44
P.O. Box 11021 S-161 11 BROMMA, Sweden          Fax : +46 8  25 34 81
*********************************************************************



reply via email to

[Prev in Thread] Current Thread [Next in Thread]