工程数学课件

工程数学课件
工程数学课件

一、Bracketing Methods

the method starts with two initial guesses (xl,xu) that bracket, or contain, the root. Then systematically reduce the width of the bracket.

If f(xl) and f(xu) have opposite signs, there are an odd number of roots in the interval;

If f(xl) and f(xu) have the same signs, there are either no roots or an even number of roots between the values.

1、The Bisection Method

General Principle---If f(x) is real and continuous in the interval from xl to xu and f(xl) and f(xu) have opposite sigs, that is f(xl)f(xu)<0, then there is at least one real root between xl and xu. Step1: Choose lower xl and upper xu guesses for the root that the function changes sign over the interval. This can be checked by ensuring that f(xl)f(xu)<0;

Step2: An estimate of the root xr is determined by Xr=(xl+xu)/2 (this approach always divide the interval in half)

Step3: Make the following evaluations to determine in which interval the root lies:

If f(xl)f(xr)<0, the root lies in the lower subinterval. Therefore, set xu=xr and return to step 2. If If f(xl)f(xr)>0, the root lies in the upper subinterval. Therefore, set xl=xr and return to step 2. If f(xl)f(xr)=0, the root equals xr; terminates the computation

Termination criteria and error estimates :)

1()()

(1

1u

r u r x x x f x x x f -=

-

2、The False-position Method

This method determines xr using the following approaches:

Step1: Choose lower xl and upper xu guesses for the root that the function changes sign over the

interval. This can be checked by ensuring that f(xl)f(xu)<0;

Step2: An estimate of the root xr is determined by Equation (2)

Step3: Make the following evaluations to determine in which interval the root lies:

If f(xl)f(xr)<0, the root lies in the lower subinterval. Therefore, set xu=xr and return to step 2. If If f(xl)f(xr)>0, the root lies in the upper subinterval. Therefore, set xl=xr and return to step 2. If f(xl)f(xr)=0, the root equals xr; terminates the computation

f(x l )x r ?x l

=f(x u )

x

r ?x u

(1)

)2()()()

)((u l u l u u r x f x f x x x f x x ---

=

二、Open Methods

1、Newton-Raphson Method —the most widely used of all root-locating formulas

Pitfalls of Newton-Raphson Method : (a): occurrence of an inflection point in the vic inity of a root, iterations beginning at x0

progressively diverge from the root;

(b): the tendency of the Newton-Raphson technique to oscillate around a local maximum or minimum. Such oscillations may persist, or a near-zero slope is reached, whereupon the solution is sent far from the area of interest.

(c): an initial guess that is close to one root can jump to a location several roots away, because near-zero slope is encountered.

(d): the solution shoots off horizontally and never hits the x axis. 2、Secant Method

Secant method is similar to the Newton-Raphson technique in the sense that an estimate of the root is predicted by extrapolating a tangent of the function to the x axis. However, the secant method uses a difference rather than a derivative to estimate the slope.

Substituting this into Newton-Raphson equation :

Yielding the following iterative equation:

)

(')(1i i i i x f x f x x -=+)

()()()('11i i i i i x x x f x f x f --=

--

x i+1=x i ?f(x i )

f ′(x i

)

)

()())((111i i i i i i i x f x f x x x f x x ---

=--+

三、OPTIMIZA TION

1、One-Dimensional Unconstrained Optimization

Step 1: Guess a lower and uper bounds: xl and xu;

Step 2: Choose two interior points (x1 and x2) according to the golden ratio (x1>x2).

Step 3: Calculate f(x1) and f(x2).

Case 1: If f(x1)>f(x2), Then the domain (xl - x2) can be eliminated because it does not contain the maximum. For this case, x2 becomes the new xl;

Case2: If f(x2)>f(x1), then the domain (x1–xu) can be eliminated. In this case, x1 becomes the new xu.

Step 4: Substitute the new xl (old xu) (case 1) or new xu (old xl) (case 2) into Equations (1) to (3) in the next round of calculations. Termination Criteria :

If f(x 1)>f(x 2), x(opt)=x 1 If f(x 2)>f(x 1), x(opt)=x 2

2、Multi-Dimensional Unconstrained Optimization

f(x,y)到XOY 平面的投影,h 即运动的距离,根据(x 0,y 0)计算出df/dx,df/dy 的值,再代入 计算最值时h 的大小,求出(x,y )。

1、Starting at x 0 and y 0 the coordinates of any point in the gradient direction can be expressed as:

2、At the evaluation point (x 0, y 0), the value of the derivative terms in above equations can be

calculated and only h is an unknown. This converts the f(x,y) into a function of only one variable h:

)

3();2()

1)((2

1521d x x d x x x x d u l l u -=+=--=

61803.02

151

201=-===R l l l

l %

100)

1(opt

l u a x x x R --=εh y f

y y ??+=0h x f

x x ??+=0)

(),(),(00h g h y

f y h x

f x f y x f =??+

??+

=)(),(),(00h g h y

f y h x f x f y x f =??+??+=

3、The h can be calculated using the 1D optimization approach, i.e., Golden-section;

4、With h known, x1 and y1 and can be determined and used as a new starting point.

计算到h为零时达到最值点。

例子:

F(x,y)=4x+2y+x2-2x4+2xy-3y2,(x0,y0)=(0,0)

df/dx=4,df/dy=2,

G(h)=-512h4+20h2+20h,求出G(h)极值点,代入求出(x,y)。再重复以上操作,直到h=0为止。

工程数学课件

一、Bracketing Methods the method starts with two initial guesses (xl,xu) that bracket, or contain, the root. Then systematically reduce the width of the bracket. If f(xl) and f(xu) have opposite signs, there are an odd number of roots in the interval; If f(xl) and f(xu) have the same signs, there are either no roots or an even number of roots between the values. 1、The Bisection Method General Principle---If f(x) is real and continuous in the interval from xl to xu and f(xl) and f(xu) have opposite sigs, that is f(xl)f(xu)<0, then there is at least one real root between xl and xu. Step1: Choose lower xl and upper xu guesses for the root that the function changes sign over the interval. This can be checked by ensuring that f(xl)f(xu)<0; Step2: An estimate of the root xr is determined by Xr=(xl+xu)/2 (this approach always divide the interval in half) Step3: Make the following evaluations to determine in which interval the root lies: If f(xl)f(xr)<0, the root lies in the lower subinterval. Therefore, set xu=xr and return to step 2. If If f(xl)f(xr)>0, the root lies in the upper subinterval. Therefore, set xl=xr and return to step 2. If f(xl)f(xr)=0, the root equals xr; terminates the computation Termination criteria and error estimates :) 1()() (1 1u r u r x x x f x x x f -= - 2、The False-position Method This method determines xr using the following approaches: Step1: Choose lower xl and upper xu guesses for the root that the function changes sign over the interval. This can be checked by ensuring that f(xl)f(xu)<0; Step2: An estimate of the root xr is determined by Equation (2) Step3: Make the following evaluations to determine in which interval the root lies: If f(xl)f(xr)<0, the root lies in the lower subinterval. Therefore, set xu=xr and return to step 2. If If f(xl)f(xr)>0, the root lies in the upper subinterval. Therefore, set xl=xr and return to step 2. If f(xl)f(xr)=0, the root equals xr; terminates the computation f(x l )x r ?x l =f(x u ) x r ?x u (1) )2()()() )((u l u l u u r x f x f x x x f x x --- =

相关文档
最新文档