Graphics Programs Reference
In-Depth Information
Second-Order Differential Equation
Consider the second-orderdifferentialequation
y
=
y
)
f
(
x
,
y
,
with the boundary conditions
or
y
(
a
)
y
(
a
)
=
α
=
α
or
y
(
b
)
y
(
b
)
=
β
=
β
Approximating the derivatives at the mesh points by finite differences, the prob-
lembecomes
f
x
i
,
,
y
i
−
1
−
2
y
i
+
y
i
+
1
−
y
i
+
1
y
i
−
1
=
y
i
,
i
=
1
,
2
,...,
n
(8.9)
h
2
2
h
y
2
−
y
0
y
1
=
α
or
=
α
(8.10a)
2
h
y
n
+
1
−
y
n
−
1
y
n
=
β
or
=
β
(8.10b)
2
h
Note the presence of
y
0
and
y
n
+
1
, which are associatedwith points outside the solution
domain (
a
b
). This “spillover” can beeliminatedbyusing the boundary conditions.
But before we dothat, let us rewrite Eqs. (8.9) as
,
h
2
f
x
1
,
y
2
−
y
0
y
0
−
2
y
1
+
y
2
−
y
1
,
=
0
(a)
2
h
h
2
f
x
i
,
y
i
+
1
−
y
i
−
1
y
i
−
1
−
2
y
i
+
y
i
+
1
−
y
i
,
=
0,
i
=
2
,
3
,...,
n
−
1
(b)
2
h
h
2
f
x
n
y
n
+
1
−
y
n
−
1
y
n
−
1
−
2
y
n
+
y
n
+
1
−
,
y
n
,
=
0
(c)
2
h
The boundary conditionson
y
areeasilydealt with:Eq. (a) issimplyreplaced
by
y
1
0. If
y
are prescribed, weobtain
−
α
=
0 and Eq. (c) is replacedby
y
n
−
β
=
fromEqs. (8.10)
y
0
=
, which are then substitutedinto
Eqs. (a) and (c), respectively. Hence we finish up with
n
equations in the unknowns
y
i
,
i
y
2
−
2
h
α
and
y
n
+
1
=
y
n
−
1
+
2
h
β
=
1
,
2
...,
n
:
y
1
−
α
=
0
if
y
(
a
)
=
α
(8.11a)
−
2
y
1
+
2
y
2
−
h
2
f
(
x
1
,
y
1
,α
−
2
h
α
=
0 if
y
(
a
)
=
α
)
h
2
f
x
i
,
y
i
+
1
−
y
i
−
1
y
i
−
1
−
2
y
i
+
y
i
+
1
−
y
i
,
=
0
i
=
2
,
3
,...,
n
−
1
(8.11b)
2
h
y
n
−
β
=
0
if
y
(
b
)
=
β
(8.11c)
h
2
f
(
x
n
,
0 if
y
(
b
)
2
y
n
−
1
−
2
y
n
−
y
n
,β
+
2
h
β
=
=
β
)
Search WWH ::
Custom Search