From 6e109623ad724ad4a78871fcba90ae3fef495c3a Mon Sep 17 00:00:00 2001 From: "Ryan C. Cooper" Date: Tue, 7 Feb 2017 20:47:05 -0500 Subject: [PATCH] added HW3 --- HW3/README.html | 60 ------------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 HW3/README.html diff --git a/HW3/README.html b/HW3/README.html deleted file mode 100644 index 950e6d3..0000000 --- a/HW3/README.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - -

Homework #3

-

due 2/15/17 by 11:59pm

-
    -
  1. Create a new github repository called ‘roots_and_optimization’.

    -
      -
    1. Add rcc02007 and pez16103 as collaborators.

    2. -
    3. Clone the repository to your computer.

    4. -
    5. Copy your projectile.m function into the ‘roots_and_optimization’ folder. Disable the plotting routine for the solvers

    6. -
    7. Use the four solvers falsepos.m, incsearch.m, newtraph.m and mod_secant.m to solve for the angle needed to reach h=1.72, with an initial speed of 1.5 m/s.

    8. -
    9. The newtraph.m function needs a derivative, calculate the derivative of your function with respect to theta, dprojectile_dtheta.m. This function should output d(h)/d(theta).

    10. -
    11. In your README.md file, you will document the following under the heading # Homework #3:

      -
        -
      1. Compare the number of iterations that each function needed to reach an accuracy of 0.00001%. Include a table in your README.md with:
      2. -
      -
      | solver | initial guess(es) | ea | number of iterations|
      -| --- | --- | --- | --- |
      -|falsepos   |  |  |  |
      -|incsearch  |  |  |  |
      -|newtraph   |  |  |  |
      -|mod_secant |  |  |  |
      -
        -
      1. Compare the convergence of the 4 methods. Plot the approximate error vs the number of iterations that the solver has calculated. Save the plot as convergence.png and display the plot in your README.md with:
      2. -
      -

      ![Plot of convergence for four numerical solvers.](convergence.png)

      -
        -
      1. In the README.md provide a description of the files used to create the table and the convergence plot.
      2. -
    12. -
  2. -
  3. The Newton-Raphson method and the modified secant method do not always converge to a solution. One simple example is the function f(x) = x*exp(-x^2). The root is at 0, but using the numerical solvers, newtraph.m and mod_secant.m, there are certain initial guesses that do not converge.

    -
      -
    1. Calculate the first 5 iterations for the Newton-Raphson method with an initial guess of x_i=2.

    2. -
    3. Add the results to a table in the README.md with:

    4. -
    -
    ### divergence of Newton-Raphson method
    -
    -| iteration | x_i | approx error |
    -| --- | --- | --- |
    -| 0 | 2 | n/a |
    -| 1 |   |     |
    -| 2 |   |     |
    -| 3 |   |     |
    -| 4 |   |     |
    -| 5 |   |     |
    -
      -
    1. Repeat steps a-b for an initial guess of 0.2. (But change the heading from ‘divergence’ to ‘convergence’)
    2. -
  4. -
  5. Commit your changes to your repository. Sync your local repository with github. Then copy and paste the “clone URL” into the following Google Form Homework #3

  6. -
- -