Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

1

I. Use the following methods to integrate (2 cos + 4 ) = sin from =


2
1
to = with a step size of 0.1. The condition at = is = 1. Also, compute for
2
the % error for each.

t y (analytical) y (method used) % error

1. Analytical Solution show solution in obtaining the analytical solution


2. Eulers Method
3. Heuns Method
(compare the graphs of Eulers with analytical solution, Heuns with
analytical solution and Eulers with Heuns Method.)
4. Midpoint Method (compare with analytical)
5. Second Order Runge-Kutta Methods (compare the graph of the three methods
to each other and with the analytical solution)
a. Heun Method without Iteration
b. The Midpoint Method
c. Ralstons Method
6. Classical Fourth-Order Runge Kutta Method (compare the graph with the
analytical solution)

1.) Description of the Problem

The problem asks to find for the solution of the linear ODE (2 cos +
4
) = sin through both analytical and numerical approaches. For determining
the solution through the numerical approach, the methods are as follows: Eulers Method,
Heuns Method, Midpoint Method, Second Order Runge-Kutta Method, Ralston Method,
and Classical Fourth-Order Runge Kutta Method. Also, graphical representations of the
differential solutions are compared as specified. Lastly, % error from among analytical and
numerical solutions is determined.

2.) Approached Used in Solving the Problem

Analytical Solution:

a. Formula/Program: n/a
b. Solution:

(2 cos + 4 ) = sin
2 cos + 4
=
sin
2 ycot = 3

Form:
+ () = ()
() = 2
() = 3

Find the integrating factor u(x),

u(x) = ()
1
u(x) = 2 = 2 = 2

Acquire the solution y,


1
= ()()
()

1
= 2 (3 ) ( 2 ) = 2

= 2 ( + )

Applying condition ( 2 , 1),
1 0

1 = 2 ( + )
2 2
c=1
Therefore,
= 2 ( + 1)

c. Graphs

Analytical Solution
1.400

1.200

1.000

0.800
y

0.600
Analytical Solution
0.400

0.200

0.000
0.000 1.000 2.000 3.000 4.000
x

Shown is the graph representing the analytical solution to the ordinary differential
1
equation evaluated from = 2 to = .
d. Tables/Results

3.) Summary of Answers


t = y (analytical)
0.5 1.570000 0.999203
0.6 1.884000 1.183929
0.7 2.198000 1.040310
0.8 2.512000 0.626933
0.9 2.826000 0.187914
3.140000 0.000005

4.) Difficulty in Solving the Problem


There was no difficulty encountered in solving the problem.

Numerical Methods
Euler Method
a. Formula: +1 = + ( , )

The obtained new values of y will be used in the next trial as initial
value.
b. Program
E12+(2*E12*COT(C12)+(SIN(C12))^3)*(0.1*3.14)
c. Graph

d.
Shown is the graph between the solutions of analytical method and Euler method
1
to the ordinary differential equation evaluated from = 2 to = .
e. Table/Result

f. Difficulty in solving the problem: There was no difficulty in solving


the problem.
Heuns Method
a. Formula:

+1 = + (( , ) + ( + , + ( , )))
2

b. Program: =E3+(1/2*((4*EXP(0.8*A3))-
(0.5*E3)+(4*EXP(0.8*(A3+1)))-(0.5*(E3+(1*((4*EXP(0.8*A3)-
(0.5*E3))))))))

c. Graph

d. Result
e. Difficulty in solving the problem:
There was no problem encountered in solving the problem.

Midpoint Method
a. Formula

+1 = + ( + , + ( , )))
2 2
b. Program
=F5 + E6*0.1*3.14

c. Graph

d. Tables/Results

%error: 0.362, 1.3, 6, 11, respectively

e. Difficulty in solving the problem: There was no problem encountered


in solving the problem.
Second order RK (Heuns Method)
a. Formula
+1 = + (1 1 + 2 2 )
1 = ( , )
2 = ( + 1 , + 11 1 )
2 = 0.5
1 = 1/22
11 = 1/22

b. Program
D6 + 0.5*(E6+F6)*0.1*3.14
c. Graph

d. Tables/Results

% error: 0, 2.16, 5, 8, 20 respectively


e. Difficulty in solving the problem: There was no problem
encountered in solving the problem.
Second order RK (Midpoint)
a. Formula:
+1 = + (1 1 + 2 2 )
1 = ( , )
2 = ( + 1 , + 11 1 )
2 = 1 1 = 1/22 11 = 1/22
b. Program
D18 + (0+F18)*0.1*3.14

c. Graph

d. Table/Result

% error: 0, 0.017, 1.3, 6.5, 11 respectively

e. Difficulty in solving the problem:


There was no problem encountered in solving the problem
Second order RK (Ralstons Method)
a. Formula:
+1 = + (1 1 + 2 2 )
1 = ( , )
2 = ( + 1 , + 11 1 )
2 = 2/3 1 = 1/22 11 = 1/22
b. Program
= D30 + ((1/3)*E30+(2/3)*F30)*0.1*3.14
c. Graphs

d. Result

% error: 0, 20.6, 42.5, 64.5, 46.7 respectively

e. Difficulty in solving the problem:


There was no problem encountered in solving the problem.
Classical 4th Order RK
a. Formula
1
+1 = + (1 + 22 + 23 + 4 )
6
1 = ( , )
1
2 = ( + , + 1 )
2 2
1
3 = ( + , + 2 )
2 2
1
4 = ( + , + 3 )
2 2
b. Program
= D6 + (E6 +2*F6 +2*G6 +H6)*0.1*3.14*(1/6)
c. Graph

d. Result

%error: 0, 0.05, 0.014, 0.10, 2.54


e. Difficulty in solving the problem:
There was no encountered problem in solving the problem
SUMMARY OF ANSWERS

%error %error %error %error (RK- %error (RK- %error (RK- &error (4th
(Euler (Heuns (Midpoint Heuns) Midpoint) Ralstons) order RK)
Method) Method) Method)
0.7969 7.335 0.362 0 0 0 0
9.933146469 9.765 1.3 2.16 0.017 20.6 0.05
21.03995 10.4447 6 5 1.3 42.5 0.014
29.116202 10.6247 11 8 6.5 64.5 0.1
0.97111 20 11 46.7 2.54

\
Adamson University
900 San Marcelino Street, Ermita Manila City
College of Engineering
Chemical Engineering Department

PRACTICAL EXAM 5

Arciaga, Tristan Jedidiah A

201413528

Engr. Patrick Luis Z. Soriano

Instructor

October18, 2017
Adamson University
900 San Marcelino Street, Ermita Manila City
College of Engineering
Chemical Engineering Department

PRACTICAL EXAM 5

Bidua, Kurt B.

201620033

Engr. Patrick Luis Z. Soriano

Instructor

October18, 2017
Adamson University
900 San Marcelino Street, Ermita Manila City
College of Engineering
Chemical Engineering Department

PRACTICAL EXAM 5

Halili, Marienne Bealine S.

Engr. Patrick Luis Z. Soriano

Instructor

October18, 2017
Adamson University
900 San Marcelino Street, Ermita Manila City
College of Engineering
Chemical Engineering Department

PRACTICAL EXAM 5

Villareal, Dominique Niki

Engr. Patrick Luis Z. Soriano

Instructor

October18, 2017
Adamson University
900 San Marcelino Street, Ermita Manila City
College of Engineering
Chemical Engineering Department

PRACTICAL EXAM 5

Megio, Jona

Engr. Patrick Luis Z. Soriano

Instructor

October18, 2017

You might also like