Cantilever Beam Design using MATLAB
Summary
- **Keywords:** MATLAB, mechanics of materials, cantilever beam, beam bending, bending stress, deflection, section properties, numerical modeling, optimization, design constraints, engineering communication
Learning Goals
Students will:
1. Apply beam-bending theory to a realistic design problem.
2. Calculate shear force, bending moment, bending stress, slope, and deflection.
3. Use MATLAB to create a reusable beam-analysis function.
4. Investigate how geometry and material properties affect strength, stiffness, and mass.
5. Perform a grid search or optimization to identify the lightest feasible design.
6. Verify the model using hand calculations, boundary conditions, and convergence checks.
7. Interpret plots and communicate a defensible engineering recommendation.
Context for Use
This is an upper-division undergraduate project for a Mechanics of Materials or Strength of Materials course. It is appropriate for teams of two or three students and can be completed over two to three weeks, requiring approximately six to ten hours outside class. The project is suitable for a class of 20 to 40 students and can be completed in a computer laboratory, on personal computers, or through MATLAB Online.
Students should already understand static equilibrium, shear-force and bending-moment diagrams, normal stress in bending, the area moment of inertia, Hooke's law, beam deflection, elastic modulus, factor of safety, and engineering units. They should have basic MATLAB experience with scripts, functions, vectors, plotting, and conditional statements. The activity can be adapted for students with less programming experience by providing starter functions and a short MATLAB tutorial.
Technical Skills Students Need Before Beginning
Students should be able to:
- Create and run MATLAB scripts and user-defined functions.
- Use vectors and arrays to represent position along a beam.
- Calculate and plot engineering quantities.
Description and Teaching Materials
Teaching Notes and Tips
-ask students to predict where the maximum stress and deflection occur.
-Use this prediction to introduce the MATLAB model.
Assessment
Correct equations, section properties, boundary conditions, units, and stated assumptions
Working scripts and functions, clear organization, comments, and reproducibility
Hand checks, limiting cases, mesh refinement, and comparison with analytical results
Accurate plots, readable labels, design tables, and meaningful parameter studies
Feasible minimum-mass design, safety factor, constraints, and tradeoff reasoning
Clear report, concise explanation, and effective presentation
Contribution statement, organized files, and complete submission
Students meet the project goals when they produce a working model, demonstrate agreement with known beam theory, identify a feasible minimum-mass design, explain the main design tradeoffs, and communicate limitations clearly.
References and Resources
- MathWorks MATLAB Online. Browser-based MATLAB environment for remote implementation: (https://matlab.mathworks.com/)
- Hibbeler, Russell C. Mechanics of Materials. 11th ed., Pearson, 2022.
-Beer, Ferdinand P., et al. Mechanics of Materials. McGraw Hill, 2026.