{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 14

Lecture 14 - Graphical Method Progressive Enlargement Two...

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

Graphical Method - Progressive Enlargement Two distinct roots

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

View Full Document
Graphical Method Graphical method is useful for getting an idea of what’s going on in a problem, but depends on eyeball. Use bracketing methods to improve the accuracy: Bisection and false-position methods
Bracketing Methods Both bisection and false-position methods require the root to be bracketed by the endpoints. How to find the endpoints? * plotting the function * incremental search * trial and error

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

View Full Document
Incremental Search
Incremental Search function xb=incsearch(func,xmin,xmax,ns) %incsearch: incremental search root locator % ... see the rest of comments on page 120 of Chapara textbook if nargin<4,ns=50; end % if ns blank set to 50 % Incremental search x=linspace(xmin,xmax,ns); f=func(x); nb=0; xb=[]; %xb is null unless sign change detected for k=1:length(x)-1 if sign(f(k))~= sign(f(k+1)) %check for sign nb = nb+1; xb(nb,1)=x(k); xb(nb,2)=x(k+1); end end if isempty(xb) %display thar no brackets were found disp('no brackets forind') disp('check interval or increase ns') else disp('number of brackets:') %display number of brackets disp(nb) end

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.

{[ snackBarMessage ]}