**Visit http://CivilEngineeringBible.com for newer posts and files**

# MATLAB CODES

# Free download MATLAB file for finite element analysis of plane trusses using truss elements + solved example

**Visit http://CivilEngineeringBible.com for newer posts and files**

A truss is a structure in which members are arranged in such a way that they are subjected to axial loads only. The joints in trusses are condidered pinned. Plane trusses, where all members are asummed to be in x-y plane, are considered in this MATLAB code.

Example:

Consider a simple six-bar pin-jointed structure shown below. All members have the same cross-sectional area and are of same material, E = 200 and A = 0.001; The load P = 20 and acts at an angle of 30 degrees.

each node has two degree of freedom and thus there are a total of ten degrees of freedom.

It is solved using this MATLAB code and the results are as follows:

MATLAB file: Continue reading

# Free download MATLAB file for Finite Element beam analysis using beam elements + solved examples

**Visit http://CivilEngineeringBible.com for newer posts and files**

Many structural systems used in practice consist of long slender members that are subjected to loading normal to their longitudinal axis and must resist bending and shear forces. They are called beams. Beams are governed by a fourth-order differential equation.

Assumed degrees of freedom for a beam element used in this code.

Example1:

Consider a simple cantilever beam with a circular cross-section of 10 in diameter and a length of 400in. E = 30e6 psi. Load = 1000 lbs in downward direction at the right end of the beam.

Analytical solution for the mximum deflection and slope at the right end of the beam is as follows:

Slope = P(L^2)/2*EI = 0.0054

Deflection = P(L^3)/3*EI = 1.44866

and Finite Element result generated by MATLAB program is shown below:

Example2:

Consider a simply supported beam with a circular cross-section of 10 in diameter and a length of 400 in. The Young’s Modulus of the beam is 30e6. Load = 1000 lbs in downward direction at the right end of the beam.

Analytical solution -> Maximum deflection at the center of the beam is:

deflection = Ymax = P(L^3)/(48*EI) = 0.090541

slope = 0.0

and Finite Element results generated by MATLAB program for two element model and 4 element model are shown below:

Feel free to contact me via email (hosseinali.sut@gmail.com) for more details.

MATLAB Code is: Continue reading

# FEM MATLAB code for Newmark 1D dynamic analysis of a 4 DOFs structure

**Visit http://CivilEngineeringBible.com for newer posts and files**

Here is the result of my MATLAB code for dynamic analysis of a four degrees of freedom structure:

Newmark method is used in this program.

Feel free to contact me via email (hosseinali.sut@gmail.com) for MATLAB files:

newmark_1d.m

# Finite Element Analysis of a Contact Problem using MATLAB Code

**Visit http://CivilEngineeringBible.com for newer posts and files**

Here is the results of my FEM MATLAB code for large deformation contact problem:

Both Penalty and Lagrange Multiplier methods are programmed.

Do not hesitate to contact me via email (hosseinali.sut@gmail.com) for MATLAB files:

At.m Continue reading

# 3D Large Deformation Finite Element Analysis using MATLAB Code

**Visit http://CivilEngineeringBible.com for newer posts and files**

Here is the MATLAB code for 3D FEM analysis of a large deformation problem.

Both Total and Updated Lagrangian Descriptions are programmed; Tetrahedron elements are used.

Do not hesitate to contact me via email (hosseinali.sut@gmail.com) for MATLAB files:

main.m Continue reading

# 3D elastic Finite Element MATLAB code + Abaqus Verification

**Visit http://CivilEngineeringBible.com for newer posts and files**

I wrote a finite element code for three-dimensional analysis of elastic body using MATLAB programming language.

Here is a video of the results + its verification with Abaqus:

Output results are shown in Tecplot; hexahedron elements are used; Basic conjugate gradient method (BCG) is used to solve linear solutions to be able to solve large number of nodes and elements.

Do not hesitate to contact me via email (hosseinali.sut@gmail.com) for MATLAB files:

main.m

basicconjugategradientsolution.m

Continue reading