Question: MATLAB exercise Consider sectioning your code. Debug your code! Add comments. Question 1 : Suppose we have a supported beam with a uniformly distributed load.
MATLAB exercise Consider sectioning your code. Debug your
code! Add comments.
Question : Suppose we have a supported beam with a uniformly distributed load. The deflection y of the beam at any point x along its length can be approximated by the following equation:
yx WEILxLxLx
Where W is the uniformly distributed load force per unit length E is Youngs modulus of
the material, I is the moment of inertia of the beams crosssectional area, L is the length of the
beam, and x is the distance along the beam.
PART A:
Write a MATLAB function to calculate the deflection for values of x Input in the code W KNcm E KNcm I cm and L cm Enable the code to:
calculate the deflection
determine the maximum deflection and maximum deflection locations using MATLABs
builtin function min The min function in MATLAB returns the minimum value and
the index where that minimum value occurs in the input vector for more information help
min command
syntax: minvalue, indexminvariable name of the array containing all values
Note that deflection values are negative numbers, and the max deflection min value.
use the index from the above output to identify the location of maximum deflection of
vector x
Example vector x contains data points, then write a code to find the data that is stored in
row in this case index
x; then x
plot the deflection yx along the length of the beam
mark the point of maximum deflection on the plot
PART B:
Call the function you build in a and evaluate the function for x values ranging from to L
with a step size
Publish the code in a the function call in b and the corresponding outputs. The code should
provide an array of deflection, an array of maximum deflection, an array of locations of
maximum deflection, a plot of y vs x and a mark showing the point of maximum deflection on
the plot.
Hint:
Use MATLABs plot function to mark the point of max deflection use maximum
deflection value and location as inputs
Consider adding deflection, maximum deflection and location of maximum deflection
as the function output variables.
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
