MATLAB Graph Bending Moment Equation in Excel/Matlab

AI Thread Summary
To graph the equation of the bending moment, σ = MC / I, in Excel or MATLAB, it is essential to understand the relationship between the variables involved. The equation indicates that σ (stress) is calculated from the bending moment (M), a constant (C), and the moment of inertia (I). To create the graph, first define the range of x-coordinates from 0 to L, where L is the length of the beam. In MATLAB, this can be done using the command x = linspace(0, L, L).Assuming M varies with x, it is crucial to establish a specific equation for M. Constants C and I should remain constant along the beam, or if they vary, they should be simplified into a function of x. After defining M, C, and I, calculate σ using the formula σ = M*C/I.
aaalanc
Messages
1
Reaction score
0
how can i graph the equation of the bending moment?
The equation is: σ = MC / I and i want to graph in excel or matlab, , so i know that the graph is a straight line, and i have the values, but i don't know how draw the graph
 
Physics news on Phys.org
let's say you've got a set of x-coordinates, from x=0 to x=L. If you're using matlab, type the following:

x=linspace(0,L,L)

where L is the total length of the beam. That will give you an entire array of x-values.

I'm assuming M is dependent upon x. You should have some sort of equation already. C and I are constant the whole length of the beam, I hope. (If not, then they still depend on x, and you can simplify MC/I into one big function of x). So now, define M, C, and I in the program:
M= whatever
C= whatever
I = 1/12*whatever*whatever^3

Then, define Sigma in terms of M, C, and I (which are already defined in terms of x).

Sigma = M*C/I

Finally, you can plot the results by typing:

plot(x,Sigma)
 
Did you do as I suggested and revise what a bending moment is?

You say you want to plot a graph of bending moment but your formula is for something different.

What is sigma, M, C and I in your formula and how is a plot of sigma v x a plot of bending moment?
 

Similar threads

Replies
4
Views
4K
Replies
3
Views
2K
Replies
4
Views
2K
Replies
1
Views
4K
Replies
7
Views
1K
Replies
2
Views
3K
Back
Top