-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadCase_MultStepStatic.m
More file actions
61 lines (55 loc) · 1.91 KB
/
LoadCase_MultStepStatic.m
File metadata and controls
61 lines (55 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
classdef LoadCase_MultStepStatic<LoadCase_Static
%多步骤静力工况
properties
tn%时间点
scale%系数
end
methods
function obj = LoadCase_MultStepStatic(f,name)
obj=obj@LoadCase_Static(f,name);
end
function Set(obj,tn,scale)%设置 系数时程
tn=VectorDirection(tn);
scale=VectorDirection(scale);
%检查两者是否是大小一致
if length(tn)~=length(scale)
error('nyh:error','两列数据长度不一致')
end
%检查tn是否递增
for it=2:length(tn)
if tn(it)<tn(it-1)
error('nyh:error','时间序列不是递增')
end
end
obj.tn=tn;
obj.scale=scale;
end
function Solve(obj)
obj.PreSolve();
obj.CheckBC1();%附加的边界条件检查
%判断工况是线性的还是非线性的
if obj.f.flag_nl==0%线性结构
for stepn=1:length(obj.tn)
u1=obj.K1\(obj.f_node1*obj.scale(stepn));
%处理求解后所有自由度上的力和位移
obj.SetState(u1);
%把结果保存到noderst
obj.rst.AddByState(obj.tn(stepn),'time');
end
%初始化结果指针
obj.rst.SetPointer();
else%非线性结构
f_node_origin=obj.f_node1;
for stepn=1:length(obj.tn)
obj.f_node1=f_node_origin*obj.scale(stepn);%改变外荷载
u_all=obj.Script_NR(obj,obj.f_node1);
obj.SetState(u_all(obj.activeindex));
%添加结果
obj.rst.AddByState(obj.tn(stepn),'time');
end
%初始化结果指针
obj.rst.SetPointer();
end
end
end
end