Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
4b
4b
  • Loading branch information
tjc14008 committed Oct 6, 2017
1 parent 3b21940 commit bce0e3e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Expand Up @@ -59,14 +59,29 @@ df = @(x) -(2*(x)^2-4*x+1)*exp(-(x-1)^2);


Question 4


a)
```matlab
lj = @(x) 4*0.039*((2.394./x).^12-(2.394./x).^6);
[x,E,ea,its] = goldmin(lj,2.8,6)
[x,E,ea,its] = goldmin(lj,0,3)
```
```matlab
x = 2.8000
E = -0.0371
ea = 9.9392e-05
x = 2.6872
E = -0.0390
ea = 9.7092e-05
its = 27
```
b)
```matlab
F = (0:0.0022/30:.0022)
lj = @(x) 4*0.039*((2.394./x).^12-(2.394./x).^6);
ET = @(dx) lj(dx)*(2.6872+dx)- F*dx;
[x,fx,ea,iter]=goldmin(ET,0,1)
```
```matlab
x = 1.0000
fx = 1.0e+04
ea = 8.6968e-05
iter = 27
```
4 changes: 4 additions & 0 deletions problem_4b.m
@@ -0,0 +1,4 @@
F = (0:0.0022/30:.0022)
lj = @(x) 4*0.039*((2.394./x).^12-(2.394./x).^6);
ET = @(dx) lj(dx)*(2.6872+dx)- F*dx;
[x,fx,ea,iter]=goldmin(ET,0,1)
2 changes: 2 additions & 0 deletions problem_4b.m~
@@ -0,0 +1,2 @@
F = (0:.003
ET = (@x) lj(x)*(2.6872+x)-

0 comments on commit bce0e3e

Please sign in to comment.