Non linear solver

I am trying to solve a system of 8 non linear equations using Newton-Raphson method. But It does not seem to work. I have used LAPACK. But, no luck. Is there any better ways solve them?

Try looking for MINPACK hybrd1.f, and welcome.

C05QSF if you have access to NAG Library.

You could also consider: GitHub - jacobwilliams/nlesolver-fortran: Nonlinear Equation Solver with Modern Fortran

Disclaimer: I have not used it.

This can be a very difficult problem. I have had success using homotopy methods. Many years ago I used HOMPACK90. We then rolled our own simplified version optimized for our problem.

The basic idea is you have a set of non-linear equations G(x)=0. You parameterize the system with a (perhaps artificial) parameter λ to give G(x,λ)=0, where G(x,λ)=0 is easier to solve when λ=0. You solve the equation for the initial loading λ=0 then use previous solutions as the starting point as you increment λ to the final value.

See:

If I had to solve a similar problem today, I would likely start with @jacobwilliamsnlesolver-fortran, already mentioned above.

Back in the day, I had good experience with dnsq, netlib.org/slatec/src/dnsq.f.

There are many possible reasons for failure: bad initial condition, poor algorithm, incorrect implementation (i.e., bug), etc. If not yet done, I suggest you start with a simple problem (N=1 or 2) for which you know the solution and them move to the actual problem.

2 Likes

Chemical process simulations solve large systems of non-linear algebraic equations mainly in one of two ways: serial-cyclic and ‘equation-orientated’ solves. The first may not be applicable to you because it works best for particular types of coupling, e. g. flows of information between process units, reactors, seoaratorsetc etc.
The second group of methods are conceptually easy, start with a guess, linearise the equations about that guess, solve the linear equations (BLAS?}), relinearise, resolve, repeat to convergence.
But, as mentioned above, good initial guesses help enormously, and the solution reached may not be physically or chemically realistic.
Good luck