Solving a multivariate non-linear system of equations using Newton's method

I'm doing a report on the mathematics of GPS, and I have the following equations to solve for $x$, $y$, $z$ and $t_b$: I'm using Newton's method, with the Jacobian matrix of partial derivatives being as follows (by the power rule): I'm using an initial guess of: I've substituted in the initial guess to give what should be the first iteration using Newton's method: Which simplifies to give: However, this evaluates to: The correct first iteration however, as calculated by Maxima, is: Where have I gone wrong in this? I've self-taught myself most of this mathematics, and the fact that my iteration is so different from the correct one means I've probably done something completely wrong. Any help is appreciated.

• Using Octave (and your numbers above), I get the first iteration as $\approx (-18907, 21558, -23811, 0.567)^T$. The condition number of $J$ is fairly large ($\approx 6 \times 10^7$). As an aside, you should really start with numbers close to a solution, as the behaviour of Newton's method away from a zero can be quite wild. May 31 '15 at 6:56

This is not an answer but it is too long for a comment.

I repeated the calculations but set all numbers as rational. The results I obtained are $$x=-\frac{5092356599265080239}{142135566553125000}\approx-35.82746193$$ $$y=-\frac{51362394942211922323}{142135566553125000}\approx-361.3620165$$ $$z=-\frac{315241754157890072131}{7896420364062500}\approx-39922.10896$$ $$t=\frac{28067559633057906988253}{51100601628870148500000}\approx0.5492608450$$ which are identical to those Maxima gave.

Setting all numbers as decimals, I ended with the same results.

As copper.hat commented, the system is very badly conditioned ($J\approx 6\times 10^7$) and I wonder what could happen working with low precision. Could you precise this point ?

Just for your curiosity, the problem has two solutions $$\{x\to -41.7663,y\to -16.7878,z\to 6370.2,t\to -0.00319939\}\}$$ $$\{x\to -39.7413,y\to -134.276,z\to -9413.92,t\to 0.185171\}$$

Edit

If I may suggest, I should not use Newton for this kind of problem. Expand $f_1-f_2$, $f_1-f_3$, $f_1-f_3$; all squares disappear and you have $$f_1-f_2=-\frac{1312248584 }{5}t+6320 x-9580 y-3060 z+\frac{1172267578731}{62500}=0$$ $$f_1-f_3=-\frac{5536610464 }{5}t+4020 x+14180 y-13320 z+\frac{1276786201414}{15625}=0$$ $$f_1-f_4=-\frac{1509984672 }{5}t+7140 x-13860 y-3500 z+\frac{334297508818}{15625}=0$$ from which you can eliminate $y,z,t$ as linear functions of $x$; report these expressions in $f_1$ and you get a quadratic equation in $x$ $$x^2+\frac{1172085587221693444650100593 }{14380080939595292010312500}x+\frac{3729488115129024118430005986528113}{224688764 6811764376611328125000}=0$$ Solve it and back to $y,z,t$.

This is a general method for this kind of equations.

• What do you mean when you say you "set all numbers as rational"? Have I done everything right but just calculated it wrong? May 31 '15 at 10:41
• Also, as far as the other method goes, my report is only focusing on Newton's method. Thanks for letting me know about that though. :) May 31 '15 at 10:42
• First, could you tell me what is your machine precision ? If you don't know, compute the largest value of $n$ such that $1+2^{-n}>1$. Second, tell the person who will get your report that there are explicit solutions to the problem. Did you calculate wrong ? difficult to answer ! I transformed the decimal numbers to rational numbers in order to use illimited precision but, for my environment, it was not required. Cheers. May 31 '15 at 12:14