CFD_Assignment 1
V1002583_HK10VP
Assignment 1
The differences of the results of a simple differential equation
given by three different approximating methods:
Forward Euler, Backward Euler and Trapezoidal Rule
I.
Introduction
As we all know, Forward Euler, Backward Euler and Trapezoidal Rule are some
of the methods could be used to find the solution of differential equations which has time
integration. However, the solutions of these methods, like many other methods, contain
errors comparing to the analytical result.
df
f
In this assignment, using a simple equation dt
, we will find these errors, as
f 0 1
well as the relationship of the error with t (the gap between the points in the timeline,
we use this t to divide the continuous time into discrete time).
II.
A.
Forward Euler Method
Figure 1 indicates the relationship between t and the numerical results using
Forward Euler. With different t values, such as t=0.125 (blue line), t=0.25 (black
line) and t=0.5 (green line), we have separated distances to the true result (red line). The
Y-axis of the figure is the value of f, while the X-Axis represents the timeline.
CFD_Assignment 1
V1002583_HK10VP
The true result of our equation should be f t et .From the above figure, we can have
two conclusions:
The smaller the value of t, the smaller the gap between the numerical result and
the analytical one. It means that the Error E f numerical _ method t ftrue t shares the
same trend with t. When t reaches 0, we would have a continuous timeline,
which is our analytical solution f t et
No matter what is the value of t, the numerical solution at a specific time t is
always smaller than the true value at the same time. As can be seen from the
graph, all of the other curves are always under the red curve.
These conclusions can be explained easily. For the first one, it is naturally that the more
points we have to describe a continuous curve, the more exact the curve would be. If we
have a small enough value for t, we would get a curve which looks likely to the
analytical solution. This relationship will be discussed particularly in chapter III. For the
second conclusion, we can find the explanation from the basic concept of Forward Euler
Method, and it will not be mentioned further in this report.
B.
Backward Euler
Figure 2 shows the relationship between t and the numerical results using
Backward Euler. With different t values, in this case, t=0.125 (blue line), t=0.25
(black line) and t=0.5 (green line), we have separated gaps to the true result (red line).
The Y-axis of the figure indicates the value of f, while the X-Axis represents the timeline.
CFD_Assignment 1
V1002583_HK10VP
C.
Trapezoidal Rule
Figure 3 shows the same results with the two above figures, but this time we use
the Trapezoidal Rule to approximate the solutions.
With Trapezoidal Rule Method, we have quite a few differences comparing to figure 1
and 2. It is obviously that Trapezoidal Rule gives the results much closer to the analytical
one. In this case, we cannot indicate the 3 curves, the one with t=0.125, the one with
t=0.25 and the true one. They seem to collapse to each other.
CFD_Assignment 1
V1002583_HK10VP
CFD_Assignment 1
V1002583_HK10VP
t) at t=2.5
One again, it is clear that Forward Euler and Backward Euler share the same trend,
and from figure 6, we get the equation of these lines
log Y A log X
log Y B 2 log X
with A and B are constants depending on the curve. Therefore, the red line representing
for the Euler Methods has the slope of -1, meanwhile, the black line of Trapezoidal Rule
has the slope of -2.
CFD_Assignment 1
V1002583_HK10VP
As mentioned in part I of this report, Trapezoidal Rule Method gives us the more
precise result comparing to Forward Euler and Backward Euler Method at the same value
of t. Moreover, from figure 6 we can also get the conclusion that the approximating
method which has the bigger slope in the log(E)-log(1/ t) graph will have the closer
result to the analytical solution.
*Reference
[1]Nguyn Ch Cng, Finite Difference Approximations-I, Department of Aerospace
Engineering, Ho Chi Minh University of Technology, 2010