Question: modify the code to plot the graphs for the attached problem. Here is my code. Please if you do not know how to do this
modify the code to plot the graphs for the attached problem.
Here is my code. Please if you do not know how to do this please give it to someone else. Ive wasted three expert questions now. Here is my code I have:
This script plots the shear and bending moment diagrams
for Example Problem It uses trapezoidal integration
so values may be off a little. It could be modified
for any number of point loads and a distributed load function.
Note: Calculate support reactions before running this script
clear;
Givens
beam length range
xmin ;
xmax ;
X linspacexminxmax,; Set number of points here
dx XX; Distance between x points is constant
Point loads including support reactions
x is first column and force is second column
negative force is downward directed
Must be in increasing x order
PointLoads ; ; ; ;
A distributed load
domain of application of the distributed load
wxmin ;
wxmax ;
Load is a function of x negative is downward
This returns an array if x is an array
The function is in last parenthesis
wLoad @xxwxmin & xwxmin & X
sheari sheari;
if wptsi
sheari sheari
wLoadXiwLoadXidx;
end
end
Add Point Loads when the new x passes a load point
if ip lengthplx && xx PointLoadsip
sheari PointLoadsip sheari;
ipip; Shift to the next Point Load
end
ii; Shift to the next shear index
end
plotXshear
areaXshear,'FaceColor',; Draw the shear plot
Add Titles, Labels Etc. Here
xlabelDistance X m from Left side
ylabel Force N
titleDiagram of Shear force 'color', b
xlimxbound; Set plot domain to be the same as other plots
hold off;
Work on the bending moment plot at the bottom
subplot;hold on;
Draw a baseline at y
linexminxmax'Color','LineWidth',;
bending zeroslengthX; Bending Moment Array
Trapezoidal Integration of Shear
i;
for xx X
if i
bendingi bendingi
sheari shearidx;
end
ii;
end
Draw bending moment plot
plotXbending
areaXbending,'FaceColor',;
Add Titles, Labels Etc. Here
xlabelDistance m from Left side
ylabel Moment Nm
titleDiagram of Bending Moment 'color', b
xlimxbound; Set consistent x axis limits
saveasgcf'ShearAndBending.png; Save as an image
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
