⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d2_cst.m

📁 结构力学中的有限元例子,包含了7个分类文件夹
💻 M
字号:
function [B,E,K,M] = D2_CST (x1, y1, x2, y2, x3, y3, Em, h, miu)

% returns a 2D linear constant strain triangle (CST) element K & M matrix
% in global coordinates
% INPUT:
%       x1, y1 - coordinates of joint 1 of the triangle element
%       x2, y2 - coordinates of joint 2 of the triangle element
%       x3, y3 - coordinates of joint 3 of the triangle element
%       Em     - elastic modulus for isotropic material
%       h      - thickness
%       miu    - Poisson's ratio
% ---------------------------------------------------------------------------
A = (0.5 * det([1 1 1; x1 x2 x3; y1 y2 y3])); % triangle area
% E   - elastic modulus matrix for plain stress:
%       [E11 E12 E13; E12 E22 E23; E13 E23 E33] 
E = Em/(1-miu^2).*[ 1  miu  0; miu  1  0; 0  0  (1-miu)/2 ];
% B - differentiated shape functions matrix
B = [  (y2-y3)   0      (y3-y1) 0       (y1-y2)  0;
       0        (x3-x2)  0      (x1-x3)  0       (x2-x1);
       (x3-x2)  (y2-y3) (x1-x3) (y3-y1) (x2-x1)  (y1-y2) ];
B = 1/(2*A).*B;
K = A*h.*B'*E*B ;

M = zeros(6,6);  % memory allocation
% Gauss integration points 'xi'
%Mxi = [ 1/2 1/2 0/6; 0/6 1/2 1/2; 1/2 0/6 1/2 ];
%for i=1:3
%    xi1=Mxi(i,1); xi2=Mxi(i,2); xi3=Mxi(i,3);
%    N = [diag(ones(1,6).*xi1)  diag(ones(1,6).*xi2) diag(ones(1,6).*xi3)];
%    M =  M + 1/3*(N*N'); % Gauss integration
%end;
M = 1/3*h*A*diag([1 1 1 1 1 1]); % equal mass for all nodes


% displacement vector: [x1 y1 x2 y2 x3 y3]
%     3 o
%      .  .
%     .    .
%    .      .
%   o........o
%  1          2
% ------------------end 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -