Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
roots_and_optimization/README.md
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
47 lines (34 sloc)
1.75 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|solver | initial guess(es) | ea | number of iterations| | |
| --- | --- | --- | --- | | |
|falsepos | 1, 300 | 3.6148e-05 | 18 | | |
|bisect | 1, 300 | 5.3371e-05 | 21 | | |
|newtraph | 0 | 0.0015 | 400 | | |
|mod_secant | 0 | 1.7974e-07 | 5 | | |
The above iteration test, makes it so that the mod_secant and newtraph methods are the beth methods for error approximation since their is less error and more iterations. Bisect, falsepos, and mod_secant have the lowest number of iterations. | |
![Plot of convergence for four numerical solvers.](convergence.png) | |
This is the plot for the second part of the question which illustrated the general trend of each method. | |
In the data above, the bisect, the mod_secant, and the falsepos required signicantly less iterations than the newtraph. | |
### Divergance of Newton-Raphson method | |
| iteration | x_i | approx error | | |
| --- | --- | --- | | |
| 0 | 2 | n/a | | |
| 1 | 2.2857 | 12.5 | | |
| 2 | 2.5276 | 9.5703 | | |
| 3 | 2.7422 | 7.8262 | | |
| 4 | 2.9375 | 6.6491 | | |
| 5 | 3.1182 | 5.7943 | | |
For this method, I debugged the nethraphsons method and ran the iteration six times to get the error approximation. For the divergence problem, I used x_1 = 2 as the initial guess and 'ea' as the error approximation and the 'e_r old' was the x_i reading for every iteration. | |
### Convergance of Newton-Raphson method | |
| iteration | x_i | approx error | | |
| --- | --- | --- | | |
| 0 | .2 | n/a | | |
| 1 | .2 | 1.25e03v| | |
| 2 | -0.0174 | 1.6531e05 | | |
| 3 | 1.0527e-5 | 4.5122e11 | | |
| 4 | -2.3329e-15 | 4.5122e11 | | |
| 5 | 0 | 4.5122e11 | | |
#Homework #4 | |
Part B) Minimum: 0.5 | |
Part C) The minimum potential energy position is X_c = 0.9706 at theta = 0.9 degrees. This value was calculated using the for loop function in For_Loop.m. | |
Part D) | |
Graph is included with the other files in the repository. |