I need to solve a nonlinear system of equations that looks like this 1/(n_4)(c_4/(b_4R)−ln(1−x_1−x_2−x_3))=1/n_3(c_3/(b_3R)−ln(x_3))=1/n_2(c_2/(b_2R)−ln(x_2))=1/n_1(c_1/(b_1R)−ln(x_1))

bravere4g

bravere4g

Open question

2022-08-19

Solve numerical system of nonlinear equations?
I need to solve a nonlinear system of equations that looks like this
1 n 4 ( c 4 b 4 R ln ( 1 x 1 x 2 x 3 ) ) = 1 n 3 ( c 3 b 3 R ln ( x 3 ) ) = 1 n 2 ( c 2 b 2 R ln ( x 2 ) ) = 1 n 1 ( c 1 b 1 R ln ( x 1 ) )
The numerical equivalent of what i'm trying to solve right now is
4100 4100 / 297 1.987 ln ( x 1 ) = 6200 6200 / 303 1.987 ln ( x 2 ) = 7000 7000 / 327.5 1.987 ln ( x 3 ) = 4100 4100 / 404 1.987 ln ( 1 x 1 x 2 x 3 )
What algorithm should i use to solve this? If anyone can solve this, could you post how you did it? I tried using a multivariable newton's algorithm but my jacobian exploded

Answer & Explanation

penzionekta

penzionekta

Beginner2022-08-20Added 8 answers

Hint
I think that you could reduce your problem to a single equation of a single variable.
Suppose that you define
A = 1 n 4 ( c 4 b 4 R l n ( 1 x 1 x 2 x 3 ) )
So, you have
A = 1 n 3 ( c 3 b 3 R l n ( x 3 ) ) = 1 n 2 ( c 2 b 2 R l n ( x 2 ) ) = 1 n 1 ( c 1 b 1 R l n ( x 1 ) )
So x 1 , x 2 , x 3 can be expressed as a function of A
x i ( A ) = exp ( c i b i   R A   n i )
and you end with a single nonlinear equation A = f ( A ) where only A appears.
A = 1 n 4 ( c 4 b 4 R l n ( 1 x 1 ( A ) x 2 ( A ) x 3 ( A ) ) )
You could notice that your equation in A also write
F ( A ) = i = 1 i = 4 exp ( c i b i   R A   n i ) = 1
which, more than likely, would much better conditionned if written
G ( A ) = log ( i = 1 i = 4 exp ( c i b i   R A   n i ) ) = 0
Assuming all n i > 0, this shows that an upper bound of A corresponds to the maximum,over i, of the ( c i n i   b i   R ) terms. This gives a starting value for unknown A
Solve it for A (Newton method seems to be very appropriate) and go backwards to get x 1 , x 2 , x 3
In such a manner, you could notice that you could have as many equations as you could wish and apply the same procedure.
Using the data from your problem, we can easily find that the solution is A = 271.069 from which we get x 1 = 0.514479 , x 2 = 0.297290 , x 3 = 0.106527 which are your answers.
Grace Jefferson

Grace Jefferson

Beginner2022-08-21Added 2 answers

Ok i actually found the answer and i'm just gonna share it since no one has posted yet
x 1 = .514 , x 2 = .297 , x 3 = .107
Rearrange the equation for easier Jacobian
4100 / ( 1.987 297 ) l n ( x 1 ) 4100 / 1.987 = 6200 / ( 1.987 303 ) l n ( x 2 ) 6200 / 1.987 = 7000 / ( 1.987 327.5 ) l n ( x 3 ) 7000 / 1.987 = 4100 / ( 1.987 404 ) l n ( 1 x 1 x 2 x 3 ) 4100 / 1.987
Construct a system of equations in the form of f i ( x 1 , x 2 , x 3 ) = 0 for i = 1 , 2 , 3
f 1 ( x 1 , x 2 , x 3 ) = 4100 / ( 1.987 297 ) l n ( x 1 ) 4100 / 1.987 4100 / ( 1.987 404 ) l n ( 1 x 1 x 2 x 3 ) 4100 / 1.987
f 2 ( x 1 , x 2 , x 3 ) = 6200 / ( 1.987 303 ) l n ( x 2 ) 6200 / 1.987 4100 / ( 1.987 404 ) l n ( 1 x 1 x 2 x 3 ) 4100 / 1.987
f 3 ( x 1 , x 2 , x 3 ) = 7000 / ( 1.987 327.5 ) l n ( x 3 ) 7000 / 1.987 4100 / ( 1.987 404 ) l n ( 1 x 1 x 2 x 3 ) 4100 / 1.987
F ( X ) = [ f 1 ( x 1 , x 2 , x 3 ) , f 2 ( x 1 , x 2 , x 3 ) , f 3 ( x 1 , x 2 , x 3 ) ] T
X = [ x 1 , x 2 , x 3 ] T
Construct Jacobian for the system
F ( X ) = [ f 1 x 1 , f 1 x 2 , f 1 x 3 ; f 2 x 1 , f 2 x 2 , f 2 x 3 ; f 3 x 1 , f 3 x 2 , f 3 x 3 ]
Solve F ( X ) = F ( X ) H for H using Gaussian elimination
Update X by using X ( k + 1 ) = X ( k ) + H ( k ) , in this case using X = [ .01 , .01 , .01 ] T
Repeat until reached acceptable error bound
My jacobian exploded because i didn't give a good initial guess, but then i guessed slightly lower and everything worked.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?