forked from petrobras/ross
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprobe.py
49 lines (41 loc) · 1.23 KB
/
probe.py
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
from ross.units import Q_, check_units
class Probe:
"""Class of a probe.
This class will create a probe object to be used in the rotor model.
The probe is used to measure the response of the rotor at a specific
location and orientation.
Parameters
----------
node : int
Indicate the node where the probe is located.
angle : float, pint.Quantity
Probe orientation angle about the shaft (rad).
tag : str, optional
A tag to name the element.
Example
-------
>>> import ross as rs
>>> probe1 = rs.Probe(10, Q_(45, "degree"), "Probe Drive End - X")
>>> probe1.node
10
>>> probe1.angle
0.7853981633974483
"""
@check_units
def __init__(self, node, angle, tag=None):
self.node = node
self.angle = angle
if tag is None:
self.tag = f"Probe - Node {self.node}, Angle {self.angle}"
else:
self.tag = tag
@property
def info(self):
return self.node, self.angle
def __str__(self):
return (
f"Probe {self.tag}"
f'\n{20*"-"}'
f"\nNode location : {self.node}"
f"\nProbe orientation angle (rad) : {self.angle}"
)