Graphics Reference
In-Depth Information
0
k 1 ¼ hf
ðx n ; y n Þ
0
1
2 ; y n þ
k 1
2
0
@
A
k 2 ¼ hf
x n þ
0
1
2 ; y n þ
k 2
2
(B.152)
@
A
0
k 3 ¼ hf
x n þ
0
ðx n þ h; y n þ k 3 Þ
y 1 ¼ y n þ
k 4 ¼ hf
k 1
6 þ
k 2
3 þ
k 3
3 þ
k 4
6 þ Oðh
5
Þ
The implicit Euler method
The explicit Euler method updates the function value using the derivative at the current value. The
danger with the implicit method is that if the time step is too large, the updated function values can
be a poor approximation to the actual function. The implicit method, for comparison, finds a new posi-
tion whose derivative can update the current value to the new value ( Eq. B.153 ) .
0
y 1 ¼ y n þ hf
ðx 1 ; y 1 Þ
(B.153)
This requires solving an equation to find such a y 1 using, for example, a Newton-Raphson method. It
takes more time to take a step using the implicit Euler method but because this technique is more stable
than explicit Euler, large time steps can be taken and, thus, an overall computational savings can often
be achieved.
The semi-implicit Euler method
The semi-implicit Euler method is derived from the implicit Euler method by approximating the
y 1
term used in evaluating the derivative by an explicit Euler step,
thus resulting in
Equation B.154 .
0
0
y 1 ¼ y n þ hf
ðx 1 ; y n þ hf
ðx n ; y n ÞÞ
(B.154)
The semi-implicit Euler method offers more stability than explicit Euler and is computationally
much less expensive than implicit Euler.
B.8.3 Updating position
The next three methods are discussed specifically in the context of updating position from velocity and/
or acceleration over a time period\ Dt .
The Heun method
The Heun method of integration, also called the improved Euler method , augments the basic Euler
method. The Euler method takes the derivative at the current position to update to the next position.
The Heun method takes the derivative at the position computed by the basic Euler method and averages
it with the first-computed derivative and uses the average to update the position ( Eq. B.155 ). This is a
common integration method used in physics texts.
 
Search WWH ::




Custom Search