![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1323690/image.png)
How to do element stiffness matrix analysis for beam element
51 次查看(过去 30 天)
显示 更早的评论
Hello, I want to ask help on how to do element stiffness matrix using matlab. For example I have a beam, I am using only excel and it is hard if there is a lot of nodes i am having a problem in assembling the global stiffeness matrix in solving the elongation and internal forces. Please help.
Thank you so much.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1317480/image.png)
0 个评论
回答(1 个)
Prathyusha Appalla
2023-3-14
I understand that you are trying to find element stiffness matrix for beam element using MATLAB and you find difficulty in assembling the global stiffness matrix.
Below are some of the equations and MATLAB codes for finding out the Element stiffness matrix “K” and Global Stiffness matrix “KG”. Hope they’ll be of some help to reach you to your desired solution.
The element stiffness matrix ‘K’ for beam element is defined as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1323690/image.png)
where,
E = interval modulus of elasticity,
Ia = moment of inertia,
l = length.
It is of order 4x4 due to the four degrees of freedom, two at each nodes.
The following is the MATLAB code of a function which is used to find out Beam element stiffness matrix “K”.
function y = BeamElementStiffness(a, b, alpha, Ia, l) %% Here, a and b are the left and the right bounds of interval modulus of elasticity and alpha belongs to [0, 1].
E=a+(b-a)*alpha;
y=((E*Ia)/l^3)*[12 6*l -12 6*l;6*l 4*l^2 -6*l 2*l^2; -12 -6*l 12 -6*l;6*l 2*l^2 -6*l 4*l^2];
end
The following MATLAB function is used to assemble the elemental stiffness matrix K of the beam element whose nodes are i (left-end node) and j (right-end node) into the global stiffness matrix "KG". It gives 2nx2n global stiffness matrix "KG".
function y = BeamElementAssemble (KG, K, i, j)
KG(2*i-1,2*i-1)=KG(2*i-1,2*i-1)+K(1,1);
KG(2*i-1,2*i)=KG(2*i-1,2*i)+K(1,2);
KG(2*i-1,2*j-1)=KG(2*i-1,2*j-1)+K(1,3);
KG(2*i-1,2*j)=KG(2*i-1,2*j)+K(1,4);
KG(2*i,2*i-1)=KG(2*i,2*i-1)+K(2,1);
KG(2*i,2*i)=KG(2*i,2*i)+K(2,2);
KG(2*i,2*j-1)=KG(2*i,2*j-1)+K(2,3);
KG(2*i,2*j)=KG(2*i,2*j)+K(2,4);
KG(2*j-1,2*i-1)=KG(2*j-1,2*i-1)+K(3,1);
KG(2*j-1,2*i)=KG(2*j-1,2*i)+K(3,2);
KG(2*j-1,2*j-1)=KG(2*j-1,2*j-1)+K(3,3);
KG(2*j-1,2*j)=KG(2*j-1,2*j)+K(3,4);
KG(2*j,2*i-1)=KG(2*j,2*i-1)+K(4,1);
KG(2*j,2*i)=KG(2*j,2*i)+K(4,2);
KG(2*j,2*j-1)=KG(2*j,2*j-1)+K(4,3);
KG(2*j,2*j)=KG(2*j,2*j)+K(4,4);
y=KG;
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!