首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >轴向加载阶梯轴的MATLAB分析

轴向加载阶梯轴的MATLAB分析
EN

Stack Overflow用户
提问于 2022-04-02 17:10:02
回答 1查看 61关注 0票数 0

我有一个阶梯轴,根据所附的图像。可作为输入参数的下列信息:

123e3N/mm^2.

  • Cross-sectional杨氏模量400mm

  • Cross-sectional面积300 is ^2为400mm

  • Cross-sectional面积400 is^2,长度为250 is

  • 轴向力200 on轴向作用于轴上,轴向截面面积为300 is×2

时,载荷位于轴的一端200 is处。

我需要在MATALB中进行有限元分析。请帮助我编写MATLAB代码。

EN

回答 1

Stack Overflow用户

发布于 2022-04-23 06:18:28

代码语言:javascript
复制
%% Clearing workspace

clc
clear
close all

%% Element specifications 

ne = 3; % Number of elements 
nne = 2; % Number of nodes per element 
nn = ne*(nne - 1) + 1; % total number of nodes
ndof = 1; % Number of degress of freedom per node 
sg = nn*ndof; % size of global stiffness matrix 
se = nne*ndof; % size of elemental stiffness matrix 
KG = zeros(sg,sg); % Global stiffness matrix 
Ke = zeros(se,se); % Elemental Stiffness MAtrix 
Fe = zeros(se,1); % Elemental Force Vector 
FG = zeros(sg,1); % Global Force Vector

%% Geometrical parameters

E = 123e3*ones(1,ne); % Young's Modulus in N/mm^2
P = 200e3; % Force in N
F = P;

A = ones(1,ne) ; % Area of cross-section 
A(1)=300; % Area of cross-section of 1st element in mm^2
A(2)=300; % Area of cross-section of 2nd element in mm^2
A(3)=400; % Area of cross-section of 3rd element in mm^2

L = ones(1,ne); % Length of elements in mm
L(1)=200; % Length of 1st element in mm
L(2)=200; % Length of 2nd element in mm
L(3)=250; % Length of 3rd element in mm

%% Assembly of Global Stiffness Matrix

for i = 1:ne
    Ke = (A(i)*E(i)/L(i))*[1 -1;-1 1]; % Element Stiffness Matrix
    for j = 1:se
        for k = 1:se
            KG(i + j - 1, i + k - 1) = KG(i + j - 1, i + k - 1) + Ke(j,k);
        end
    end
end

%% Concentrated Load Vector at end

FG(2,1) = F; % Defining location of concentrated load

%% Application of boundary conditions

KGS = KG;
cdof = [1 4]; % specify fixed degree of freedom number
Lcdof = length(cdof);
for a = 1:Lcdof
    KGS(cdof(a),:) = 0;
    KGS(:,cdof(a)) = 1;
    FG(cdof(a),1) = 0;
end
FGL = length(FG); 
for b = 1:FGL
    if(b > length(FG))
        elseif(FG(b)<0)
            FG(b) = [];
    end
end

%% Solving for displacement

U = linsolve(KGS,FG) 
U1=KGS\FG 

%% Calculation of Reaction Forces 

FR = KG*U1
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71719585

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档