'****************************************************************************** '* Calculates beam deflection (in) for four different support/loading systems * '* -------------------------------------------------------------------------- * '* SAMPLE RUN: * '* * '* Give elasticity (lb/in^2) and moment of inertia (in^4): 30e6,797 * '* Give the beam length in ft: 20 * '* Choose one of these support/loading systems: * '* 1 - supported at each end, concentrated load * '* 2 - supported at each end, uniformly distributed load * '* 3 - supported at one end, concentrated load at free end * '* 4 - supported at one end, distributed load * '* Input your choice (1 to 4): 1 * '* Give the concentrated force: 50000 * '* * '* Deflection = -0.6023 * '* * '* More? (y/n): y * '* * '* Give elasticity (lb/in^2) and moment of inertia (in^4): 30e6,797 * '* Give the beam length in ft: 20 * '* Choose one of these support/loading systems: * '* 1 - supported at each end, concentrated load * '* 2 - supported at each end, uniformly distributed load * '* 3 - supported at one end, concentrated load at free end * '* 4 - supported at one end, distributed load * '* Input your choice (1 to 4): 3 * '* Give the concentrated force: 10000 * '* * '* Deflection = -1.9272 * '* * '* More? (y/n): n * '* -------------------------------------------------------------------------- * '* Reference: "Problem Solving with Fortran 90 By David R. Brooks, Springer- * '* Verlag New York, 1997". * '* * '* Basic Version By J-P Moreau, Paris. * '* (www.jpmoreau.fr) * '****************************************************************************** DEFINT I-N ' float elasticity, lb/in^2 ' xmoment, in^4 ' xlength, ft ' xload, lb ' deflection in ' int IDsystem 1 - supported at each end, concentrated load ' 2 - supported at each end, distributed load ' 3 - supported one end, concentrated at free end ' 4 - supported one end, distributed ' char YesNo$ 10 CLS : PRINT INPUT " Give elasticity (lb/in^2), moment of inertia (in^4): ", elasticity, xmoment INPUT " Give the beam length in ft: ", xlength PRINT PRINT " Choose one of these support/loading systems:" PRINT " 1 - supported at each end, concentrated load" PRINT " 2 - supported at each end, uniformly distributed load" PRINT " 3 - supported at one end, concentrated load at free end" PRINT " 4 - supported at one end, distributed load" INPUT " Input your choice (1 to 4): ", IDsystem PRINT IF IDsystem = 1 THEN INPUT " Give the concentrated force: ", xload ELSEIF IDsystem = 2 THEN INPUT " Give the distributed weight: ", xload ELSEIF IDsystem = 3 THEN INPUT " Give the concentrated force: ", xload ELSEIF IDsystem = 4 THEN INPUT " Give the distributed weight: ", xload END IF xlength = xlength * 12 IF IDsystem = 1 THEN deflection = -xload * xlength ^ 3 / (48 * elasticity * xmoment) ELSEIF IDsystem = 2 THEN deflection = -5 * xload * xlength ^ 3 / (384 * elasticity * xmoment) ELSEIF IDsystem = 3 THEN deflection = -xload * xlength ^ 3 / (3 * elasticity * xmoment) ELSEIF IDsystem = 4 THEN deflection = -xload * xlength ^ 3 / (8 * elasticity * xmoment) END IF PRINT PRINT " Deflection = "; deflection INPUT " More? (y/n): ", YesNo$ IF YesNo$ = "y" THEN GOTO 10 PRINT END ' end of file beam.bas