$29
Note: Please use Matlab, or a public domain approximation to it in this assignment. The code must compile on one of the lab machines with your instructions. Document your code thoroughly!
Instructions
1.Write a Newton’s method code to solve the pair of equations given by
f1 ( x1 , x2 ) = x13 + x2 −1
f 2 ( x1 , x2 ) = x2 3 − x1 +1
Use appropriate criteria to measure convergence and to terminate the iteration. Use
starting values of x1 = 1.0, x2 = 0.1 .Perform a few experiments with different starting values
and count the number of iterations it takes to get to convergence.
2. Repeat the process with the notoriously difficult system of equations given by
f1 ( x1 , x2 ) = x12 + x22 − 2
f
2
( x
, x ) = e ( x1 −1)
− x2
− 2
1
2
2
As this process is problematic try an alternate approach by using the top equation to eliminate x2 from the bottom equation. Find the solution either by using. Newton’s method
for a single equation or by guesswork.
Go back to the full case and use values x1 = 1.1, x2 = 1.1, x1 = 2.0, x2 = 0.5 , x1 = 3.0, x2 = 5.0
as starting values. Does this help. Does the matlab routine fsolve compute a solution in these cases?
1
LORAN LOng RAnge Navigation calculates the position of a boat at sea using signals from fixed transmitters. From the time differences of the incoming signals the boat obtains differences of distances to the transmitters. This leads to two equations that represent the distances such as;
f ( x , x ) =
x
2
−
x2
−1
1
2
1
1
2
186 2
300 2 −1862
f 2
( x1
, x2 ) =
( x
− 500) 2
−
( x
− 300)2
−1
2
1
279 2
500 2 − 2792
Implement a Newton solver for this system and define the Jacobian matrix.
Using (400,400) as a starting point and run the solution for 25 iterations. This is enough to get to convergence. Repeat for all starting values from (401, 401) to (600,600) in increments of 1 (402,402) etc . Which values does the method converge to for which starting values and how many different solutions are there?
What to turn in
For these assignments, we expect both SOURCE CODE and a written REPORT be uploaded as a zip or tarball file to Canvas.
Source code for all programs that you write, thoroughly documented.
o Include a README file describing how to compile and run your code.
Your report should be in PDF format and should stand on its own.
o It should describe the methods used, explain your results and contain figures. o It should also answer any questions asked above.
o It should cite any sources used for information, including source code. o It should list all of your collaborators.
This homework is due on April 4 by 11:59 pm. If you don't understand these directions, please send questions to the TAs or come to see one of the TAs or the instructor during office hours well in advance of the due date.
2