0% found this document useful (0 votes)
91 views3 pages

25.18 Solutions:: Xyk y K y K y K

The document discusses using numerical methods like Runge-Kutta, Euler's method, and Heun's method to solve ordinary differential equations. It provides examples of applying these methods to solve sample ODEs and compares the numerical solutions to analytical solutions. Tables of the results are included showing the step-by-step workings and outputs of the numerical methods.

Uploaded by

Love Strike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views3 pages

25.18 Solutions:: Xyk y K y K y K

The document discusses using numerical methods like Runge-Kutta, Euler's method, and Heun's method to solve ordinary differential equations. It provides examples of applying these methods to solve sample ODEs and compares the numerical solutions to analytical solutions. Tables of the results are included showing the step-by-step workings and outputs of the numerical methods.

Uploaded by

Love Strike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

25.

18 Solutions:
If you solved the problem using Runge-Kutta you should get:
The 4th-order RK method with h = 0.5 gives

x y k1 ym k2 ym k3 ye k4 φ
0 1 -1.1 0.725 -0.75219 0.811953 -0.8424 0.578799 -0.49198 -0.79686
0.5 0.60157 -0.51133 0.473737 -0.25463 0.537912 -0.28913 0.457006 -0.0457 -0.27409
1 0.464524 -0.04645 0.452911 0.209471 0.516892 0.239062 0.584055 0.671663 0.253713
1.5 0.59138 0.680087 0.761402 1.494252 0.964943 1.893701 1.538231 4.460869 1.986144
2 1.584452 4.594911 2.73318 10.83023 4.292008 17.00708 10.08799 51.95317 18.70378

If you solved the problem 25.1 using


Euler’s method with h = 0.5

x y dy/dx
0 1 -1.1
0.5 0.45 -0.3825
1 0.25875 -0.02588
1.5 0.245813 0.282684
2 0.387155 1.122749

27.2 Solutions: Re-express the second-order equation as a pair of ODEs:

dT
=z
dx
dz
= 0.15T
dx

The solution was using the Heun method (without iteration) with a step-size of 0.01.
An initial condition of z = −120 was chosen for the first shot. The first few calculation
results are shown below.

x T z k11 k12 Tend zend k21 k22 φ1 φ2


0 240.000 -120.000 -120.000 36.000 228.000 -116.400 -116.400 34.200 -118.200 35.100
0.1 228.180 -116.490 -116.490 34.227 216.531 -113.067 -113.067 32.480 -114.779 33.353
0.2 216.702 -113.155 -113.155 32.505 205.387 -109.904 -109.904 30.808 -111.529 31.657
0.3 205.549 -109.989 -109.989 30.832 194.550 -106.906 -106.906 29.183 -108.447 30.007
0.4 194.704 -106.988 -106.988 29.206 184.006 -104.068 -104.068 27.601 -105.528 28.403
0.5 184.152 -104.148 -104.148 27.623 173.737 -101.386 -101.386 26.061 -102.767 26.842

The resulting value at x = 10 was T(10) = −1671.817. A second shot using an initial
condition of z(0) = −60 was attempted with the result at x = 10 of T(10) = 2047.766.
These values can then be used to derive the correct initial condition,

− 60 + 120
z (0) = −120 + (150 − (−1671.817)) = −90.6126
2047.766 − (−1671.817)
The resulting fit, along with the two “shots” are displayed below:

3000

2000

1000

0
0 2 4 6 8 10
-1000

-2000

The final shot along with the analytical solution (displayed as filled circles) shows
close agreement:

200
150
100
50
0
0 2 4 6 8 10

27.3 Solution
A centered finite difference can be substituted for the second derivative to give,

Ti +1 − 2Ti + Ti −1
− 0.15Ti = 0
h2

or for h = 1,

− Ti −1 + 2.15Ti − Ti +1 = 0

The first node would be

2.15T1 − T2 = 240

and the last node would be

− T9 + 2.15T10 = 150

The tridiagonal system can be solved with the Thomas algorithm or Gauss-Seidel for
(the analytical solution is also included)
x T Analytical
0 240 240
1 165.7573 165.3290
2 116.3782 115.7689
3 84.4558 83.7924
4 65.2018 64.5425
5 55.7281 55.0957
6 54.6136 54.0171
7 61.6911 61.1428
8 78.0223 77.5552
9 106.0569 105.7469
10 150 150

The following plot of the results (with the analytical shown as filled circles) indicates
close agreement.

240

160

80

0
0 2 4 6 8 10

You might also like