{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter6.3

# Chapter6.3 - With the NewtonRaphson Method we had xi 1 = xi...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: With the NewtonRaphson Method we had xi +1 = xi - f ( xi ) f '( xi ) If we do not have an explicit expression for the derivative, we can approximate it using the last two iterates as xi +1 = xi - f ( xi )( xi-1 - xi ) f ( xi-1 ) - f ( xi ) Consider problem 7.16: The deflection of a simply supported uniform beam of length L subject to a uniform load per unit length of w0(x/L) is displacement is maximal and what is its value. y= w0 - x 5 + 2 L2 x 3 - L4 x 120 EIL . Find where the ( ) In order to solve the problem without using any values for the parameters, we need first to get rid of the L inside the parenthesis. We can do that by dividing and multiplying by L5 y= y= w0 L5 5 3 - ( x / L ) + 2 ( x / L ) - ( x / L ) and defining z=x/L 120 EIL w0 L5 - z5 + 2 z3 - z 120 EIL Now we just need to find where the derivative of the polynomial in the bracket is zero in the interval (0,1). The derivative is 5z4+6z21 We define an anonymous function as >> [email protected](z) 5*z^4+6*z^21 der = @(z) 5*z^4+6*z^21 Then start the process with z=0.1 and z=0.2 >> zim1=0.1;zi=0.2; >> fim1=der(zim1) fim1 = 0.9405 >> fi=der(zi) fi = 0.7680 And then apply the secant method >> zip1=zifi*(zim1zi)/(fim1fi) zip1 = 0.6452 The next iteration >> zim1=zi; zi=zip1; >> fim1=der(zim1) fim1 = 0.7680 >> fi=der(zi) fi = 0.6313 >> zip1=zifi*(zim1zi)/(fim1fi) zip1 = 0.4444 One more iteration >> zim1=zi; zi=zip1; >> fim1=der(zim1) fim1 = 0.6313 >> fi=der(zi) fi = 0.0102 >> zip1=zifi*(zim1zi)/(fim1fi) zip1 = 0.4476 We can also solve with fzero >> fzero(der,0.1) ans = 0.4472 We can follow the iterative process in fzero by setting options options=optimset('display','iter') [z, fz]=fzero(der,0.1,options) Search for an interval around 0.1 containing a sign change: Funccount left f(left) right f(right) Procedure 1 0.1 0.9405 0.1 0.9405 initial interval 3 0.0971716 0.943792 0.102828 0.937117 search 5 0.096 0.945129 0.104 0.935689 search 7 0.0943431 0.946992 0.105657 0.933643 search 9 0.092 0.949574 0.108 0.930696 search 11 0.0886863 0.953118 0.111314 0.926423 search 13 0.084 0.957913 0.116 0.920169 search 15 0.0773726 0.96426 0.122627 0.910906 search 17 0.068 0.972363 0.132 0.896974 search 19 0.0547452 0.982063 0.145255 0.875632 search 21 0.036 0.992232 0.164 0.842241 search 23 0.00949033 0.99946 0.19051 0.788823 search 25 0.028 0.995299 0.228 0.701608 search 27 0.0810193 0.960831 0.281019 0.557352 search 29 0.156 0.856945 0.356 0.319894 search 31 0.262039 0.611588 0.462039 0.0530104 search Search for a zero in the interval [0.26204, 0.46204]: Funccount x f(x) Procedure 31 0.462039 0.0530104 initial 32 0.462039 0.0530104 interpolation 33 0.44717 0.000155988 interpolation 34 0.447214 8.62124e008 interpolation 35 0.447214 3.33067e016 interpolation 36 0.447214 3.33067e016 interpolation Zero found in the interval [0.262039, 0.462039] z = 0.4472 fz = 3.3307e016 >> ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online