MATLAB Beam Project: Multiple Inputs for Applied Loads and Positions

In summary, the conversation discusses a project involving a simple beam with applied loads in MATLAB. The main issue is how to ask for the correct number of loads and their corresponding values from the user. The solution proposed is to use a for loop, where the user first inputs the number of loads and then the loop asks for each individual load and position. This allows for proper load calculations to be done.
  • #1
bakin
58
0
Hello. I have to do a beam project in MATLAB. Similar to this: (I just google imaged this)
http://teaching.ust.hk/~mech101/images/4_poin22.gif
Just a simple beam with one or more applied loads.

What I'm trying to do, is ask the user how many total loads are being applied to the beam. Once I have this answer, I want to have the user enter how much the load is, and what the position is. But, my problem is that once I have a number for how many loads there are, I don't know how to have that many questions asked. For example, if there are two loads, how do I get it to ask the user two times? Or if there are 4 loads, ask them for 4 separate values? I'm thinking it might be a for loop, or some type of loop depending on the number inputted.

Thanks!
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
A for loop sounds like the way to go. First, ask the user to enter the number N of loads, where N should be an integer 1 or larger.

Then a for loop executes N times (for i=1:N) asking for for load(i) and position(i). After the for loop finishes you should have two arrays with N entries, load(1), load(2), ..., load(N), and position(1), ..., position(N). Then you're ready to do your load calculation.
 
  • #3
makes sense. ill give that a shot here soon and let you know how it works. thank you for the help :biggrin:


edit: That definitely did work :smile: Now I can continue working with this. Thank you very much! :wink:
 
Last edited:

1. What is the purpose of the MATLAB Beam Project?

The purpose of the MATLAB Beam Project is to simulate the behavior of a beam subjected to multiple applied loads and positions using MATLAB, a numerical computing software. This project allows users to understand and analyze the stress and deflection of a beam under various loading conditions.

2. How do I input multiple applied loads and positions in the MATLAB Beam Project?

To input multiple applied loads and positions, you can use the "inputLoads" function in MATLAB. This function allows you to specify the magnitude, position, and direction of each load on the beam. You can also use the "inputPositions" function to specify the locations of the applied loads on the beam.

3. How does the MATLAB Beam Project calculate stress and deflection?

The MATLAB Beam Project uses the finite element method to calculate the stress and deflection of the beam. This method divides the beam into smaller elements and uses numerical techniques to solve for the stress and deflection at each element. The results are then combined to give the overall stress and deflection of the beam.

4. Can I change the material properties of the beam in the MATLAB Beam Project?

Yes, you can change the material properties of the beam in the MATLAB Beam Project. The "inputMaterial" function allows you to specify the material properties such as Young's modulus and cross-sectional area. By changing these properties, you can simulate the behavior of different types of beams under various loading conditions.

5. Is the MATLAB Beam Project suitable for real-world applications?

While the MATLAB Beam Project can provide a good understanding of the behavior of a beam under multiple applied loads and positions, it should not be used for real-world applications without further verification and validation. The results from this project should be compared with experimental data or verified using more advanced numerical methods before being applied in practical situations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
819
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
561
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
348
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • General Engineering
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Back
Top