Matlab Coding for FEM Spring Element-Local Stiffness Matrix

Here you can learn how to write a matlab code to calculate the local stiffness matrix. In meantime you will learn how to write a matlab code to solve problems related to spring elements.This is a basic code to understand the procedure. Everything has to start small :P.

First we have to identify the inputs for the matlab code

As we all know a spring element only has two Degrees of Freedoms. Check the formulation of Spring Element for more details.

Main Inputs:
1. Area of the Section
2. Young’s Modulus of the section
3.Length of the Element

Now we can write the code,

We don’t use the semicolon in 11th line because we want to see the result in the command window. 10th line calculation will not seen in the command window because we have used the semicolon.

Hope to discuss more advanced matlab codes in future posts and try to write the code yourself.

Leave a comment