
© 2001 by CRC Press LLC
The Subprogram FUNCTION F which defines the initial-value problem is coded
in accordance with Equation 14. The two trial initial slopes are selected as equal to
0.1 and 0.2. The trial results are kept in the three-dimensional variable XT, in which
the deflection y
(k)
(j) for the kth try at station x = x
j
= jh is stored in XT(1,j,k) whereas
the slope there is stored in XT(2,j,k) for j = 1,2,…,30 and k = 1,2. Such a three-
subscripts arrangement facilitates the calling of the subroutine RKN because
XT(1,KS,NTRY) is transmitted as XIN(1) and automatically the next value
XT(2,KS, NTRY) as XIN(2), and the computed results XOUT(1) and XOUT(2) are
to be stored as XT(1,KS + 1,NTRY) and XT(2,KS + 1,NTRY), respectively. Notice
that there are only two dependent variables, NV = 2.
After the weighting coefficients (ALPHA in the program) and (BETA) have
been calculated, the final distributions of the deflection and slope are saved in first
and second rows of the two-dimensional variable X, respectively. It should be
emphatically noted that the solutions obtained is only good for the selected stepsize
h = 1 cm. Whether it is accurate or not remains to be tested by using finer stepsizes
and by repeated application of the Runge-Kutta methods.
It can be shown that the maximum deflection of the loaded beam is equal to
–2.019 cm and is obtained when the stepsize is continuously halved and two con-
secutively calculated values is different less than 0.0001 cm in magnitude. The
needed modification of the above listed program to include this change in the stepsize
and testing of the difference in the maximum deflection is left as homework for the
reader.