Next: About this document
Up: Implementation of Newton's
Previous: Implementation of Newton's
This lab uses ADOL-C to compute the necessary derivatives for
Newton's method.
Consider solving for
for a given value of phi, from the equation

Newton's method solves equations of the form
.
For each value of
, held fixed, then

The function f is actually a function of two variables
,
but
is held fixed while
is being determined.
So it should correctly be written as:

-
Down load the code lab9.cpp
and the makefile.
-
Write a C++ function to compute the value of
-
Augment this code for ADOL-C. Remember
that
is constant and
is the independent variable.
-
Make the executable by typing 'make' on the command line, and run it by
typing 'lab9'
-
Add code to the main program to verify the computed solution--i.e.,
compute
using the value of
found by Newton's method. If it
worked, the value should be very nearly zero.
-
Modify your code to compute the value of
for 100 evenly spaced
values of
on the interval [1,10].
Use the previous value for
as the approximate value for
-
Write the values of
,
and
to
the files x.dat, y.dat, and f.dat.
-
Using Matlab, load and plot y versus x
and y versus f(x,y).
Use xv to capture the plot and save it as lab9.jpg.
-
Create a file lab9.html which has links to
lab9.cpp, lab9.jpg.
Add a link to your class home page to lab9.html.
-
Hand in lab9.cpp and put a link to it on your home page
Next: About this document
Up: Implementation of Newton's
Previous: Implementation of Newton's
J. C. Diaz