Program 3: Determining the Deflection of a Beam This program will calculate the
ID: 3635336 • Letter: P
Question
Program 3: Determining the Deflection of a BeamThis program will calculate the deflection in a beam subject to a compression load l (see the figure to the right). The beam has been normalized so that the endpoints are 0 and 1. For small values of l the beam will not deflect. As l exceeds p2, the beam will begin to deflect. The program will consist of five parts:
A main module,
A one step differential equation solver (provided),
A forcing routine for the differential equation solver,
A root finder,
A routine to calculate the deflection of the beam at all points.
The function that you are to find the root of should return the value of the deflection of the beam at the right endpoint given the value of the slope of the beam at the left endpoint. The method used to solve this problem is called the Shooting Method. The idea is to adjust the slope at the left endpoint until the beam passes through 0 at the right endpoint. It is based on the concept of adjusting the elevation (slope) of a cannon so that a cannon ball fired from the cannon will pass through a specified point down range.
The prototype for the forcing routine f is
SUBROUTINE FORCE(X, N, Y, YP)
where X is a point along the beam, N is the number of differential equations (2 in this case), Y is an array to contain the displacement and slope at X, and YP is an array of length 2 defined by:
YP(1) = Y(2)
YP(2) = -LAMBDA * SIN(Y(1))
where LAMBDA is the compression load l applied to the beam. Your main program should get the value of l, start the root finder with initial values of 4 then 5 for the slope at the left endpoint, and a tolerance of 5e-6. You should use 0.01 as the distance between points on the beam.
The one step differential equation solver is defined by the following prototype:
SUBROUTINE RK(X, H, N, Y, FORCE)
where X, N and Y are defined as above, H is the distance between successive points along the beam, and FORCE is the name of the forcing routine described above
Explanation / Answer
Program 3.11 (BEAM.F90) PROGRAM beam ! ! Calculate maximum deflection of a beam supported at both ends, ! with the load concentrated at the middle of the beam. ! IMPLICIT NONE REAL length, force, elasticity, moment_of_inertia,deflection ! PRINT *,' Give length (ft), force (lb): ' READ *,length,force PRINT *,' Give elasticity (lb/in^2), moment of inertia (in^4): ' READ *,elasticity,moment_of_inertia ! length=length*12.0 deflection=-force*length**3/(48.0*elasticity*moment_of_inertia) ! PRINT *,'The deflection (in) is: ',deflection ! END
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.