Sei sulla pagina 1di 30

PROJECT 1

LEE JIN FENG


A16KM0130

SKMM3023
SECTION 2
APPLIED NUMERICAL METHOD
DR. NORAZILA BINTI OTHMAN

School of Mechanical Engineering


Universiti Teknologi Malaysia
ii

ACKNOWLEDGEMENT

The success and final outcome of this project required a lot of guidance and
assistance from many people and I am extremely fortunate to have this all along the
completion of my project. Whatever I have done is only due to such guidance and
assistance and I would not forget to thank them. I need to express my appreciation to
our Applied Numerical Method lecturer, Dr. Norazila binti Othman who gave me a
lot of supports while processing this project. She also devoted the endless guidance,
encouragement, critics and inspiration until success and completion of this project.

I also very appreciated about the source of the Universiti Teknologi Malaysia
such as Perpustakaan Sultanah Zanariah that supplied a tremendous amount of
information with regard to my project. Perpustakaan Sultanah Zanariah had a
different sort of books that consolidated my points in this project.

Eventually, my fellow undergraduate friends that had directly and indirectly


helped me throughout this project was carried out without whom this project would
not have been a distant reality.
iii

ABSTRACT

The objective of the project is to study the application of the numerical


method in the engineering field. MATLAB is the most productive software
environment that make our calculation process faster and easier. By the way, we also
need to learn the application of the formulas by manual calculation to realise the
concept of the numerical methods. This project consists of two question and 15
samples. The errors of the 15 samples need to determine. Based on the reading of the
random vibration test, we can observe that it is quite fluctuating. The relative error is
calculated from the exact value and approximate value. The graphs are plotted for
each type of higher accuracy finite difference approximation in order to observe the
fluctuation value of errors easily. The concept of numerical methods for the first
derivative has higher accuracy than the second and third derivatives. The errors of
the vibration test can be reduced by repeating the experiment several times.
iv

TABLE OF CONTENTS

TITLE PAGE

ACKNOWLEDGEMENT ii

ABSTRACT iii

TABLE OF CONTENTS iv

INTRODUCTION 1–2

METHODOLOGY 3

DISCUSSIONS AND RESULTS 4 – 23

CONCLUSION 24

REFERENCE 25
1

INTRODUCTION

The finite difference approximations of the derivatives are one of the


simplest and of the oldest methods to solve differential equations. It has been known
by L. Euler (1707-1783) ca. 1768, in one dimension of space and was probably
extended to dimension two by C. Runge (1856-1927) ca. 1908. The advent of finite
difference techniques in numerical applications began in the early 1950s and their
development was stimulated by the emergence of computers that offered a
convenient framework for dealing with complex problems of science and
technology. Theoretical results have been obtained during the last five decades
regarding the accuracy, stability and convergence of the finite difference method for
partial differential equations.

The principle of finite difference methods is close to the numerical schemes


used to solve ordinary differential equations. It consists in approximating the
differential operator by replacing the derivatives in the equation using differential
quotients. The domain is partitioned in space and in time and approximations of the
solution are computed at the space or time points. The error between the numerical
solution and the exact solution is determined by the error that is committed by going
from a differential operator to a difference operator. This error is called the
discretization error or truncation error. The term truncation error reflects the fact that
a finite part of a Taylor series is used in the approximation.

For the sake of simplicity, we shall consider the one-dimensional case only.
The main concept behind any finite difference scheme is related to the definition of
the derivative of a smooth function u at a point x ∈ R:
2

u, ( x )= lim
h→ ∞
( u ( x +hh)−u ( x) ),
and to the fact that when h tends to zero, the quotient on the right-hand side provides
a “good” approximation of the derivative. In other words, h should be sufficiently
small to get a good approximation. It remains to indicate what exactly is a good
approximation, in what sense. Actually, the approximation is good when the error
committed in this approximation tends towards zero when h tends to zero. If the
function u is sufficiently smooth in the neighbourhood of x, it is possible to quantify
this error using a Taylor expansion.
3

METHODOLOGY

The random vibration test consists of 15 samples. The data must be used to
resolve all of the questions. For Question 1, the values of velocity, acceleration and
jerk are determined by using finite-formulas with a constant step size for certain
time. This methods include forward, backward and central difference approximation.
Question 1 have to calculate repeatedly 8 times for all the values. Therefore,
MATLAB is the most productive software environment that make our calculation
process faster and easier. Although MATLAB brings a lot of convenience, we also
need to learn the application of the formulas by manual calculation to realise the
concept of the numerical methods.

For Question 2, it is not possible to solve the solution using a full manual
calculation since the calculator fx570ES PLUS cannot calculate a 4th order
polynomial. Consequently, MATLAB software is used to solve and ensure that the
data always fit to the 4th order polynomial. Based on the concept of numerical
methods, the polynomials curve fitting is used to find the unknowns’ a0, a1 until a4.
After all the data has been calculated, it is arranged in a matrix form and then solved
the question by direct elimination method. The polynomial equation will be formed
after determining the 5 unknown values.

Finally, the calculation of relative errors is needed for all of the higher
accuracy finite difference approximation. Firstly, we must use the polynomial
equation to find the exact values for velocity, acceleration, and jerk by using the
4

differentiation method. The graphs are plotted for each type of higher accuracy finite
difference approximation in order to observe the fluctuation value of errors easily.
From the graphs, the accuracy level can be determined.

DISCUSSIONS AND RESULTS

For this project 1, it consists of two questions. Both questions need to solve
by using numerical methods.

The displacement of an instrument subjected to a random vibration test, at different


instants of time, is found to be as follows:

Station, i Time, ti (s) Displacement, yi (in)


1 0.04 0.156
2 0.08 0.235
3 0.12 0.248
4 0.16 0.0125
5 0.20 0.072
6 0.24 0.085
7 0.28 0.524
8 0.32 0.236
9 0.36 0.456
10 0.40 0.123
11 0.44 0.245
12 0.48 0.245
13 0.52 0.035
14 0.56 0.048
15 0.60 0.561
5

1. Since the data are known for 0.04 ≤ t ≤ 0.60 sec, determine the velocity ( dydt ),
d2 y d3 y
acceleration ( )
d t2
and jerk
d t3( )
at ti = 0.04 s, 0.16s, 0.24s, 0.32s, 0.36s, 0.44s,

0.52s and 0.60s using suitable finite-difference formulas with a step size, Δt, of
0.04s.

The time, ti = 0.04 is used as the sample manual calculation.

When time, ti = 0.04 s,

f (ti-3) = f (-0.08) = 0.000 in


f (ti-2) = f (-0.04) = 0.000 in
f (ti-1) = f (0.00) = 0.000 in
f (ti) = f (0.04) = 0.156 in
f (ti+1) = f (0.08) = 0.235 in
f (ti+2) = f (0.12) = 0.248 in
f (ti+3) = f (0.16) = 0.0125 in

h = Δt = 0.04s
6

Forward difference approximation


First derivative

dy f ( t i+1 )−f ( t i )
= f '(ti) =
dt h
= 0.235−0.156
0.04
= 1.9750

Second derivative
d2 y ''
f ( t i+2 )−2 f ( t i +1) + f ( t i )
2 = f (ti) =
dt h2
= 0.248−2 ( 0.235 ) +0.156
| 0.042 |
= 41.2500

Third derivative
d3 y f ( t i+3 ) −3 f ( t i+2 ) +3 f ( t i+1 ) −f ( t i )
= f '' ' (ti) =
d t3 h3
= 0.0125−3 ( 0.248 )+3 ( 0.235 )−0.156
| 0.04 3 |
= 2851.5625

Central difference approximation


First derivative
dy f ( t i+1 )−f ( t i−1 )
= f '(ti) =
dt 2h
= 0.235−0.000
2 ( 0.04 )
= 2.9375

Second derivative
d2 y ''
f ( t i+1 )−2 f ( t i ) + f ( t i−1 )
2 = f (ti) =
dt h2
= 0.235−2 ( 0.156 )+ 0.000
| 0.042 |
= 48.1250

Third derivative
d3 y '' '
f ( t i+2 )−2 f ( t i +1) + 2 f ( t i−1 ) −f ( t i−2 )
3 = f (ti) =
dt 2 h3
7

= 0.248−2 ( 0.235 ) +2 ( 0.000 ) −0.000


| 2 ( 0.04 3 ) |
= 1734.3750

Backward difference approximation


First derivative
dy f ( t i )−f ( t i−1 )
= f '(ti) =
dt h
= 0.156−0.000
0.04
= 3.9000

Second derivative
d2 y f ( t i )−2 f ( t i−1 ) +f ( t i−2 )
= f ' ' (ti) =
d t2 h2
=0.156−2 ( 0.000 ) +0.000
0.042
= 97.5000

Third derivative
d3 y '' '
f ( t i )−3 f ( t i−1 ) +3 f ( t i−2 )−f ( t i−3 )
3 = f (ti) =
dt h3
= 0.156−3 ( 0.000 )+3 ( 0.000 )−0.000
0.04 3
= 2437.5000

MATLAB is used for the following time, ti = 0.16s, 0.24s, 0.32s, 0.36s,
0.44s, 0.52s and 0.60s. This software calculates the forward, backward and central
difference approximation. All of the calculations show in tabular form.
8

Coding from MATLAB


9

Answer from MATLAB


10

2. Consider the displacement data given, then fit polynomial 4th order through the
data.
11

This question is solved by using polynomial curve fitting. Since the calculator
fx570ES PLUS cannot calculate a 4th order polynomial, the MATLAB software is
used to make sure that the data always fit with the 4 th order polynomial. Direct
elimination method is used in the MATLAB to determine the value.

m = 4, n = 15.

n n n

∑ ti = 4.8000 ∑ t i2 = 1.9840 ∑ t i3= 0.9216


i=1 i=1 i=1

n n n

∑ t i4= 0.4565 ∑ t i5= 0.2354 ∑ t i6= 0.1249


i=1 i=1 i=1

n n

∑ t i7= 0.0676 ∑ t i8= 0.0371


i=1 i=1

n n n

∑ yi = 3.2815 ∑ t i yi = 1.1343 ∑ t i2 y i = 0.4878


i=1 i=1 i=1

n n
3
∑ ti yi = 0.2332 ∑ t i4 y i= 0.1191
i=1 i=1

15.0000a0 + 4.8000a1 + 1.9840a2 + 0.9216a3 + 0.4565a4 = 3.2815


4.8000a1 + 1.9840a2 + 0.9216a3 + 0.4565a4 + 0.2354a5 = 1.1343
1.9840a2 + 0.9216a3 + 0.4565a4 + 0.2354a5 + 0.1249a6 = 0.4878
0.9216a3 + 0.4565a4 + 0.2354a5 + 0.1249a6 + 0.0676a7 = 0.2332
0.4565a4 + 0.2354a5 + 0.1249a6 + 0.0676a7 + 0.0371a8 = 0.1191

a0 = 0.6235 a1 = -11.8590 a2 = 82.6079


a3 = -203.7637 a4 = 163.7460

y i = 0.6235 - 11.8590 t i + 82.6079 t i2- 203.7637t i3+ 163.7460 t i4


12

Coding from MATLAB


13

Answer from MATLAB


14

Based on the concept of numerical methods, the first derivative has higher
accuracy that compared with second and third derivative. The accuracy of the data
can be calculated due to the values of relative error.

The exact value for velocity, acceleration, and jerk can be generated from the
4th polynomial equation by using the differentiation method.

y i = 0.6235 - 11.8590 t i + 82.6079 t i2- 203.7637t i3+ 163.7460 t i4


dyi
= - 11.8590 + 165.2158 t i- 611.2911t i2+ 654.9840 t i3
dti
d 2 yi
= 165.2158 - 1222.5822t i+ 1964.9520 t i2
dti 2
d 3 yi
=- 1222.5822 + 3929.9040 t i
dti 3

The approximate value can be determined by using higher accuracy finite


difference approximation.

The relative error is calculated from the exact value and approximate value.
The formula of the relative error is:

εT = |exact value−approximate
exact value
value
|×100 %
15

Coding from MATLAB


16
17

Answer from MATLAB


18
19
20
21
22

The tabular method is difficult to observed the changing in the value of


relative error. The graphs are plotted for the three types of higher accuracy finite
difference approximation in order to examine the patterns and trends.

Coding from MATLAB


23

Answer from MATLAB


24

Based on the plotted graphs, the concept of numerical methods for the first
derivative has higher accuracy than the second and third derivatives is true due to the
trend of the graph. The three graphs show the third derivative has the highest relative
error value which means that it has lowest accuracy compared with each other. The
following higher relative error values are second and third derivatives respectively.
There are low accurate for the three graphs especially at the middle area of graph
which located within 5th station and 10th station due to the high values of relative
error.
25

CONCLUSION

In conclusion, there are many lessons that we can learnt throughout this
project. By doing this project, we can get a better understanding on the operation on
the MATLAB software. This software provides a platform to make the progress of
calculation easier and simpler. Based on the reading of the random vibration test, we
can observe that it is quite fluctuating. The maximum and minimum displacements,
yi are 0.561 in and 0.0125 in respectively. The exact value can be calculated from
the 4th polynomial equation by using the differentiation method. The approximate
value can be determined by using higher accuracy finite difference approximation.
The relative error is calculated from the exact value and approximate value. Based
on the plotted graph of relative error for forward, central and backward difference
approximation against station, i the first derivative is more accurate than the second
and third derivatives due to the calculated low relative error values. The middle area
for all three graphs shows the high values of relative error. The errors are affected by
a lot of factors like human, instruments, environment and so on. The errors of the
vibration test can be reduced by repeating the experiment a few times in order to
obtain the accurate value.
26

REFERENCE

D.M. Causon and C.G. Mingham (2010). Introductory Finite Difference Methods for
PDEs. United Kingdoms: Manchester Metropolitan University.

Steven C. C. & Raymond P. C. (2010). Numerical Methods for Engineers, 6ed.


United State: McGraw-Hill.

William J. Palm III (2008). A Concise Introduction to MATLAB. Singapore:


McGraw-Hill.

Potrebbero piacerti anche