31 views

Uploaded by Micro Yuchen

- 08.03 - Runge-Kutta 4th Order Method for ODE
- CMME-1-Report.docx
- structural optimization
- Lecture 20 Rev 1(1)
- TIME-DEPENDENT METHODS
- Evolutionary Population Dynamics and Grasshopper Optimization Approaches for Feature Selection Problems
- 210 Inequalities
- handout2
- XII Maths DPP (26) - Prev Chaps - Probability - Differential Equation
- IJEAS0211015
- Chapter 2 Polynomials)
- Binary Cuckoo Search
- paper of management science 2007.doc
- Dc Program Demo
- ME3040 & ME5090_20160831- B-Spline Curves
- 10257-2.7-12P.docx
- Lecture 7
- Non Linear Shooting Algorithm Boundary Value Problem Numerical Analysis Matlab Code
- Niesen2004.pdf
- timestepping_2014

You are on page 1of 11

LAB REPORT

COMPUTATIONAL METHODS FOR MECHANICAL

ENGINEER

EME 3156

TRIMESTER 2 (2015/2016)

Experimen

t1

Date of

Experimen

t

17th December 2015

Student Name

Lee Chng Keat

Student ID

1122700207

Objectives:

1. Using excel to solve ODE initial value problems.

2. Using different method to solve the problem which is Euler method, Midpoint

3. Find out the method that gives the most accurate answer.

y = 1+(y/t)+(y/t)^2 , y(1) = 0, y(3) = ?

t

c +log

y(t) =

t tan

When t = 1, y = 0

1 = 1 tan (c + log 1)

c=0

3

0+ log

y(t) =

( 3 ) tan

y = 5.8741

7

6

5

4

3

2

1

0

Let h = 0.05 i=1

t1 = 1.05 y1 = 0.05 h = 0.05

f(t1,y1) = 1 + (y1/t1) + ( y1/t1)2

= 1.049887

y2 = 157587

When t=3

Error (h=0.05) = |5.8741-5.420458| = 0.453642

Error (h=0.1) = |5.8741-5.05988| = 0.81422

Error (h=0.2) = |5.8741-4.514277| = 1.359823

Error (h=0.5) = |5.8741-3.54973| = 2.32437

Error (h=1.0) = |5.8741-2.75| = 3.1241

7

6

5

4

3

Exact

h = 0.05

h = 0.1

h = 0.5

h = 0.2

h=1

Let h=0.05 i=1

t1 = 1.05, y1 =0.051249, h = 0.05

K1=f(t1,y1) = 1 + (y1/t1) + ( y1/t1)2

= 1.051191

tm = ti + h/2 = 1.05 + 0.05/2 = 1.075

ym = yi + (h/2)K1 = 0.051249 + (0.05/2)* 1.051191 = 0.077529

K2 = f(tm,ym) = 1 + (ym/tm) + ( ym/tm)2

= 1.077321

Y2 = y1 + hK2

= 0.105115

When t=3

Error (h=0.05) = |5.8741-5.864075| = 0.010025

Error (h=0.1) = |5.8741-5.836088| = 0.038012

Error (h=0.2) = |5.8741-5.738647| = 0.135453

Error (h=0.5) = |5.8741-5.287636| = 0.586464

Error (h=1.0) = |5.8741-4.524779|= 1.349321

7

6

5

4

Exact

h = 0.05

h = 0.1

h = 0.2

h = 0.5

h=1

Fourth order Runge-Kutta method equation: yi+1 = yi +

h

6 (K1+2K2+2K3+K4)

t1 = 1.05, y1 = 0.05127, h = 0.05

K1 = f(t1,y1) = 1 + (y1/t1) + ( y1/t1)2

= 1.051213

tm = ti + h/2 = 1.05 + 0.05/2 = 1.075

ym1 = yi + (h/2)*K1 = 0.05127 + (0.05/2)* 1.051213= 0.077551

K2 = f(tm,ym1) = 1 + (ym1/tm) + ( ym1/tm)2

= 1.077344

ym2 = yi + (h/2)*K2 = 0.05127+ (0.05/2)* 1.077344= 0.078204

K3 = f(tm,ym2) = 1 + (ym2/tm) + ( ym2/tm)2

= 1.07804

ti+1 = ti + h = 1.05 + 0.05 = 1.1

ym3 = yi + hK3 = 0.05127 + 0.05*1.07804 = 0.105172

K4 = f(ti+1,ym3) = 1 + (ym3/ti+1) + ( ym3/ti+1)2

= 1.104753

yi+1 = yi +

h

6 (K1+2K2+2K3+K4)

= 0.10516

When t=3

Error (h=0.05) = |5.8741-5.874099| = 0.000001

Error (h=0.1) = |5.8741-5.874083| = 0.000017

Error (h=0.2) = |5.8741-5.873839| = 0.000261

Error (h=0.5) = |5.8741-5.865642| = 0.008458

Error (h=1.0) = |5.8741-5.776963| = 0.097137

7

6

5

4

3

Exact

h = 0.05

h = 0.1

h = 0.2

h = 0.5

h=1

y i+1 = yi +

h

2 (K1+K2)

t1 = 1.05, y1 = 0.51247, h = 0.05

K1 = f(t1,y1) = 1 + (y1/t1) + ( y1/t1)2

= 1.051189

ti+1 = ti+1 + h = 1.05 + 0.05 = 1.1

P

P

= 1.103275

C

= 0.105109

When t=3

Error ( h=0.05) = |5.8741-5.861999| = 0.012101

Error (h=0.1) = |5.8741-5.827854| = 0.046246

Error (h=0.5) = |5.8741-5.149066| = 0.725034

Error (h=1.0) = |5.8741-4.238567| = 1.635533

7

6

5

4

3

2

1

0

Exact

h = 0.05

h = 0.1

h = 0.2

h = 0.5

h=1

When h=0.05, t=3:

Error (Euler) = |5.8741-5.420458| = 0.453642

Error (Midpoint) = |5.8741-5.864075| = 0.010025

Error (RK4) = |5.8741-5.874099| = 0.000001

Error (Predictor-Corrector) = |5.8741-5.861999| = 0.012101

7

6

5

4

3

Exact

Euler Method

Midpoint Method

Runge-Kutta Method

Exercise

Given:

dL

dt

dS

dt

Si+1 = Si + h(0.5 Si 0.001 Li Si)

h = 0.5

Number of

Species

3500

3000

2500

2000

1500

1000

500

0

0

Lion

Sheep

50

100

150

200

Time

h = 0.2

2000

1500

Lion

Number of 1000

Species

500

0

0

Sheep

50

Time

h = 0.05

1400

1200

1000

Number of Species

800

Lion

600

Sheep

400

200

0

0

50

100

150

200

Time

Discussions:

From the result shown in the table and graphs, we know that the smaller the value of step size

the lesser the percentage of error. The value in this case also will make the value to be much

more accurate by comparing to the exact value. All of the result we have calculated, h=0.05

will give the result which have the less error so we use h=0.05 for all method to compare with

method gives the lesser percentage of error and we find out it is Runge-Kutta Method (RK4).

For the exercise we have done for predator prey problem, we can see that the lions and sheep

growth in relation of time. The growth and death of this two species is vice versa to each

other. The lower step size value give a more accurate value because the number of species

against time did not deflect largely and maintain in a smooth curve.

Conclusions:

In a nut shell, we found that Runge-Kutta (RK4) method will give the best answer

which is accurate to the exact value which can be seen in the graph. This is because the other

method uses simpler calculation and lesser effort to gain the answer so the value we achieve

is less accurate to the exact method. In this lab, we have learn how to use excel to do the

calculation because in this kind of problem which required a lots of repeated steps in

calculation will cause a lot of human error without the aids of excel. We uses excel to get

lesser error as possible.

- 08.03 - Runge-Kutta 4th Order Method for ODEUploaded byEnos Lolang
- CMME-1-Report.docxUploaded byMicro Yuchen
- structural optimizationUploaded byMariapaola D'Imperio
- Lecture 20 Rev 1(1)Uploaded bySushant Mishra
- TIME-DEPENDENT METHODSUploaded bymanreza
- Evolutionary Population Dynamics and Grasshopper Optimization Approaches for Feature Selection ProblemsUploaded byAnonymous mDBJaN
- 210 InequalitiesUploaded byswapnil
- handout2Uploaded byJeff Hardy
- XII Maths DPP (26) - Prev Chaps - Probability - Differential EquationUploaded byBharat Kasera
- IJEAS0211015Uploaded byerpublication
- Chapter 2 Polynomials)Uploaded byvishal_bokaro
- Binary Cuckoo SearchUploaded byChetan Mishra
- paper of management science 2007.docUploaded byVikizz Ag
- ME3040 & ME5090_20160831- B-Spline CurvesUploaded bySaiRam
- 10257-2.7-12P.docxUploaded byneeti
- Lecture 7Uploaded byMohammadReza Alam
- Dc Program DemoUploaded byudslv
- Non Linear Shooting Algorithm Boundary Value Problem Numerical Analysis Matlab CodeUploaded byshankar
- Niesen2004.pdfUploaded bywill bell
- timestepping_2014Uploaded byanalysethat
- LagrangeUploaded byCarlos Vásquez
- article.pdfUploaded byErcherio Marpaung
- derivation 1Uploaded byapi-439804358
- Traffic Flow ProblemsUploaded byAJ
- 3.1. Logistic RegressionUploaded byCalin Popescu
- CS5234_final_2014Uploaded byRx
- RAMA TUGAS.docxUploaded byAllyza Nanda
- 19_PalmprintUploaded bytidjani86
- SolutionsODE.pdfUploaded bymimahmoud
- 02-20 to 03-02 h math 2 assignmentsUploaded byapi-368121935

- 89799_Wind2016Uploaded byMicro Yuchen
- CMME4 20151V4.xlsxUploaded byMicro Yuchen
- CMME-2-Report.docxUploaded byMicro Yuchen
- 50843_CMME4 20151V8.xlsxUploaded byMicro Yuchen
- ce-1.docxUploaded byMicro Yuchen
- HT assigment.pdfUploaded byMicro Yuchen
- Examples Hydrostatic, Buoyancy and Rigid Body RotationUploaded byMicro Yuchen

- LAB_1Uploaded byGarvit Goyal
- Honors Advanced Calculus and Linear Algebra p2Uploaded bymarchelo_chelo
- os labUploaded byMd Abid Ali
- 2.5.1.2Uploaded bypromaster681
- 5 Hocevar Jaklic FinalUploaded byRaghuram Seshabhattar
- E560_BCU04_DSUploaded byYasser Ragab
- Complexity and Self-organizationUploaded byGiorgio Bertini
- CN Lab ManualUploaded bySamya K Narayanmurthy
- How to Be a Programmer_ a S...Uploaded byiapwla
- The Myth of RequirementsUploaded byAlan McSweeney
- MCSD Certification Ch02 Cheat SheetUploaded byUtsab Bagchi
- ResourcesUploaded byFinkle Art
- ACRONIMOS HUAWEIUploaded byhmendezp
- Booth 4 8 RadixUploaded byAshok Koyyalamudi
- SynopsisUploaded byReshma Hedaoo
- Povray TutorialUploaded byAdolf Reyes
- credits.rtfUploaded bya_gosic
- Cyber Nations User Player GuideUploaded byOzread
- UltraMixer 3.2 UserguideUploaded bycoooolns
- 17SARelationshipUploaded bySiva Pittu
- 9781782170662_Implementing_Cisco_UCS_Solutions_Sample_ChapterUploaded byPackt Publishing
- Summer Internship ProposalUploaded byyogesh_thore001
- Types of Bench MarkingUploaded byalya_roslam
- By Lance HuntUploaded bynoname210981
- Angularjs SuccinctlyUploaded byAndre Richardson
- Chap 4 UpdatedUploaded byShihabAkhand
- Chapter 2 - Operations Management.pptxUploaded byAnagha Pranjape
- Auto InvoiceUploaded bysignup4deals
- GS48D17A00-00E-N_004_AI-917-A0Uploaded byAkoKhaledi
- Help Eclipse SDKUploaded byMuhedin Hadzic