# 09 - Lecture 9 Today’s class • Matlab ’s fzero for...

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

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the 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: single-variable functions from multi-variable functions via anonymous functions – Controlling fzero performance with optimset • P` olya’s framework for problem-solving • 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.776356839400250e-15-1.065814103640150e-14 % 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, zero-crossing % 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.

### Page1 / 14

09 - Lecture 9 Today’s class • Matlab ’s fzero for...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online