Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
3c
3c
  • Loading branch information
tjc14008 committed Oct 6, 2017
1 parent 91c1be3 commit e92fe82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -44,3 +44,15 @@ df = @(x) -(2*(x)^2-4*x+1)*exp(-(x-1)^2);
| 4 | 3 | 4.9605 |
| 5 | 3 | 4.3873 |
```
```matlab
### convergence of Newton-Raphson method
| iteration | x_i | approx error |
| --- | --- | --- |
| 0 | 1.2 | n/a |
| 1 | 1.2 | 22.1239 |
| 2 | 1.2 | 1.7402 |
| 3 | 1.2 | 0.0011 |
| 4 | 1.2 | 2.3315e-13 |
| 5 | 1.2 | 2.3315e-13 |
```
2 changes: 1 addition & 1 deletion newtraph_f.m
@@ -1,3 +1,3 @@
f = @(x) (x-1)*exp(-(x-1)^2);
df = @(x) -(2*(x)^2-4*x+1)*exp(-(x-1)^2);
[root,ea,iter]=newtraph(f,df,3,.00001,5)
[root,ea,iter]=newtraph(f,df,1.2,.00001,5)

0 comments on commit e92fe82

Please sign in to comment.