This solver can be used to analyse 1 degree of freedom of 1 dimensional problems with bar elements connected in series and having 1D forces acting parallel to the axis of the bar. It uses the direct stiffness method and assembles the global nodal force vector, global element stiffness matrix, and the global nodal displacement vector and uses the elimination approach on the global relationship after applying all the boundary conditions provided by the user to solve for the unknown nodal displacements.
-
Make sure you have Python 3 installed and working.
-
Clone the repo:
git clone https://github.com/RahulShagri/1D-Bar-Element-1-DOF-FEM-Solver.git
- Install prerequisites using pip, preferably in a new environment:
pip install -r requirements.txt
- Run the 1D_Bar_Element_FEM_Solver.py file.
Note: The user has to make sure the values entered have the correct units. The software does not convert any values entered. Results are obtained based on the values that are entered without converting them to different units. In the following examples, the displacements are in mm and stresses are in MPa.
Solving for a uniform bar element that is divided into 3 elements with a force acting in the positive x direction.
Known values are:
- Number of elements = 3
- Area of cross section of the bar = 250 mm2
- Modulus of elasticity = 109 GPa
- Length of the whole bar = 1500 mm
- Force acting on each node (separated by commas) = 0,0,0,50000
Enter the respective values in the text boxes provided.
Hit the solve button.
Ensure no errors are shown in the log window.
Analyse the results in the results window.
- Displacement values in the table are respective nodal displacements in the ascending sequence.
- Stress values in the table are respective element stresses in the ascending sequence.
- Strain values in the table are respective element strains in the ascending sequence.
Solving for multiple bar elements attached in series with two 1D forces acting.
Known values are:
Element No. | Area of cross section | Young's modulus | Length |
---|---|---|---|
1 | 140 mm2 | 109 GPa | 100 mm |
2 | 100 mm2 | 100 GPa | 150 mm |
3 | 90 mm2 | 110 GPa | 300 mm |
Node No. | Displacement | Force |
---|---|---|
1 | 0 (Fixed) | 0 N |
2 | x (Unknown) | - 1000 N |
3 | x (Unknown) | 0 N |
4 | x (Unknown) | 15000 N |
Enter the respective values in the text boxes provided.
Hit the solve button.
Ensure no errors are shown in the log window.
Analyse the results in the results window.
- Displacement values in the table are respective nodal displacements in the ascending sequence.
- Stress values in the table are respective element stresses in the ascending sequence.
- Strain values in the table are respective element strains in the ascending sequence.
You can contact me using the messaging form or the emailing option on my engineering portfolio website.