When we are designing a shaft or beam, we generally use moment and shear force diagrams to determine the critical points. There are several methods to draw a S&M Diagram. You can use commercial softwares like Mdsolids or you can draw by hand. I believe that we must use available technologies to solve our problems fastly. Matlab provides us simple and efficent solutions for this kind of problems.
We will use singularity function to draw S&M diagram. You can find more information about Singulariy Functions from the link below.
I found this problem from mathalino.com. We will draw the S&M diagram of this problem in matlab. As I said before, we’ll use singularity function method. Simply we will define two functions V(x) and M(x). The location and direction of the forces are important in defining a singularity function.
The equations in the figure are same for metric unit. Let’s solve the problem.
For this problem, moment and shear force functions can be defined like that. The last step is iterating these functions. You can use linspace() function for the iteration. This function generates linearly spaced points.
Finally, this method are applicable for other programming languages like Python and Octave. I hope this article makes your life easier.
Have a science day.