此示例显示了如何通过使用Craig-Bampton还原级建模技术来消除不符合感兴趣边界的自由度(DOF)。该示例还使用较小的尺寸超级元素来分析系统的动力学。为了进行比较,该示例还对原始结构进行了直接的瞬态分析。
Create a structural model for transient analysis.
modelt = createpde('structural','transient-solid');
Create a square cross-section beam geometry and include it in the model.
gm =多蛋布(0.05,0.003,0.003);Modelt.Deometry = GM;
绘制geometry, displaying face and edge labels.
图PDEGPLOT(Modelt,'FaceLabels','on','FaceAlpha', 0.5)视图(71 [4])
图PDEGPLOT(Modelt,'edgelabels','on','FaceAlpha', 0.5)视图(71 [4])
Specify the Young's modulus, Poisson's ratio, and mass density of the material.
structuralProperties(modelT,'Youngsmodulus',210E9,...'Poissonsratio',0.3,...'MassDensity',7800);
Fix one end of the beam.
structuralBC(modelT,'Edge',[2 8 11 12],'Constraint','固定的');
在面部中心添加一个顶点3。
loadedVertex = addVertex(gm,“坐标”,[0.025 0.0 0.0015]); figure pdegplot(modelT,'顶板标签','on','FaceAlpha',0.5)视图([78 2.5])
生成网格。
generatemesh(modelt);
将正弦浓缩力施加z- 新顶点的方向。
structuralBoundaryLoad(modelT,'顶点',LoadedVertex,...'力量',[0; 0; 10],,'频率',6000);
Specify zero initial conditions.
structuralIC(modelT,'Velocity',[0 0 0],'移位',[0 0 0]);
解决模型。
tlist = 0:0.00005:3E-3;rt = solve(modelt,tlist);
使用固定和加载边界定义超元素接口。在这种情况下,降低的订单模型保留了固定面部和载荷顶点的自由度(DOF),同时将所有其他DOF凝结以使用模态DOF。为了获得更好的性能,请使用边界5的边缘组合,而不是使用整个脸部。
结构间接面(Modelt,'Edge',[2 8 11 12]);结构间接面(Modelt,'顶点',LoadedVertex);
减少结构,将所有固定接口模式保留到5E5
.
rom =降低(modelt,'频率范围',[ - 0.1,5E5]);
接下来,使用还原订单模型模拟瞬态动力学。使用ode15s
直接函数以集成还原的系统ode。使用还原模型需要索引到还原的系统矩阵rom.k
和rom.m
. First, construct mappings of indices ofK
和M
to loaded and fixed DoFs by using the data available in只读存储器
.
DoFs correspond to translational displacements. If the number of mesh points in a model isnn
,然后工具箱将ID分配给DOFS如下:第一个1
tonn
arex- 位置,nn+1
to2*Nn
arey- 位置,和2Nn+1
to3*Nn
arez-displacements. The reduced model object只读存储器
contains these IDs for the retained DoFs in只读存储器.RetainedDoF
.
创建一个函数,该函数返回给定节点ID和节点的数量。
getDoF = @(x,numNodes) [x(:); x(:) + numNodes; x(:) + 2*numNodes];
了解给定节点ID的DOF ID,请使用intersect
功能以找到所需的索引。
numnodes = size(rom.mesh.nodes,2);loadedNode = findnodes(rom.mesh,'地区','顶点',LoadedVertex);loadDofs = getDof(ladeedNode,numnodes);[〜,loadNoderomids,〜] = Intersect(rom.retaineddof,loadDofs);
在降低的矩阵中rom.k
和rom.m
,在保留DOF之后出现广义模态DOF。
fixedIntModeIds = (numel(rom.RetainedDoF) + 1:size(rom.K,1))';
Because fixed-end DoFs are not a part of the ODE system, the indices for the ODE DoFs in reduced matrices are as follows.
odeDoFs = [loadNodeROMIds;fixedIntModeIds];
这relevant components ofrom.k
和rom.m
for time integration are:
kconcontain = rom.k(odedofs,odedofs);McOnterained = rom.m(odedofs,odedofs);numode = numel(odedofs);
Now you have a second-order system of ODEs. To useode15s
, convert this into a system of first-order ODEs by applying linearization. Such a first-order system is twice the size of the second-order system.
Mode = [eye(numODE,numODE), zeros(numODE,numODE);...zeros(numODE,numODE), Mconstrained]; Kode = [zeros(numODE,numODE), -eye(numODE,numODE);...Kconstrained, zeros(numODE,numODE)]; Fode = zeros(2*numODE,1);
指定的concentrated force load in the full system is along thez- 方向,这是ODE系统中的第三个DOF。核算线性化以获得一阶系统提供了加载的ODE DOF。
loadODEDoF = numODE + 3;
Specify the mass matrix and the Jacobian for the ODE solver.
odeoptions = odeset;odeoptions = odeset(odeoptions,'Jacobian',-Kode); odeoptions = odeset(odeoptions,'大量的',Mode);
Specify zero initial conditions.
u0 = zeros(2*numODE,1);
Solve the reduced system by using ode15s and the helper functionCMSODEF
,在此示例的末尾定义。
sol = ode15s(@(t,y) CMSODEf(t,y,Kode,Fode,loadODEDoF),tlist,u0,odeoptions);
Compute the values of the ODE variable and the time derivatives.
[displ,vel] = deval(sol,tlist);
绘制z-displacement at the loaded vertex and compare it to the third DoF in the solution of the reduced ODE system.
图图(tlist,rt.displacement.uz(LoadedVertex,:))保持上情节(tlist,显示(3,:),,,,'r*') 标题('Z-Displacement at Loaded Vertex') legend(“完整模型”,'rom')
根据接口DOF和模态DOF了解解决方案,您可以重建完整模型的解决方案。这重建解决方案
功能requires the displacement, velocity, and acceleration at all DoFs in只读存储器
. Construct the complete solution vector, including the zero values at the fixed DoFs.
u = zeros(size(rom.K,1),numel(tlist)); ut = zeros(size(rom.K,1),numel(tlist)); utt = zeros(size(rom.K,1),numel(tlist)); u(odeDoFs,:) = displ(1:numODE,:); ut(odeDoFs,:) = vel(1:numODE,:); utt(odeDoFs,:) = vel(numODE+1:2*numODE,:);
Construct a transient results object using this solution.
RTrom = reconstructSolution(rom,u,ut,utt,tlist);
For comparison, compute the displacement in the interior at the center of the beam using the full and reconstructed solutions.
coordCenter = [0;0;0]; iDispRT = interpolateDisplacement(RT, coordCenter); iDispRTrom = interpolateDisplacement(RTrom, coordCenter); figure plot(tlist,iDispRT.uz,'K') 抓住上plot(tlist,iDispRTrom.uz,'g*') 标题('Z-Displacement at Geometric Center') legend(“完整模型”,'rom')
功能f = CMSODEf(t,u,Kode,Fode,loadedVertex) Fode(loadedVertex) = 10*sin(6000*t); f = -Kode*u +Fode;end