1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Need help Matlab programming for shear force and bending moment diagrams of a beam

  1. Apr 13, 2012 #1
    Need help!!Matlab programming for shear force and bending moment diagrams of a beam

    1. The problem statement, all variables and given/known data
    A program is required that will calculate the shear force and bending moment diagrams for a
    cantilevered beam of arbitrary length. The loads may be point loads or distributed loads,or a combination of the two, but no moments will be directly applied to the beam.

    The user will be required to specify the length of the cantilevered beam from the wall in metres.The user will then be required to indicate if the loads applied to the beam are only point loads,only distributed loads or a combination of constant distributed and point loads. Based on this input, they will then be required to select either one or two .xlsx files containing the specification of the applied loads. The calculated shear force and bending moment diagrams must then be presented to the user. If the user wishes to, they must be allowed to enter axis labels and a legend for each of these and then save these diagrams. Once the figures have been closed, the shear force and bending moment data must be saved to LoadingData.csv in the same directory as the input point force data (or distributed data if no point loads are applied) which must contain the distance along the beam in metres, with a minimum resolution of 1 mm, in the first column, the shear force in Newtons in the second column and the bending moment in Newton-metres in the third column. At the same time, the reaction shear force and moment at the wall must be displayed to the user. All distances must be given in the reference frame shown in the figure above and all forces will be given according to the indicated notation. In the point load input files, there will be two columns of data. The first column will contain the distance from the wall in metres at which the load (in Newtons) indicated in the second column is applied. Similarly, the distributed load input files will contain data in three columns of data. The first two columns will give the limits in metres from the wall, in no particular order, between which the distributed load is applied. The constant value of the distributed load, 2 in Newtons per metre, will be given in the third column. In both cases there is no limit to the number of loads (i.e. rows of data) which may be applied. If the files contain a load which is applied beyond the end of the beam, the program must ignore that load entirely. The shear force diagram can be calculated by determining the shear force diagram for each of the applied loads and ’adding’ all of these diagrams together (the principle of superposition). Once the shear force diagram is known, the bending moment diagram can be determined by integrating the shear force diagram from the free end to the beam support (since the bending moment at the free end must be zero).
    A simple method of integrating the shear force diagram to produce the bending moment diagram is the trapezoidal method. must be via GUIs. Bonus marks, up to a maximum of 10%, are allowed for features that make the program more generically applicable, flexible or decidedly robust


    3. So far I am trynig to plot the shear force diagram for the beam experiencing only point loads.My graph is incorrent and I would realy appreciate if someone would correct the code I have so far.Here is my code so far:

    L=inputdlg('please enter beam length');

    Q=questdlg('what types of loads are applied to the beam?', ...
    'types of loads', ...
    'point loads only','distributed loads only','combination','combination');
    switch Q
    case'point loads only'
    V=B(:,2);% point loads
    X=B(:,1);%position of point loads along beam

    shear=-(sum(V));%shear1=reaction force at root of beam

    for n=(0:0.01:L);
    if x1<=X(1)

    if X(1)<n<=X(2);
    if X(2)<n<X(3);
    if X(3)<n<=L

  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted