The University of Maine
  Calendar  |  Campus Map  |  Search:
About UMaine | Student Resources | Prospective Students
Faculty & Staff
| Alumni | Arts | News | Parents | Research

Mechanical Engineering Links

division
 Home division
 What is Mechanical
 Engineering?

division
 Undergraduate
 Program

division
 Undergraduate
 Scholarships

division
 Graduate Program
division
 Research
division
 Senior Design
 Projects

division
 Faculty and Staff
division
 Mission Statement
division
 Crosby Laboratory
division
 Intranet
division
 Alumni and Friends
division
 Alumni Registration
division
 Open Faculty Position
division
 College of
 Engineering
 

 ASME

 Pi Tau Sigma


Senthil S. Vel

MEE 381: Design II

MATLAB SCRIPT FILES

M-files for Plotting Shear Force and Bending Moment Diagrams

%----------------------------------- s.m -----------------------------
%--Copy this into a separate file and name it as s.m-----
function v =s(x,a,n)
%------ Definition of singularity function -----------
%This function will return the value of the singularity function <x-a>^n.
if x<a
v = 0;
else
v = (x-a)^n;
end
%--------------------------------------------------------------------

 

 

%----------------------------- V.m -----------------------------------
%--Copy this into a separate file and name it as V.m ----
function val = V(x)
%------ Expression for the shear force ---------------
%This function will return the value of the shear force V(x).
P=500;
b=0.4;
l=1.0;

val = P*(1-b/l)*s(x,0,0)-P*s(x,b,0)+(P*b/l)*s(x,l,0);
%--------------------------------------------------------------------

 

 

%----------------------------- M.m -----------------------------------
%--Copy this into a separate file and name it as M.m ----
function val = M(x)
%------ Expression for the bending moment ------------
%This function will return the value of the bending moment M(x).
P=500;
b=0.4;
l=1.0;

val = P*(1-b/l)*s(x,0,1)-P*s(x,b,1)+(P*b/l)*s(x,l,1);
%
--------------------------------------------------------------------

 

To plot the shear force diagrma using Matlab, use the following command:
>> fplot('V',[0 1.0])

To plot the bending moment diagram using Matlab, use the following command:
>> fplot('M',[0 1.0])

To scale the axis:
axis([xmin xmax ymin ymax])
e.g., axis([0 1 -500 500])

 

Department of Mechanical Engineering
5711 Boardman Hall, Room 219
Orono, ME 04469-5711
Phone: (207) 581-2120 | Fax: (207) 581-2379

E-mail: megsmith@maine.edu


The University of Maine
, Orono, Maine 04469
207-581-1110
A Member of the University of Maine System