Академический Документы
Профессиональный Документы
Культура Документы
A Simple Example
To solve the following equation:
2.0 − % + ln % = 0
1
2/7/16
General Setup
Let x be a variable of interest. The objective is to find the value of x
which satisfies the following nonlinear equation:
* % =0
Solution!
2
2/7/16
• Bracketing Methods
• Bisection method
• Regula Falsi
• Open Methods
• Secant method
• Fixed-point iteration
• Newton-Raphson
3
2/7/16
4
2/7/16
• Usage:
xSol = fzero(@(x) funName(x),x0)
• xSol is the resulting solution
• funName is a function file that we provide to calculate * %
• x0=[xL;xH]; is vector of initial guesses
Problem to Solve
5
2/7/16
6
2/7/16
567 5
% =2 %
7
2/7/16
Example
2 − % + ln % = 0
% = 2 + ln (%) % = 9 4:;
0.1586 3.1462
Example 2
5% − 9 4/; = 0
8
2/7/16
9
2/7/16
Newton Raphson
• Popular Method
567 5
* %5
% =% − > 5
* %
Example
10
2/7/16
Newton Raphson
565 5
* %5
% =% − > 5
* %
;
• Has quadratic rate of convergence è @ 567 = @ 5
11
2/7/16
1. Bisection Method
2. MATLAB function fzero
3. Fixed-Point Iteration
4. Newton-Raphson
12
2/7/16
• Usage:
xSol = fsolve(@(x) funName(x),x0)
• xSol is the resulting solution
• funName is a function file that we provide to calculate A B
• x0 initial guess (same dimension as number of variables)
Problem to Solve
13
2/7/16
• Wikipedia: https://en.wikipedia.org/wiki/Lorenz_system
14
2/7/16
1 −1 0
F= 2−D −1 −%
C % −3
15
2/7/16
16