Week 2 Challenge- MATLAB Module for an Element Stiffness Matrix
MATLAB function module to accept the input:
MATLAB File name: InputCheck.m
A function is created and saved in operating folder. These functions will gets input from user using syntax “input”.
Node vector:
For node vector, user need to input node vector as a matrix at any number of row and 2 number of columns. If the column number is greater than 2 then error message appears. Only after perfect values of node vector is given as input, program will execute next phase of line.
Constants:
Then inputs for Young’s modulus, Area and load along Y axis get from user. These values checked for single element then final values are outputted.
RESULT:
Node_Cord =
0 0
6.9840 4.0000
11.0000 0
Constants =
20000
200
100
CALCULATE LENGTH AND ORIENTAION:
MATLAB File name: ElementLength.m
Functions is created to find length and orientation of elements. For this functions Node coordinate is given as input. Each element are designated with 2 nodes. Using trigonometry functions, length and angle between this node are found. These values are then exported to output of the functions.
RESULT:
a =
8.0484
5.6682
11.0000
b =
29.8014
44.8856
180.0000
STIFFNESS MATRIX:
MATLAB File name: StiffnessMatrix.m
Using Constants,length and angle as an input stiffness matrix is derived. Stiffness matrix formula is:
[ST_MAT]=(E*A/L)*(Cos2θ CosθSinθ -Cos2θ -CosθSinθ; CosθSinθ Sin2θ -CosθSinθ -Sin2θ;
-Cos2θ -CosθSinθ Cos2θ CosθSinθ; -CosθSinθ -Sin2θ CosθSinθ Sin2θ)
RESULT:
Stiffness matrix =
1.7068 2.5602 -1.7068 -2.5602
2.5602 3.8402 -2.5602 -3.8402
-1.7068 -2.5602 1.7068 2.5602
-2.5602 -3.8402 2.5602 3.8402
GLOBAL STIFFNESS MATRIX:
MATLAB File name: DofOfMat.m
MATLAB File name: Main.m
To derive global stiffness matrix, 4*4 matrix converted into 6*6 matrix. For this separate function is used. Degree of Freedom is calculated for 3 matrixes. Position for 3 matrix are determined. Stiffness matrix with 4*4 and relevant DOF is input for function to obtain 6*6 matrix.
After finding all stiffness matrix, matrix are added and Global stiffness matrix is derived.
RESULT:
Dof of Matrix:
0.8534 1.2801 -0.8534 -1.2801 0 0
1.2801 1.9201 -1.2801 -1.9201 0 0
-0.8534 -1.2801 0.8534 1.2801 0 0
-1.2801 -1.9201 1.2801 1.9201 0 0
0 0 0 0 0 0
0 0 0 0 0 0
MAIN:
285338.491726958 128007.737590438 -85338.4917269583 -128007.737590438 -200000 0
128007.737590438 192011.606385656 -128007.737590438 -192011.606385656 0 0
-85338.4917269583 -128007.737590438 203189.621924716 245858.867788195 -117851.130197758 -117851.130197758
-128007.737590438 -192011.606385656 245858.867788195 309862.736583414 -117851.130197758 -117851.130197758
-200000 0 -117851.130197758 -117851.130197758 317851.130197758 117851.130197758
0 0 -117851.130197758 -117851.130197758 117851.130197758 117851.130197758