Graphics Programs Reference
In-Depth Information
Here is the outputfrom the program:
>>
x
y1
0.0000e+000
0.0000e+000
2.0000e-001
3.0240e-001
4.0000e-001
5.5450e-001
6.0000e-001
7.3469e-001
8.0000e-001
8.4979e-001
1.0000e+000
9.1813e-001
1.2000e+000
9.5695e-001
1.4000e+000
9.7846e-001
1.6000e+000
9.9020e-001
1.8000e+000
9.9657e-001
2.0000e+000
1.0000e+000
The maximum discrepancybetween the above solution and the one in Exam-
ple 8.1 occurs at x
=
0
.
6. In Example 8.1 wehave y (0
.
6)
=
0
.
072187,sothat the differ-
ence between the solutions is
0
.
073469
0
.
072187
×
100%
1
.
8%
0
.
072187
As the shooting methodused in Example 8.1 isconsiderablymore accurate than the
finite difference method, the discrepancy can be attributed to truncation errors in
the finite difference solution. Thiserrorwouldbe acceptable in many engineering
problems. Again, accuracy can be increasedbyusingafinermesh.With n
=
101we
can reduce the error to 0
07%, but we must questionwhether the tenfoldincrease in
computation time is reallyworth the extra precision.
.
Fourth-Order Differential Equation
For the sake of brevitywelimitour discussion to the specialcase where y and y do
not appear explicitlyinthe differentialequation; that is, weconsider
y (4)
y )
=
f ( x
,
y
,
We assumethattwo boundary conditions are prescribedateach end of the solution
domain ( a
b ). Problemsofthisform arecommonly encounteredinbeam theory.
Again we divide the solutiondomain into n
,
1intervals of length h each.Re-
placing the derivatives of y by finite differences at the mesh points, we get the finite
Search WWH ::




Custom Search