# Thread: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c,s a

1. ## Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c,s a

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$.

$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. ## Re: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c

You need to use the multivariate Newton-Raphson method, which involves the Jacobian.

$\displaystyle J(\vec{x}) = \begin{pmatrix}\tfrac{\partial f}{\partial c} & \tfrac{\partial f}{\partial s} & \tfrac{\partial f}{\partial q} \\ \tfrac{\partial g}{\partial c} & \tfrac{\partial g}{\partial s} & \tfrac{\partial g}{\partial q} \\ \tfrac{\partial h}{\partial c} & \tfrac{\partial h}{\partial s} & \tfrac{\partial h}{\partial q}\end{pmatrix}\begin{pmatrix}c \\ s \\ q\end{pmatrix}$

So, let's find estimates for $\displaystyle c,s,q$. $\displaystyle g(0,0,0) = h(0,0,0) = 0$ and $\displaystyle f(0,0,0) = -0.00114532$, so that is a good estimate to start with.

Then, $\displaystyle \vec{x_1} = \begin{pmatrix}c_1 \\ s_1 \\ q_1\end{pmatrix} = \begin{pmatrix}0 \\ 0 \\ 0\end{pmatrix}$

$\displaystyle J(\vec{x_1}) = \begin{pmatrix}6.7\cdot 10^8 + 1.2\cdot 10^8 s_1 + 2.6\cdot (1-q_1)\cdot 10^8 & 1.2\cdot 10^8 c_1 & -2.6\cdot 10^8 c_1 \\ 2.001(s_1-1) & 2.001c_1 + 835(1-q_1) & -835s_1 \\ 5.98\cdot 10^{10}(q_1-1) & 0 & 2.73+5.95\cdot 10^{10}c_1\end{pmatrix}$

Plugging in $\displaystyle \vec{x_1} = \begin{pmatrix}0 \\ 0 \\ 0\end{pmatrix}$ gives:

$\displaystyle J(\vec{x_1}) = \begin{pmatrix}9.3\cdot 10^8 & 0 & 0 \\ -2.001 & 835 & 0 \\ -5.98\cdot 10^{10} & 0 & 2.73\end{pmatrix}$

Now, to apply the Newton-Raphson method, we want:

$\displaystyle \vec{x_2} = \vec{x_1} - J^{-1}(\vec{x_1})\begin{pmatrix}f(c_1,s_1,q_1) \\ g(c_1,s_1,q_1) \\ h(c_1,s_1,q_1)\end{pmatrix}$

So, you need to take the inverse of the matrix.

$\displaystyle J^{-1}(\vec{x_1}) = \begin{pmatrix}1.07527\cdot 10^{-9} & 0 & 0 \\ 2.57678\cdot 10^{-12} & 0.0011976 & -6.31098\cdot 10^{-30} \\ 23.5535 & 0 & 0.3663\end{pmatrix}$

Then, you have:

$\displaystyle \vec{x_2} = \begin{pmatrix}0 \\ 0 \\ 0\end{pmatrix} - J^{-1}(\vec{x_1})\begin{pmatrix}f(0,0,0) \\ g(0,0,0) \\ h(0,0,0)\end{pmatrix} = \begin{pmatrix}1.23153\cdot 10^{-12} \\ 2.95124\cdot 10^{-15} \\ 0.0269763\end{pmatrix}$

Next,

\displaystyle \begin{align*}J(\vec{x_2}) & = \begin{pmatrix}6.7\cdot 10^8 + 1.2\cdot 10^8 s_2 + 2.6\cdot (1-q_2)\cdot 10^8 & 1.2\cdot 10^8 c_2 & -2.6\cdot 10^8 c_2 \\ 2.001(s_2-1) & 2.001c_2 + 835(1-q_2) & -835s_2 \\ 5.98\cdot 10^{10}(q_2-1) & 0 & 2.73+5.95\cdot 10^{10}c_2\end{pmatrix} \\ & = \begin{pmatrix}9.229861620000003541488 \cdot 10^8 & 0.0001477836 & -0.0003201978 \\ -2.00099999999999409456876 & 812.47478950000246429153 & -1.02832755 \cdot 10^-9 \\ -58186817260 & 0 & 2.803276035\end{pmatrix}\end{align*}

Continuing:

\displaystyle \begin{align*}\vec{x_3} & = \vec{x_2} - J^{-1}(\vec{x_2}) \begin{pmatrix}f(\vec{x_2}) \\ g(\vec{x_2}) \\ h(\vec{x_2})\end{pmatrix} \\ & = \begin{pmatrix}1.23153\cdot 10^{-12} \\ 2.95124\cdot 10^{-15} \\ 0.0269763\end{pmatrix} - \begin{pmatrix}1.091298102077596\cdot 10^{-9} & -1.9849965104448836\cdot 10^{-16} & 1.2465103224457146\cdot 10^{-13} \\ 3.1357436198406283\cdot 10^{-11} & 0.00123081 & 4.550796088382769\cdot 10^{-13} \\ 22.6518 & -4.120201784373836\cdot 10^{-6} & 0.359313\end{pmatrix} \begin{pmatrix}-8.634851912139563855128336 \cdot 10^{-6} \\ -6.64834322360127272842650028 \cdot 10^{-14} \\ 0.0019864879397922\end{pmatrix} \\ & = \begin{pmatrix}1.241200815275675509811379607179147 675196376023\cdot 10^{-12} \\ 2.399825136545420764152907657559927633735088 \cdot 10^{-15} \\ 0.026458123997432847940008439911288151623283806417 6345\end{pmatrix}\end{align*}

3. ## Re: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c

Thank you very much sir. did you use any mathematical software like mat lab, Fortran, maple. or did you solve it by hand?

4. ## Re: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c

I did a search for multivariate Newton-Raphson method. That showed me how the method works. I calculated the Jacobian by hand, and used Wolframalpha to do the calculations of the matrix operations (I did not check any of my work, so I may have made errors).

5. ## Re: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c

Sir, i have a one questions for you. the values of vector x2 and x3 seems very much similar. that means can i take x2 vector values as my final answer in terms of c,s and q so that i don't have to do extra steps to calculate the values of vector x3?

6. ## Re: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c

Originally Posted by grandy
Sir, i have a one questions for you. the values of vector x2 and x3 seems very much similar. that means can i take x2 vector values as my final answer in terms of c,s and q so that i don't have to do extra steps to calculate the values of vector x3?
I am not your instructor, so I cannot answer that. I would think your instructor would want at least two iterations. The value in the third term is changing greatly from $\displaystyle x_2$ to $\displaystyle x_3$ (relative to the other two values).

7. ## Re: Solve non-linear equations of 3 variables using Newton-Raphson Method iterms of c

I ask with my lecturer and he said i can use the vector x3 as my final values of c,s and q. thank you sir.