# Solve nonlinear equation using newton raplson method

1. Jun 3, 2014

### wel

The three non-linear equations are given by

c[(6.7 * 10^8) + (1.2 * 10^8)s+(1-q)(2.6*10^8)]-0.00114532=0

s[2.001 *c + 835(1-q)]-2.001*c =0

q[2.73 + (5.98*10^{10})c]-(5.98 *10^{10})c =0

Using the Newton-Raphson Method solve these equations in terms of $c,s$ and $q$.

=> It is really difficult question for me because i don't know very much about the Newton-Raphson Method and also these non-linear equations contain 3 variables.

I have try by applying the newton-Raphson method to each equations:-

f(c,s,q)=0= c[(6.7 * 10^8) + (1.2 * 10^8)s+(1-q)(2.6*10^8)]-0.00114532

g(c,s,q)=0= s[2.001 *c + 835(1-q)]-2.001*c

h(c,s,q)=0= q[2.73 + (5.98*10^{10})c]-(5.98 *10^{10})c

now i guess i need to work out $f'(c,s,q), g'(c,s,q), h'(c,s,q)$ but i dont know how?

and after working out $f'(c,s,q), g'(c,s,q), h'(c,s,q)$ . After that i think i need to use newton-raphson iteration:

$c_{n+1}= c_n - \frac{f(c,s,q)}{f'(c,s,q)}$

but the $f(c,s,q)$ and $f'(c,s,q)$ contains the $s$ and $q$.

Similarly, for

$s_{n+1}= s_n - \frac{g(c,s,q)}{g'(c,s,q)}$

will have $g(c,s,q)$ and $g'(c,s,q)$ containing the $c$ and $q[/itex[]. [itex]q_{n+1}= q_n - \frac{h(c,s,q)}{h'(c,s,q)}$

will have $h(c,s,q)$ and $h'(c,s,q)$ containing the $c$.

so am i not sure what to do please help me. to find the values of $c,s,q$.

2. Jun 3, 2014

### LCKurtz

Perhaps you should read how the Newton Raphson method works for multi variable problems. Here's one link:

http://fourier.eng.hmc.edu/e161/lectures/ica/node13.html

[Edit, added] Why don't you simplify the equations a bit first? Also, are you using something like Maple or Mathematica? If so, why not let the package solve the system? I'm not a computer scientist, but I would be wary of a system with huge numbers and little bitty numbers.

Last edited: Jun 3, 2014
3. Jun 4, 2014

### wel

I need to calculate by hand without any mathematical software. that's the reason i am having difficulty. please help me.

4. Jun 4, 2014

### Ray Vickson

'
You have already been told what you need to do; have you tried it?

Personally, I would be skeptical about the use of a standard method on your problem as it stands, because your problem is very badly scaled. You can get a much better-behaved system by using scaled variables: let $s = 10^{-8} s'$ and $c = 10^{-9} c'$. Then the system becomes
$$.93 c'-.26 c' q-.00114532 +.7065655170 \times 10^{-11} c' s' = 0\\ 835 s'-835 s'q-.2001 c' + .2001 \times 10^{-8} c' s'= 0 \\ 2.73 q+59.8 c' q-59.8 c' = 0$$
In this new system the bad scaling is limited to the terms in $c' s'$ in the first two equations. It is very probable that much better accuracy can be obtained from solving the new system.

5. Jun 4, 2014

### LCKurtz

@Ray: Interestingly enough, Maple will give an answer to that system. Then if you solve the same system without the $c's'$ terms, you get the same answer. Not too surprising, I guess. I'm thinking those two terms would also raise havoc when calculating the inverse of the Jacobian for Newton-Rhapson.

6. Jun 4, 2014

### Ray Vickson

Yes, I did everything in Maple.

If you take the original system but first convert the numbers from floats to rationals, the maple command 'solve' produces a solution in terms of some 'Root_Of' expressions; then applying the 'allvalues' command produces 4 symbolic solutions, but which are huge, multi-page monsters that involve enormous rational numbers, etc. Applying 'evalf[n]' for n-digit evaluation produces two complex and two real solutions. Applying 'solve' on the original system, with no rational conversion, produces essentially the same 4 floating-point solutions. Using 'fsolve' instead produces one of the 4 solutions, and if I am not mistaken, is done essentially by implementing Newton's method. I suspect that the implementation was done carefully enough to get around bad scaling, perhaps by using a self-scaling version of Newton.

7. Jun 5, 2014

### LCKurtz

@wel: Where did this problem come from? If it is just a problem where you are supposed to learn how Newton-Rhapson method works, then it is a ridiculous teaching example. On the other hand, if you are studying numerical analysis and learning about how to handle systems that aren't well behaved, it would be a more appropriate problem. Please give us the context in which this problem arose.