Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
0030770<, u@rD, rD
Chop
::u@rD ® >>
0.0159998 + 0.000134628 r2
r
0.015999794871794815` + 0.00013462820512820557` r2
u@r_D :=
r
h = 0.75;
r@0D = 5;
4 8. 80.00362322, 0.000098961<
r@0D = 5;
4 8. 80.00296647, - 0.000073449<
g = Interpolation@880.0036232172706121856`, - 0.00026538<,
80.0029664674191458985`, - 2 * 0.00026538<<, InterpolationOrder ® 1D
InterpolatingFunction@880.00296647, 0.00362322<<, <>D
g@0.0030770D
- 0.000486096
r@0D = 5;
4 8. 80.003077, - 0.000044432<
5 0.0038731 0.0038731 0
8. 0.003077 0.003077 0
r@0D = 5;
RungeKutta@f_, t_, h_, y_, yp_D := Block@8deltay, k1, k2, k3, k4<,
k1 = yp;
k2 = f@t + 1 2 h, y + 1 2 h k1D;
k3 = f@t + 1 2 h, y + 1 2 h k2D;
k4 = f@t + h, y + h k3D;
deltay = h H1 6 k1 + 1 3 k2 + 1 3 k3 + 1 6 k4L;
deltay
D;
While@i < 5,
8r@iD = r@i - 1D + h; x@iD = x@i - 1D + RungeKutta@f, r@i - 1D, h, x@i - 1D, f@r@i - 1D, x@i - 1DDD,
Print@i, " ", r@iD, " ", x@iDD; i ++<D
CHE 560 Shooting.nb 3
4 8. 80.00366202, 0.0000514982<
r@0D = 5;
While@i < 5,
8r@iD = r@i - 1D + h; x@iD = x@i - 1D + RungeKutta@f, r@i - 1D, h, x@i - 1D, f@r@i - 1D, x@i - 1DDD,
Print@i, " ", r@iD, " ", x@iDD; i ++<D
1 5.75 80.00353892, - 0.000371596<
4 8. 80.00301517, - 0.000133023<
g = Interpolation@880.0036620193629771296`, - 0.00026538<,
80.0030151707608106594`, - 2 * 0.00026538<<, InterpolationOrder ® 1D
InterpolatingFunction@880.00301517, 0.00366202<<, <>D
g@0.0030770D
- 0.000505394
r@0D = 5;
While@i < 5,
8r@iD = r@i - 1D + h; x@iD = x@i - 1D + RungeKutta@f, r@i - 1D, h, x@i - 1D, f@r@i - 1D, x@i - 1DDD,
Print@i, " ", r@iD, " ", x@iDD; i ++<D
1 5.75 80.0035567, - 0.000349323<
4 8. 80.003077, - 0.000115386<
r exact RK percent
relative error
5 0.0038731 0.0038731 0
8. 0.003077 0.003077 0
0.0038
0.0036
solution
0.0034
0.0032
r
CHE 560 Shooting.nb 5
Clear@uD
r@0D = 5;
RungeKutta@f_, t_, h_, y_, yp_D := Block@8deltay, k1, k2, k3, k4<,
k1 = yp;
k2 = f@t + 1 2 h, y + 1 2 h k1D;
k3 = f@t + 1 2 h, y + 1 2 h k2D;
k4 = f@t + h, y + h k3D;
deltay = h H1 6 k1 + 1 3 k2 + 1 3 k3 + 1 6 k4L;
deltay
D;
h = 0.1;
10 6. 80.00369439, - 0.000106491<
20 7. 80.00363948, - 0.0000106861<
30 8. 80.00366196, 0.000051495<
r@0D = 5;
10 6. 80.00345112, - 0.000331327<
20 7. 80.00318455, - 0.000211075<
30 8. 80.0030151, - 0.000133027<
g = Interpolation@880.003661960017826846`, - 0.00026538<,
80.003015096272375776`, - 2 * 0.00026538<<, InterpolationOrder ® 1D
InterpolatingFunction@880.0030151, 0.00366196<<, <>D
g@0.0030770D
- 0.000505364
r@0D = 5;
10 6. 80.0034744, - 0.000309811<
20 7. 80.00322808, - 0.000191898<
30 8. 80.003077, - 0.000115369<
CHE 560 Shooting.nb 9
85, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6., 6.1, 6.2, 6.3, 6.4,
6.5, 6.6, 6.7, 6.8, 6.9, 7., 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 8.<
tblRK = Table@x@iD@@1DD, 8i, 0, 30<D
r exact RK percent
relative error
5 0.0038731 0.0038731 0
8. 0.003077 0.003077 0
0.0038
0.0036
solution
0.0034
0.0032