Graphics Programs Reference
In-Depth Information
The analytical solutionyields
31
32 e 4(0 . 2)
1
4 (0
1
8 (0
1
32 =
2) 2
y (0
.
2)
=
+
.
.
2)
+
0
.
4515
so that the actualerroris0
.
4515
0
.
4539
=−
0
.
0024.
EXAMPLE 7.2
Solve
y =−
1 y
y (0)
0
.
x
y (0)
=
0
=
1
=
=
.
from x
0to2with the Taylor series method of order four using h
0
25.
y the equivalent first-order equations and initialcon-
Solution With y 1 =
y and y 2 =
ditions are
y 1
y 2
0
1
y 2
y =
=
y (0)
=
0
.
1 y 2
x
Repeateddifferentiation of the differentialequations yields
y 2
0
.
1 y 2
x
y =
=
1 y 2
0
.
1
0
.
01 y 2
+
0
.
1 x
1
0
1 y 2
0
.
1
.
01 y 2 +
0
.
1 x
1
y =
=
0
.
01 y 2 +
0
.
1
0
.
001 y 2
0
.
01 x
+
0
.
1
0
01 y 2 +
.
0
.
1
0
.
001 y 2
0
.
01 x
+
0
.
1
y (4)
=
=
001 y 2
0
.
0
.
01
0
.
0001 y 2 +
0
.
001 x
0
.
01
Thus the derivative array requiredby taylor is
.
1 y 2
y 2
0
x
0
.
1 y 2
x
0
.
01 y 2
+
0
.
1 x
1
d
=
0
.
01 y 2 +
0
.
1 x
1
0
.
001 y 2
0
.
01 x
+
0
.
1
0
.
001 y 2
0
.
01 x
+
0
.
1
0
.
0001 y 2 +
0
.
001 x
0
.
01
which iscomputedby
_
functiond=fex7
2(x,y)
% Derivatives used in Example 7.2
d = zeros(4,2);
d(1,1) = y(2);
d(1,2) = -0.1*y(2) - x;
d(2,1) = d(1,2);
d(2,2) = 0.01*y(2) + 0.1*x -1;
Search WWH ::




Custom Search