How to assemble matrices?

9 ビュー (過去 30 日間)
utsdf
utsdf 2016 年 10 月 12 日
コメント済み: utsdf 2016 年 10 月 13 日
I am trying to assemble local stiffness matrix to global one. Each node has 3Dof. The problem is I dont know how to shift the matrices at last part while adding process. Thanks everyone. The code is
clc;clear all
el_tot=3; %number of elements
n_tot=3*(el_tot+1); %number of nodes
% LOCAL - TO - GLOBAL MAPPING
EL_N = [1:3:n_tot-3; 6:3:n_tot];
% INITIALIZE GLOBAL STIFFNESS MATRIX AND GLOBAL FORCE VECTOR
K = zeros(n_tot); % 2nd same size superfluous , n_tot ); --dpb edit
shift=0;
% ELEMENT LOOP
for iel = 1: el_tot
% GET NODE INDICES FOR ELEMENT iel
el_nodes = EL_N :,iel);
% DEFINE ELEMENT STIFFNESS MATRIX AND VECTOR
Kloc =ones(6,6);
% INSERT / SUM LOCAL ELEMENT STIFFNESS MATRICES
% INTO GLOBAL STIFFNESS MATRIX
K(el_nodes,el_nodes) = K(el_nodes,el_nodes) + Kloc ;
end*

採用された回答

KSSV
KSSV 2016 年 10 月 13 日
It is a FEM problem. You cannot expect a FEM solution in MATLAB community. You have to assemble stiffness matrices based on your nodal connectivity. YOu may refer the below link to understand how to assemble the local stiffness matrix to global matrix.
You can extend the analogy to your 3D.
  1 件のコメント
utsdf
utsdf 2016 年 10 月 13 日
Thank you so much Dr. Siva Srinivas Kolukula.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by