-
Notifications
You must be signed in to change notification settings - Fork 3
/
08_Truss_Arc.js
90 lines (78 loc) · 3.52 KB
/
08_Truss_Arc.js
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
if (!RFEM) {
throw new Error("This script is only for RFEM, it creates lines.");
}
run("../includes/tools/clearAll.js");
include("../includes/Tools/global.js");
var L = 12; // Total Length
var n = 6; // Number of Bays (it should be even) (min. 4)
var H = 3; // Height
var r = H / 2 + sqr(L) / (8 * H); // Radius of the top chord
ASSERT(n > 3, "Minimum number of bays is 4.");
ASSERT(n % 2 == 0, "Number of bays should be even.");
// create material and section
var materialSteel = new Material(1, 'S235');
var sectionTopChord = new Section(1, 'UPN 160', materialSteel.GetNo());
sectionTopChord.Rotation(degrees2Radians(90));
var sectionBottomChord = new Section(2, 'UPN 160', materialSteel.GetNo());
sectionBottomChord.Rotation(degrees2Radians(-90));
var sectionVertical = new Section(3, 'HE 100 A', materialSteel.GetNo());
var sectionDiagonal = new Section(4, 'HE 100 A', materialSteel.GetNo());
var ns = nodes.count();
var nl = lines.count();
Node(1 + ns, 0, 0, 0);
Node(2 + ns, L, 0, 0);
var nodalSupport = new NodalSupport(1,[1,2]);
nodalSupport.Hinged();
// Creating nodes
var bt = new Node();
var nodeCount = 3 + ns;
for (var i = 1; i < n; ++i) {
bt.BetweenTwoNodes(nodeCount, 1 + ns, 2 + ns, "", [true, 100 * i / n]);
nodeCount++;
bt.BetweenTwoNodes(nodeCount, 1 + ns, 2 + ns, "", [true, 100 * i / n], 0, -(sqrt(sqr(r) - sqr(i * L / n - L / 2)) + H - r));
nodeCount++;
}
// Creating members
var mem = new Member();
var memberCount = nl + 1;
for (var i = 0; i < n - 1; ++i) // Verticals
{
mem.Truss(memberCount, [3 + 2 * i + ns, 4 + 2 * i + ns], sectionVertical.GetNo());
memberCount++;
}
mem.Truss(memberCount, [1 + ns, 3 + ns], sectionBottomChord.GetNo()); // Bottom Chord
memberCount++;
for (var i = 0; i < n - 2; ++i) {
mem.Truss(memberCount, [3 + 2 * i + ns, 5 + 2 * i + ns], sectionBottomChord.GetNo());
memberCount++;
}
mem.Truss(memberCount, [2 * n - 1 + ns, 2 + ns], sectionBottomChord.GetNo());
memberCount++;
var lin = new Line(); // Top Chord
lin.Arc(memberCount, [1 + ns, 4 + ns], [L / (2 * n), 0, -(sqrt(sqr(r) - sqr(L / (2 * n) - L / 2)) + H - r)]);
mem.Truss(memberCount,memberCount, sectionTopChord.GetNo());
memberCount++;
for (var i = 0; i < n - 2; ++i) {
lin.Arc(memberCount, [4 + 2 * i + ns, 6 + 2 * i + ns], [L / (2 * n) + (i + 1) * (L / n), 0, -(sqrt(sqr(r) - sqr(L / (2 * n) + (i + 1) * (L / n) - L / 2)) + H - r)]);
mem.Truss(memberCount,memberCount, sectionTopChord.GetNo());
memberCount++;
}
lin.Arc(memberCount, [2 * n + ns, 2 + ns], [L - L / (2 * n), 0, -(sqrt(sqr(r) - sqr(L / 2 - L / (2 * n))) + H - r)]);
mem.Truss(memberCount,memberCount, sectionTopChord.GetNo());
memberCount++;
for (var i = 0; i < n / 2 - 1; ++i) // Diagonals
{
mem.Truss(memberCount, [5 + 2 * i + ns, 4 + 2 * i + ns], sectionDiagonal.GetNo());
memberCount++;
}
for (var i = 0; i < n / 2 - 1; ++i) {
mem.Truss(memberCount, [n + 1 + 2 * i + ns, n + 4 + 2 * i + ns], sectionDiagonal.GetNo());
memberCount++;
}
//load
var SASGeometricallyLinear = new StaticAnalysisSettings();
SASGeometricallyLinear.GeometricallyLinear(1);
var SASSecondOrder = new StaticAnalysisSettings();
SASSecondOrder.SecondOrder(2,"MySASLinear", "METHOD_OF_EQUATION_SYSTEM_DIRECT", "NEWTON_RAPHSON");
var lc1 = new LoadCase();
lc1.StaticAnalysis(1, "Self weight", SASGeometricallyLinear.GetNo(), "PERMANENT_G", [true, 0, 0, 1.0]);