Lecture_19_Solution_Nonlinear_Eq_07

Lecture_19_Solution_Nonlinear_Eq_07 - 1 E7 INTRODUCTION TO...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
E7 L19 1 E7: INTRODUCTION TO COMPUTER E7: INTRODUCTION TO COMPUTER PROGRAMMING FOR SCIENTISTS AND PROGRAMMING FOR SCIENTISTS AND ENGINEERS ENGINEERS Lecture Outline 1. Review of Matlab function fzero fzero 2. Iterative methods for solving algebraic nonlinear equations 3. The bisection method 4. Newton’s method Copyright 2007, Horowitz, Packard. This work is licensed under the Creative Commons Attribution-Share Alike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Background image of page 1

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

View Full Document Right Arrow Icon
Midterm 2 Results Midterm 2 Results E7 L19 2 10 15 20 25 30 35 40 45 50 55 0 10 20 30 40 50 60 70 80 Average: 43 St: 9
Background image of page 2
Midterm 2 Results Midterm 2 Results E7 L19 3 0 2 4 0 200 400 Problem 1 Score Number of Students Mean: 2.5143, Std: 0.80343 0 5 0 100 200 Problem 2 Score Mean: 3.4952, Std: 1.7995 0 5 10 0 100 200 Problem 3 Score Mean: 6.6, Std: 3.3971 0 5 10 0 200 400 Problem 4 Score Mean: 6.5111, Std: 1.0568 0 2 4 0 200 400 Problem 5 Score Mean: 3.5079, Std: 1.1739 0 5 10 0 200 400 Problem 6 Score Mean: 5.5952, Std: 0.90582 0 5 10 0 100 200 Problem 7 Score Mean: 6.9667, Std: 1.732 0 10 20 0 50 100 Problem 8 Score Mean: 7.7921, Std: 3.6041 0 50 100 0 50 Total Score Mean: 42.9825, Std: 9.2871
Background image of page 3

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

View Full Document Right Arrow Icon
E7 L19 4 Function Function fzero fzero Finds the zero of a single-variable function Syntax: [x0,fval] = fzero( @ function ,xini) function: actual name of the function @ function: function handle xini initial guess of zero location x0 zero location (i.e. function(x0)= 0 ) fval = function(x0) (should be zero)
Background image of page 4
E7 L19 5 Using Using fzero fzero Example: Lets find the zero of the function function y = f1(x) y = x + 2*exp(-x) - 3; Matlab syntax: 1 ( ) ( ) 2 3 x y x f x x e - = = + -
Background image of page 5

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

View Full Document Right Arrow Icon
E7 L19 6 Using Using fzero fzero Plotting the function function y = f1(x) y = x + 2*exp(-x) - 3; >> x = linspace(-1,5); >> plot(x,f1(x)) Matlab syntax: two zeros 1 ( ) 2 3 x f x x e - = + -
Background image of page 6
E7 L19 7 Using Using fzero fzero Finding the zeros of function y = f1(x) y = x + 2*exp(-x) - 3; >> xin = 0; [x,fval] = fzero(@f1,xin) x = -0.5831 fval = 0 Matlab syntax: initial guess for search 1 ( ) 2 3 x f x x e - = + - two zeros
Background image of page 7

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

View Full Document Right Arrow Icon
E7 L19 8 Using Using fzero fzero Finding the zeros of function y = f1(x) y = x + 2*exp(-x) - 3; >> xin = 4; [x,fval] = fzero(@f1,xin) x = 2.8887 fval = -4.4409e-016 Matlab syntax: initial guess for search 1 ( ) 2 3 x f x x e - = + - two zeros
Background image of page 8
E7 L19 9 How does How does fzero fzero work? work? It uses a combination of iterative algorithms: Bisection Secant Inverse quadratic interpolation methods. Today we will explain two methods: Bisection (linear convergence) Newton’s (quadratic convergence)
Background image of page 9

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

View Full Document Right Arrow Icon
E7 L19 10 Iterative methods for solving algebraic equations Iterative methods for solving algebraic equations Given a prescribed function
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 38

Lecture_19_Solution_Nonlinear_Eq_07 - 1 E7 INTRODUCTION TO...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online