-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelConstants.py
More file actions
161 lines (129 loc) · 4.33 KB
/
ModelConstants.py
File metadata and controls
161 lines (129 loc) · 4.33 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
from enum import Enum
import random
class OrderedEnum(Enum):
def __ge__(self, other):
if self.__class__ is other.__class__:
return self.value >= other.value
return NotImplemented
def __gt__(self, other):
if self.__class__ is other.__class__:
return self.value > other.value
return NotImplemented
def __le__(self, other):
if self.__class__ is other.__class__:
return self.value <= other.value
return NotImplemented
def __lt__(self, other):
if self.__class__ is other.__class__:
return self.value < other.value
return NotImplemented
class ModelType(OrderedEnum):
EASY = 1
FRICTION = 2
CENTRIPETAL = 3
ROTORSPEED = 4
GYROMOMENT = 5
NO_SIMPLIFICATIONS = 6
class OriginalConstants:
# l_a = ? (not given in Fig. 7)
l_p = 0.178 # m
l_h = 0.67
l_c = 0.4069
d_c = 0.0639
d_h = 0.0027
m_h = 1.2 # kg
m_c = 1.7638
# motor characteristics
m_m = 0.2 * m_h
r_m = l_p/8
J_m = 0.5 * m_m * r_m**2
p1 = 0.3117
q1 = 0.4623
p2 = 0.1396
q2 = 0.3819
mu_phi = 0.0334 # dissipation coefficient in Nms
mu_eps = 0.0755
mu_lamb = 0.2596
# PT1 charakteristics for ROTOR SPEED
T_w = 0.01
K_w = 1
K = 1
K_m = 0.1
g = 9.81 # m/s^2
"""
class RandomizedConstants:
random.seed(1234)
# l_a = ? (not given in Fig. 7)
l_p = OriginalConstants.l_p * random.uniform(0.9, 1.1)
l_h = OriginalConstants.l_h * random.uniform(0.9, 1.1)
l_c = OriginalConstants.l_c * random.uniform(0.9, 1.1)
m_p = OriginalConstants.m_p * random.uniform(0.9, 1.1)
m_c_max = 2 * l_h / l_c * m_p
m_c = m_c_max*random.uniform(0.9, 0.96) # arbitrary, but has to be smaller than m_c_max
# motor characteristics
m_m = 0.2 * m_p
r_m = l_p / 8
J_m = 0.5 * m_m * r_m ** 2
p1 = OriginalConstants.p1 * random.uniform(0.9, 1.1)
q1 = OriginalConstants.q1 * random.uniform(0.9, 1.1)
p2 = OriginalConstants.p2 * random.uniform(0.9, 1.1)
q2 = OriginalConstants.q2 * random.uniform(0.9, 1.1)
d_p = OriginalConstants.d_p * random.uniform(0.9, 1.1)
d_e = OriginalConstants.d_e * random.uniform(0.9, 1.1)
d_l = OriginalConstants.d_l * random.uniform(0.9, 1.1)
# PT1 charakteristics for ROTOR SPEED
T_w = OriginalConstants.T_w * random.uniform(0.9, 1.1)
K_w = OriginalConstants.K_w * random.uniform(0.9, 1.1)
K = OriginalConstants.K * random.uniform(0.9, 1.1)
K_m = OriginalConstants.K_m * random.uniform(0.9, 1.1)
g = OriginalConstants.g
class LowerBoundConstants:
# l_a = ? (not given in Fig. 7)
l_p = OriginalConstants.l_p * 0.9
l_h = OriginalConstants.l_h * 0.9
l_c = OriginalConstants.l_c * 0.9
m_p = OriginalConstants.m_p * 0.9
m_c_max = 2 * l_h / l_c * m_p
m_c = m_c_max*0.9 # arbitrary, but has to be smaller than m_c_max
# motor characteristics
m_m = 0.2 * m_p
r_m = l_p / 8
J_m = 0.5 * m_m * r_m ** 2
p1 = OriginalConstants.p1 * 0.9
q1 = OriginalConstants.q1 * 0.9
p2 = OriginalConstants.p2 * 0.9
q2 = OriginalConstants.q2 * 0.9
d_p = OriginalConstants.d_p * 0.9
d_e = OriginalConstants.d_e * 0.9
d_l = OriginalConstants.d_l * 0.9
# PT1 charakteristics for ROTOR SPEED
T_w = OriginalConstants.T_w * 0.9
K_w = OriginalConstants.K_w * 0.9
K = OriginalConstants.K * 0.9
K_m = OriginalConstants.K_m * 0.9
g = OriginalConstants.g
class UpperBoundConstants:
# l_a = ? (not given in Fig. 7)
l_p = OriginalConstants.l_p * 1.1
l_h = OriginalConstants.l_h * 1.1
l_c = OriginalConstants.l_c * 1.1
m_p = OriginalConstants.m_p * 1.1
m_c_max = 2 * l_h / l_c * m_p
m_c = m_c_max*0.96 # arbitrary, but has to be smaller than m_c_max
# motor characteristics
m_m = 0.2 * m_p
r_m = l_p / 8
J_m = 0.5 * m_m * r_m ** 2
p1 = OriginalConstants.p1 * 1.1
q1 = OriginalConstants.q1 * 1.1
p2 = OriginalConstants.p2 * 1.1
q2 = OriginalConstants.q2 * 1.1
d_p = OriginalConstants.d_p * 1.1
d_e = OriginalConstants.d_e * 1.1
d_l = OriginalConstants.d_l * 1.1
# PT1 charakteristics for ROTOR SPEED
T_w = OriginalConstants.T_w * 1.1
K_w = OriginalConstants.K_w * 1.1
K = OriginalConstants.K * 1.1
K_m = OriginalConstants.K_m * 1.1
g = OriginalConstants.g"""