This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Lecture 9 Today’s class: • Matlab ’s fzero for finding zeros – Basic syntax for using fzero – Scalar nonlinear equations in many variables: singlevariable functions from multivariable functions via anonymous functions – Controlling fzero performance with optimset • P` olya’s framework for problemsolving • Other problems: roots and fminbnd Matlab ’s fzero • Practical solver for nonlinear equations: fzero • Hybrid iterative solver: combines bisection method, secant method, IQI (inverse quadratic interpolation) to generate successive iterates [i.e., applies both bracketing and open algorithms] • Two basic ways to invoke fzero : >> f = @(x) x^2  10 >> x0 = 3.5; % Initial guess >> root = fzero( f, x0 ) >> f = @(x) x^2  10 >> I0 = [3,4]; % Initial bracket >> root = fzero(f, I0) Exercises Find (any) solutions of the following equations with fzero . t 3 + 6 t 2 = 4 t + 8 x 3 e x + 3 2 = 0 % Define nonlinear function f = @(t) t^3 + 6*t^2  4*t  8; % Plot function f from t=2 to t=6 fplot(f,[2,6]), grid on % Plot reveals three zeros t1 = fzero( f, [1,0.5] ) t1 =0.828427124746190 t2 = fzero( f, 2 ) % root near t=2 t2 = 2 t3 = fzero(f,[4,5]) t3 = 4.828427124746191 % Verify t1, t2, t3 are in fact zeros f([t1;t2;t3]) ans = 1.776356839400250e151.065814103640150e14 % Define appropriate function g = @(x) x.^3.*exp(x)+1.5 g = @(x)x.^3.*exp(x)+1.5 % Generate a plot fplot( g, [2,0] ), grid on % On my graph, zerocrossing % between x=1 and x=0.5 root = fzero( g, 0.75 ) root =0.859539745621294 root = fzero( g, [1,0.5] ) root =0.859539745621294 P` olya’s How To Solve It 1. Understand the problem 2. Plan your solution 3. Execute your plan 4. Check your results P` olya’s How To Solve It • What the unknowns? How many unknowns are there?...
View
Full
Document
This note was uploaded on 06/20/2011 for the course MATH 2070 taught by Professor Aruliahdhavidhe during the Winter '10 term at UOIT.
 Winter '10
 aruliahdhavidhe
 matlab, Linear Equations, Equations, Scalar

Click to edit the document details