help-octave
[Top][All Lists]

## Re: Use of fsolve

 From: Mario Storti Subject: Re: Use of fsolve Date: Thu, 1 Oct 1998 18:46:43 +0200

```>>>>> On Thu, 01 Oct 1998 18:08:46 +0200,

> Hello,
> I would like to use the fsolve solution for solving non-linear equations
> where sometimes, solutions or constant are very small:

>   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);

> Where some of my nlcoef values are very small (between 1e-7 and 1e-10).
> It happens that the solutions given by fsolve can be wrong due to
> rounding and precision errors.

> ................. < lines snipped here > ..............

Hi,

Perhaps you can get better values by rescaling the problem. If lambda is
a typical value for sqrt(nlcoef(k)*E), then solving the rescaled
system

> yy(1) = 12*((xx(3)*xx(1))/2) - nlcoef(3)*E/lambda^2;
> yy(2) = 12*((xx(3)*xx(2)+xx(1)*xx(4))/6) - nlcoef(4)*E/lambda^2;
> yy(3) = 12*((PP*xx(3)/2+xx(4)*xx(2)+xx(1)*xx(5))/12) - nlcoef(5)*E/lambda^2;
> yy(4) = 12*((PP*xx(4)/2+xx(5)*xx(2))/20) - nlcoef(6)*E/lambda^2;
> yy(5) = 12*((PP*xx(5))/60) - nlcoef(7)*E/lambda^2;

with PP=P/lambda perhaps is better scaled, since the
nlcoef(k)/lambda^2 are closer to one. After, you can recover the x
values from

octave> x=xx*lambda;

Are E and P also small?

Hope this helps,

Mario

--
========================================
Mario Storti
Centro Internacional de Metodos Computacionales en Ingenieria
INTEC (CONICET-UNL)
Guemes 3450, 3000 Santa Fe
Argentina
Tel: +54 42 55.91.75
Fax: +54 42 55.09.44
www: http://venus.unl.edu.ar/gtm-eng.html