Title: Convergence
1Convergence
- Numerical methods for finding roots of equations
2Numerical Methods for Finding Roots
- Simple equations
- Rearrange to solve
- Use Maple command solve
- More complicated equations
- solve does not work
- what does?
- not symbolic, but numerical
- Matlab fzero
- Maple fsolve
3Bisection Method (discussed later)
Other Methods (not discussed) Successive
Substitution Newtons Method Secant Method
4Two Member Frame Problem
5The buckling load for the Two Member Frame
6Cantilevered Beam Problem
7The deflection of the cantilevered beam
8The deflection of the cantilevered beam
9Bisection Method
10We assume that the function f() is a continuous
function, so that somewhere between left and
right, there is some point at which f() will be
zero.
left
right
11Bisection Method
1.
2. Evaluate f(m) a. If the sign of f(m) is
the same as the sign of f(l) then the next left
endpoint is m. (The new value of l is m.) b.
If the sign of f(m) is the same as the sign of
f(r) then the new right endpoint is m. (The
new value of r is m). c. If f(m) is zero,
then the computation is finished.
12(No Transcript)
13Bisection Method
- Bisection method is not fast
- Maple Matlab use Bisection Method to start
calculations, then switch to more sophisticated
methods of root finding
14Root finding in Maple
- fsolve
- f refers to floating point numbers
- Dont need equations in standard form
- Eq1tan(z)-z/(1(z2/4))
- fsolve(Eq1,z2..4)
- 3.828861865
15Root finding in Maple
- fsolve requires an interval
- Find this interval by plotting the function
- Plotting is very important to finding roots
16Root finding in Matlab
- Put f(x) into an m-file
- For beam equation, use beam.m
17beam.m
function f beam(a)
f a.2.(a.24a6)3/2
- Now lets look at the main program
18(No Transcript)
19(No Transcript)
20(No Transcript)
21Numerical Methods Summary
- Works with numbers, not symbols
- Always plot the function
- Maple command fsolve
- Matlab command fzero
22Numerical Evaluation of Integrals
- Maple cant always evaluate an integral
symbolically - Only a numerical value can be found
- Sometimes a numerical answer is preferred
23Integral examples
24Integral examples
Probability of Motor Failure m number of
months to failure Probability distribution
given by
25Integral examples
What is the probability that a motor survives a
year of use?
26Trapezoid method
f(a)
y
f(b)
Areahftrap
hb-a
x
a
b
27Smaller values of h (larger values of N) give
better approximations of integrals.
28Evaluating integrals in Maple
- evalf
- Evaluates to get a floating point number
- Can use capital Int
- Sets up integral, but doesnt try to symbolically
evaluate it - Maple (and Matlab) use more sophisticated version
of Trapezoid method - Varies h based on smoothness of curve
29Volume of a tank (Maple)
for
30(No Transcript)
31Numerical Integration in Matlab
- quad
- Qquad(fun,a,b)
- Quadrature means numerical integration
32Volume of a tank (Matlab)
33Volume of a tank (Matlab)
34Probability of Motor Failure (Matlab)
Motor.m function z Motor(m) z
13.765m./(m.221).(7/4)
Q quad(Motor, 0,12) Q 0.7361 (73.61 of
motors will fail, therefore 26.39 will survive
the whole year)
35Average Age of Rebuilt Motors
function z ExpectAge(m) z m.Motor(m)
quad(ExpectAge,0,12) .263912
36Pulling a square plug out of a sphere
Pull a 4x4 plug out of the center of the sphere
Uses the dblquad command in Matlab (see course
notes)
37Numerical Integration Summary
- Maple
- evalf(int,xa..b)
- Matlab
- quad(fun,a,b)