# Thread: Solve non linear system

1. Hi,
I have to solve a non linear system and I have tried with Newton method but unfortunately some equations tend to an asymptote, thus the Jacobian matrix becames singular because al least one row becames zero.
Is there a different method that can resolve this problem ?
thanks

2.

3. There are a few problems that can arise from the use of Newtons Method. Are you using the most basic form of Newton's Method? Can you post the equations?

4. yes I'm using the most basic form of the Newton's Method. The system of equations is very complicated. This is a part of the system:

%solid energy Ts=x(i)
F{i} = @(x) vs*Cs*(x(i)*x(i+g) - x0(i)*x0(i+g)) - h*S*(1-e)*(x(i+2*g)-x(i))*lx;

%solid mass Ros=x(i+g)
F{i+g} = @(x) vs*(x(i+g)-x0(i+g)) + (((k1(i)+k2(i))*x(i+7*g)) + (x(i+4*g)*po2(i)*k0(i))+ (km(i)*Cws(i)*(x(i+5*g)/RoH2O0)*(1-e)*S) )*lx; %

%gas energy Tg=x(i+2g)
F{i+2*g} = @(x) vg*Cg*(x(i+3*g)*x(i+2*g) - Tg0*Rog0) + h*S*(1-e)*(x(i+2*g)-x(i))*ly;

%gas mass Ros=x(i+3g)
F{i+3*g} = @(x) vg*(x(i+3*g)-Rog0) - ((k1(i)+k2(i))*x(i+7*g))*ly ;

%char mass Rochar=x(i+4g)
F{i+4*g} = @(x) vs*(x(i+4*g)-x0(i+4*g)) - k3(i)*x(i+7*g)*lx;

%H2O (evaporation) RoH2O=x(i+5g)
F{i+5*g} = @(x) vs*(x(i+5*g)-x0(i+5*g)) - (km(i)*Cws(i)*(x(i+5*g)/RoH2O0)*(1-e)*S)*lx;

%ash mass Roash=x(i+6g)
F{i+6*g} = @(x) vs*(x(i+6*g)-x0(i+6*g)) - 0;

%virgin biomass mass Rovb=x(i+7g)
F{i+7*g} = @(x) vs*(x(i+7*g)-x0(i+7*g)) + ((k1(i)+k2(i)+k3(i))*x(i+7*g))*lx;

5. Interesting set of equations. I was hoping to take a crack at solving it myself but it might be quicker to just tell you what i was going to try.

Something to consider when using Newtons Method, in its most basic form, is that given an arbitrary initial estimate the method won't always converge to the solution. However the method can be extended by using a procedure known as simple line searching. (at least that's what i know it as) This involves something along the lines of:

Find , where
while:
repeat

when then keep the value and repeat the whole process until desired accuracy is obtained.

The idea behind doing this is that if the method is converging to the root then the residual norm as . So we cut out any steps that lead to larger errors, this may avoid the point at which the Jacobian is singular.

Alternatively, in the event that you have defined the Jacobian yourself you may want to try using a finite difference approximation to the Jacobian (formula below) to rule out differentiation/algebra errors. Note that having to do this after each iteration results in a lot of extra computations so try line searching first.

6. Hi Prof.
thanks for your reply and sorry for the delay in my reply but I was out for work in these days.
I'll try the simple line searching method in these day and I'll let you know.
Thanks a lot