{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture16

# Lecture16 - Newtons Method-Matlab code > newtraph(x 3*x...

This preview shows pages 1–7. Sign up to view the full content.

Newton’s Method --Matlab code >> newtraph(@(x) 3*x+sin(x)-exp(x), @(x) 3+cos(x)-exp(x),1) ans = 0.360421702960200

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Newton’s Method Quadratic convergence: = constant e n /e 2 n-1 x 0 =3 Illustration of quadratic convergence: 1.E-09 1.E-08 1.E-07 1.E-06 1.E-05 1.E-04 1.E-03 1.E-02 1.E-01 1.E+00 1.E+01 0 1 2 3 4 5 6 7 8 9 n Error xn-x_exact f(x)=exp(x)-2 parabola (Linear)
Bungee Jumper Problem Newton-Raphson method Need to evaluate the function and its derivative 2 ( ) tanh ( ) ( ) 1 tanh sech 2 2 d d d d d gc mg f m t v t c m gc gc df m g g t t t dm mc m m m = - = - Given c d = 0.25 kg/m, v = 36 m/s, t = 4 s, and g = 9.81 m 2 /s, determine the mass of the bungee jumper

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Bungee Jumper Problem >> y=inline( 'sqrt(9.81*m/0.25)*tanh(sqrt(9.81*0.25/m)*4)-36' , 'm' ) y = Inline function: y(m) = sqrt(9.81*m/0.25)*tanh(sqrt(9.81*0.25/m)*4)-36 >> dy=inline( '1/2*sqrt(9.81/(m*0.25))*tanh(sqrt(9.81*0.25/m)*4)- 9.81/(2*m)*4*sech(sqrt(9.81*0.25/m)*4)^2' , 'm' ) dy = Inline function: dy(m) = 1/2*sqrt(9.81/(m*0.25))*tanh(sqrt(9.81*0.25/m)*4)- 9.81/(2*m)*4*sech(sqrt(9.81*0.25/m)*4)^2 >> format short; root = newtraph(y,dy, 140 ,0.00001) root = 142.7376 Initial guess for xr Tolerance es
Newton-Raphson Method Examples of poor convergence or failure

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Secant Method Use secant line instead of tangent line at f ( x i )
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}