[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-linear ecuation... -Reply
From: |
Gerrit Visser |
Subject: |
Re: Non-linear ecuation... -Reply |
Date: |
Fri, 24 Mar 2000 07:25:35 +0200 |
I've played around with the equations, and I can see why octave can't
solve it. Some of the variables have a very large influence on the
equations. At a guess, some of the gradients must be in the 10^9 region
or higher. To see what I mean, set up a "cost" function which has the
following form:
Cost = abs(first equation) + abs(second equation) + ... + abs(ninth
equation)
where the equation I'm referring to is the equation without the "=0" at the
end.
Now set all variables to 1 (as an example), except for f. Let F vary from
-10 to 10 (ie. linspace(-10,10,1000)). Plot the Cost as a function of F.
Then, in the region of the "minimum" shown on the plot, zoom F (ie.
linspace(0.002,0.002,1000) or whatever). Again plot the function. Zoom
again and again, until the gradient doesn't look as if there can be any
more surprises hidden there. What happens in this region is that it looks
like a minimum when you look at it at first. By zooming repeatedly, one
sees that it is in fact two local minima and a maxima very close together
(I think it was of the order of 10^-9 from each other!)
(This also happens for some of the other variables.)
Because of the local minima and maxima so close to each other, any
numerical method would find it very difficult to converge. Using a good
optimisation routine to minimise the cost function is just about the only
method that MIGHT work, and even then you might not find the global
minimum. Just remember that the accuracy on variables have to be more
than 10 decimal places, which complicates the problem for the
optimisation routine. (You might give the routine a bit of help by finding
the gradient of the function analytically)
I have used Matlab in order to try and solve the equations, and couldn't
get the cost function below 1.5 using the fmins minimisation algorithm .I
used multiple restarts, taking the output of the first iteration, and
disturbing some parameter and then using that as the input for the next
iteration.
I have a lot of respect for the people who has solved the problem. It is
most definitely not a trivial one!!
Gerrit
>>> Dirk Laurie <address@hidden> 23/March/2000 05:59pm >>>
Cederik skryf:
>
> I have the next set of nine non-linear ecuations:
>
> ln(a)-ln(f)+i+4g+(19720/8314)=0
> ln(b)-ln(f)+2g+h-(192420/8314)=0
> ln(c)-ln(f)+h+i-(200240/8314)=0
> ln(d)-ln(f)+2h+i-(395790/8314)=0
> ln(e)-ln(f)+2g=0
> a+c+d-2=0
> 4a+2b+2e-14=0
> b+c+2d-3=0
> a+b+c+d+e-f=0
>
> Where:
> x[1]=a
> x[2]=b
> x[3]=c
> x[4]=d
> x[5]=e
> x[6]=f
> x[7]=g
> x[8]=h
> x[9]=i
>
> Octave can't solve it... (non-convergent), but in fact i know that set of
> ecuations has solution. Because is a Book example.
> Octave can solve it if i put the initial x's [a,b,c,d,e,f,g,h,i] as the
> exactly solutions. But that way isn't usefull for me...
> Any sugestions?
>
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------