A comprehensive collection of MATLAB scripts for the finite element analysis of truss structures in both 2D and 3D. This toolbox is designed for educational and engineering applications, offering clear implementations, visualization, and modular code for easy adaptation.
The MATLAB Truss Analysis Toolbox provides scripts to analyze truss structures using the finite element method (FEM). The repository is organized into two main sections:
- 2D Truss Analysis: Contains scripts to analyze and visualize 2D truss systems.
- 3D Truss Analysis: Contains scripts to analyze and visualize 3D truss systems.
Each section is modularized for ease of understanding, maintenance, and further development.
- Dual Analysis Modes: Dedicated folders for both 2D and 3D truss analysis.
- FEM Implementation: Calculate nodal displacements, element forces, stresses, strains, and stress utilization.
- Graphical Visualization: Generate 2D/3D plots to visualize the structure's behavior before and after deformation.
- Modular Code: Clean separation of main scripts and helper functions for easier scalability.
- Educational Resource: Detailed comments and output logs to aid learning and troubleshooting.
MATLAB-Truss-Analysis/
├── 2D/
│ └── truss2D.m % Main file for 2D truss analysis
├── 3D/
│ └── truss3D.m % Main file for 3D truss analysis
├── LICENSE % Project license (MIT)
└── README.md % This file
-
Clone the Repository:
git clone https://github.com/amirhh-04/MATLAB-Truss-Analysis.git
-
Open in MATLAB:
Navigate to the cloned repository directory in MATLAB.
-
Run the Main Scripts:
- For 2D analysis, open and run
truss2D.min the2Dfolder. - For 3D analysis, open and run
truss3D.min the3Dfolder.
- For 2D analysis, open and run
To run the simulations, open MATLAB and follow these steps:
- Navigate to the
2Dor3Dfolder. - Open
truss2D.mortruss3D.min MATLAB. - Run the script:
truss2D or truss3D
- The results will be displayed as plots and animations.
Upon running the analysis, you will receive:
- Numerical Data:
- Nodal displacements
- Element forces and stresses
- Strain and stress utilization percentages
- Graphical Output:
Visualizations of the original and deformed truss structure.
This project is licensed under the MIT License - see the LICENSE file for details.
For any inquiries, suggestions, or contributions, feel free to reach out:
- 📧 Email: 04.amirhh@gmail.com
- 🔗 GitHub: amirhh-04
- 🌐 Website: amirhh-04.ir
Thank you for exploring the MATLAB Truss Analysis Toolbox! Happy coding! 😊

