next up previous
Next: About this document Up: Implementation of Newton's Previous: Implementation of Newton's

Laboratory

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:

  1. Down load the code lab9.cpp and the makefile.
  2. Write a C++ function to compute the value of
  3. Augment this code for ADOL-C. Remember that is constant and is the independent variable.
  4. Make the executable by typing 'make' on the command line, and run it by typing 'lab9'
  5. 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.
  6. 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
  7. Write the values of , and to the files x.dat, y.dat, and f.dat.
  8. 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.
  9. Create a file lab9.html which has links to lab9.cpp, lab9.jpg. Add a link to your class home page to lab9.html.
  10. Hand in lab9.cpp and put a link to it on your home page


next up previous
Next: About this document Up: Implementation of Newton's Previous: Implementation of Newton's


J. C. Diaz