ODE Ch3 Ex15
Numerical Solution to dy/dt = f(t,y)
Name
2
0
-2 2
-4
-6
-8
-10
-12
Rohan Rahman
Modified Euler Method
y
2.5
3
3.5
f(t,y)
y-t
Exact solution (if known)
((-2)/EXP(2))*EXP(t)+1+t
Initial Conditions
Initial time
2
Final time
4
Initial y value
1
Approximation Data
# of subintervals
200
4
t
y
(approx)
y
2
0
t (time)
-2 2
2
-4
2.01
-6
2.02
-8
-102.03
-122.04
2.05
2.06
2.07
2.08
2.09
2.1
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.2
2.21
2.22
2.23
2.24
2.25
2.26
2.27
2.28
2.29
Euler Method
yapprox
2.5
1.000
0.990
0.980
0.969
0.958
0.947
0.936
0.925
0.913
0.902
0.890
0.877
0.865
0.852
0.839
0.826
0.813
0.799
0.786
0.772
0.757
0.743
0.728
0.713
0.698
0.682
0.666
0.650
0.634
0.617
yexact
3.5
1.000
0.990
0.980
0.969
0.958
0.947
0.936
y
(approx)
0.925
0.913
0.902
0.890
0.877
0.865
0.852
0.839
0.826
0.813
0.799
0.786
0.772
0.757
0.743
0.728
0.713
0.698
0.682
0.666
0.650
0.634
0.617
3
Type Comments Here:
Ch3 Ex15
y'approx a) C=((-2)/e^2) y= ((2)/e^2)e^t+1+t
4
-1.000
-1.020
b) Modified Euler method
-1.040The table below shows the data in the
following,
-1.061
-1.082
(50, -9.770)
t-1.103
(100, -9.776)
-1.124
(200, -9.778)
-1.145
(400, -9.778)
-1.167
-1.188
Since we have y(4)= -9.778 for both n=200
-1.210
and n=400, we only need n=200 to achieve
-1.233
our 3 decimal place accuracy.
-1.255
-1.278 Euler Method
The table below shows the data in the
-1.301
following,
-1.324
(50, -9.213)
-1.347
(100, -9.489)
-1.371
(200, -9.632)
-1.394
(400, - 9.705)
-1.418
(800, -9.741)
-1.443
(1600, -9.760)
-1.467
(3200, -9.769)
-1.492
(6400, -9.773)
(10000, -9.775)
-1.517
(20000, -9.777)
-1.542
(40000, -9.777)
-1.568
Since we have y(4)= -9.777 for both
-1.594
n=20000 and n=40000, we only need
-1.620
n=20000 to achieve our 3 decimal place
-1.646
accuracy
-1.673
Page 1