Exemplos. Algoritmos – bisseção TolFun = eps; fa = feval(f,a); fb = feval(f,b); if fa*fb > 0, error ('Devemos ter f(a)*f(b)<0 !'); end %metodo da bissecao.

Slides:



Advertisements
Similar presentations
1/2a = 1/2g a = g t (s)x (m)y (m)vx (m)vy (m)Ek (J)Ep (J)Em (J)
Advertisements

Regula-Falsi Method. Type of Algorithm (Equation Solver) The Regula-Falsi Method (sometimes called the False Position Method) is a method used to find.
Bisection Method (Midpoint Method for Equations).
Sec. 3.2: Rolle’s Theorem and MVT Rolle’s Theorem: Let f be continuous on the closed interval [a, b] and differentiable on the open interval (a, b). If.

MTH 252 Integral Calculus Chapter 6 – Integration Section 6.8 – Evaluating Definite Integrals by Substitution Copyright © 2005 by Ron Wallace, all rights.
MATH 140 January 18, The Graph of a Function When a function is defined by an equation in x and y, the graph of a function is the set of all points.
4.2 The Mean Value Theorem.
Lectures on Numerical Methods 1 Numerical Methods Charudatt Kadolkar Copyright 2000 © Charudatt Kadolkar.
Section 4.3 Indefinite Integrals and Net Change Theorem Math 1231: Single-Variable Calculus.
Section 5.5 – The Real Zeros of a Rational Function
Section 4.3 Fundamental Theorem of Calculus Math 1231: Single-Variable Calculus.
1.Definition of a function 2.Finding function values 3.Using the vertical line test.
Intermediate Value Theorem If f is continuous on [ a,b ] and k is any number between f(a) and f(b), inclusive, then there is at least one number c in the.
Continuity Section 2.3.
Class Opener:. Identifying a Composite Function:
Review Limits When you see the words… This is what you think of doing…  f is continuous at x = a  Test each of the following 1.
1.4 Continuity  f is continuous at a if 1. is defined. 2. exists. 3.
Diane Yeoman Definite Integral The Fundamental Theorem.
Polynomial Functions of Higher Degree. Quick Review.
Intermediate Value Theorem Vince Varju. Definition The Intermediate Value Theorem states that if a function f is a continuous function on [a,b] then there.
Revision on C++ Pointers TCP1201: 2013/2014. Pointer Basics  Why pointer is important? 1. Reference/Point to existing data without cloning the data.
CONTINUITY. A function f(x) is continuous at a number a if: 3 REQUIREMENTS f(a) exists – a is in the domain of f exists.
Limits and Continuity Unit 1 Day 4.
If f (x) is continuous over [ a, b ] and differentiable in (a,b), then at some point, c, between a and b : Mean Value Theorem for Derivatives.
AP Calc AB IVT. Introduction Intermediate Value Theorem If a function is continuous between a and b, then it takes on every value between and. Because.
4.2 The Mean Value Theorem.
3.2 Rolle’s Theorem and the
4.2 The Mean Value Theorem State Standard
Rolle’s Theorem & the Mean Value Theorem (3.2)
Polynomial Functions of Higher Degree with Modeling
4.4 The Fundamental Theorem of Calculus
4.5 Locating Zeros of a Polynomial Function
Locating Real Zeros of Polynomials
10.3 Finite State Machines.
Perfect Architectural Models. Instagram sharing.
آشنايی با اصول و پايه های يک آزمايش
Rolle’s Theorem.
3.2 Rolle’s Theorem and the
Lesson 18 Finding Definite and Indefinite Integrals
Neural Networks & MPIC.
Lesson 18 Finding Definite and Indefinite Integrals
Average Rate vs. Instantaneous Rate
Neural Networks & MPIC.
Important Values for Continuous functions
Application of Derivative in Analyzing the Properties of Functions
QuickBooks Error 1904 Visit us:
Inverse Functions Rita Korsunsky.
Warm Up Given y = –x² – x + 2 and the x-value, find the y-value in each… 1. x = –3, y = ____ 2. x = 0, y = ____ 3. x = 1, y = ____ –4 – −3 2 –
1. Be able to apply The Mean Value Theorem to various functions.
Section 5 – Locating Zeros of a Polynomial Function
1.9 Inverse Functions f-1(x) Inverse functions have symmetry
7.2 Polynomial Functions and Their Graphs
1.4 Continuity and One-Sided Limits (Part 2)
Conversion and the Design Equations
Continuity.
Average Rate vs. Instantaneous Rate
Chemical Reaction Engineering
int DP_ABString(int count) { int fa[1000], fb[1000]; if(count > 1000) return -1; memset(fa, 0, sizeof(fa)); memset(fb, 0, sizeof(fb)); for(int i.
Average Rate vs. Instantaneous Rate
College Algebra Chapter 4 Exponential and Logarithmic Functions
Rolle’s Theorem and the Mean Value Theorem
3.6 - Inverse Functions Notation: Say: “f-inverse of x”…
Intermediate Value Theorem
Rita Korsunsky.
1.4 Continuity and One-Sided Limits This will test the “Limits”
Types of Errors And Error Analysis.
Do Now: Find all extrema of
FUNCTIONS & THEIR GRAPHS
Presentation transcript:

exemplos

Algoritmos – bisseção

TolFun = eps; fa = feval(f,a); fb = feval(f,b); if fa*fb > 0, error ('Devemos ter f(a)*f(b)<0 !'); end %metodo da bissecao while (flag == 0) k = k+1; xx(k) =.5*(a+b); fx = feval(f,xx(k)); if fx*fa>0, a = xx(k); fa = fx; else b = xx(k); end err = abs(.5*(a-b)); if (err < TolX | abs(fx) < TolFun | k == MaxIter) flag = 1; if k == MaxIter disp('Numero maximo de iteracoes foi excedido!!!!') end x = xx(k); function [x,err,xx] = bisct(f,a,b,TolX,MaxIter) %function [x,err,xx] = bisct(f,a,b,TolX,MaxIter) % resolve f(x) = 0 usando o metodo da bissecao % input : f, [a,b] = funcao e intervalo de busca % TolX = tolerancia, ou seja, TolX >|x(k) - x(k-1)| % MaxIter = numero maximo de iteracoes %output : x = ponto fixo (solucao) % err = ultimo de |x(k) - x(k-1)| % xx = historico de x if nargin < 5, MaxIter = 100; end if nargin < 4, TolX = 1.0e-6; end flag = 0; k = 0;

Algoritmos – newton-raphson

function [x,err,xx] = newton(f,x0,TolX,MaxIter) if nargin < 4, MaxIter = 100; end if nargin < 3, TolX = 1.0e-6; end dx = 1e-4; flag = 0; TolFun = eps; k = 1; xx(k) = x0; %metodo de newton while (flag == 0) k = k+1; fun = feval(f,x0); dfun = (feval(f,x0+dx)-fun)/dx; xx(k) = x0 - fun/dfun; fx = feval(f,xx(k)); err = abs(xx(k)-x0); x0 = xx(k); if (err < TolX | abs(fx) < TolFun | k == MaxIter) flag = 1; if k == MaxIter disp('Numero maximo de iteracoes foi excedido!!!!') end x = xx(k);