-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev sync ucs map #931
Dev sync ucs map #931
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #931 +/- ##
==========================================
+ Coverage 85.68% 86.43% +0.75%
==========================================
Files 32 31 -1
Lines 7368 7323 -45
==========================================
+ Hits 6313 6330 +17
+ Misses 1055 993 -62
Continue to review full report at Codecov.
|
Hi @fernandarossi ! To have a better understand of what was happening I ran the test and plotted the results. This is the result with the old code: And here with the new code: If you want to reproduce this here is the code: import ross as rs
steel = rs.materials.steel
# Rotor with damping
# Rotor with 6 shaft elements, 2 disks and 2 bearings with frequency dependent coefficients
i_d = 0
o_d = 0.05
n = 6
L = [0.25 for _ in range(n)]
shaft_elem = [
rs.ShaftElement(
l,
i_d,
o_d,
material=steel,
shear_effects=True,
rotary_inertia=True,
gyroscopic=True,
)
for l in L
]
disk0 = rs.DiskElement.from_geometry(2, steel, 0.07, 0.05, 0.28)
disk1 = rs.DiskElement.from_geometry(4, steel, 0.07, 0.05, 0.35)
stfx = [1e7, 1.5e7]
stfy = [1e7, 1.5e7]
c = [1e3, 1.5e3]
frequency = [50, 5000]
bearing0 = rs.BearingElement(0, kxx=stfx, kyy=stfy, cxx=c, cyy=c, frequency=frequency)
bearing1 = rs.BearingElement(6, kxx=stfx, kyy=stfy, cxx=c, cyy=c, frequency=frequency)
rotor8 = rs.Rotor(shaft_elem, [disk0, disk1], [bearing0, bearing1])
ucs_results = rotor8.run_ucs(synchronous=True)
ucs_results.plot() |
Hi @raphaeltimbo. If you run the old and the new code and compare the intersection points, you will observe that:
This occurs because when you run the old code, the speed is set to be equal to the first forward frequency. This is valid only for finding the critical speeds corresponding to the first mode. To find the critical speeds corresponding to the second mode, the speed should be set equal to the second forward frequency, and so on. If you do that, the other intersection points will give the same value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fernandarossi!
This is looking good. I have plotted some results and I think we are ready to merge?
I have made only one comment regarding a modification done in the disk_element.py
file which I think is not related to this PR. I think we should revert that before merging.
ross/disk_element.py
Outdated
if np.allclose(self.__dict__[i], other.__dict__[i]): | ||
pass | ||
else: | ||
false_number += 1 | ||
|
||
except TypeError: | ||
if self.__dict__[i] == other.__dict__[i]: | ||
pass | ||
else: | ||
false_number += 1 | ||
self.__dict__[i] == other.__dict__[i] | ||
except: | ||
false_number += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this was modified by mistake, since it is not related to the PR subject.
This would make the following return True
when it should be False
:
import ross as rs
disk0 = rs.DiskElement.from_geometry(2, steel, 0.07, 0.05, 0.28)
disk1 = rs.DiskElement.from_geometry(4, steel, 0.07, 0.05, 0.35)
disk0 == disk1
I am going to open a specific issue because I've just noticed that we do not have tests to check for inequality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this part of the code because when I implemented the synchronous case, I had to compare shaft/bearing elements with disk elements. And in these cases, the old code wasn’t working. I will revert the code back to the previous version and make a modification to fix this problem.
ross/disk_element.py
Outdated
self.__dict__[i] == other.__dict__[i] | ||
except: | ||
false_number += 1 | ||
if other.__class__.__name__ == "DiskElement": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fernandarossi, your lastest commit tests just failed, and I think the reason beghind is this line.
Since you are only comparing with the DiskElement
, when building the DiskElement6DoF
class it will go directly to the else
statement, hence returning False
. A possible solution would be:
if "DiskElement" in other.__class__.__name__:
bbef430
to
3a6bafa
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #931 +/- ##
==========================================
- Coverage 85.21% 85.06% -0.16%
==========================================
Files 35 35
Lines 7583 7613 +30
==========================================
+ Hits 6462 6476 +14
- Misses 1121 1137 +16
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
… dev-sync_ucs_map
Hi there!
|
This is a new result with @fernandarossi changes. @raphaeltimbo This pr ends the issue #573 |
Now, the eigenvalues for the synchronous case are computed directly without the need to iterate the rotor speed.