-
Notifications
You must be signed in to change notification settings - Fork 1
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
* update: cross-section / segment model #5
Conversation
* update model
@@ -1,5 +1,6 @@ | |||
# Tutorial example simulating a 3D mass-spring system with a nonlinear spring (no spring forces | |||
# for l < l_0), n tether segments and reel-in and reel-out. | |||
using PyPlot |
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.
Please remove this line.
@@ -56,7 +57,7 @@ function model(se) | |||
@variables spring_vel(t)[1:se.segments] = zeros(se.segments) | |||
@variables c_spr(t)[1:se.segments] = c_spring0 * ones(se.segments) | |||
@variables spring_force(t)[1:3, 1:se.segments] = zeros(3, se.segments) | |||
@variables total_force(t)[1:3, 1:se.segments] = zeros(3, se.segments) | |||
@variables total_force(t)[1:3, 1:se.segments+1] = zeros(3, se.segments+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.
Why that?
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 tried to understand the original code and found that this line is wrong:
eqs2 = vcat(eqs2, acc[:, i+1] .~ se.g_earth + total_force[:, i] / 0.5*(m_tether_particle))
<== brackets?
In my approach I assumed, that the mass of a segment is concentrated at the end.
As already mentioned:
Some details: there are N segments with (N+1) nodes with masses. Therefore (N+1) forces are needed to calculate the acceleration. For the first and last node the formulas are different. For all other, segment-forces from spring/damper are added.
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.
Well, the mass of a segment is NOT concentrated at the end... But if you think my approach is wrong, can you create a but report?
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.
Alternatively it would also be useful to have test cases...
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 tried to understand the original code and found that this line is wrong:
eqs2 = vcat(eqs2, acc[:, i+1] .~ se.g_earth + total_force[:, i] / 0.5*(m_tether_particle))
<== brackets? In my approach I assumed, that the mass of a segment is concentrated at the end. As already mentioned:Some details: there are N segments with (N+1) nodes with masses. Therefore (N+1) forces are needed to calculate the acceleration. For the first and last node the formulas are different. For all other, segment-forces from spring/damper are added.
Can you perhaps just add your version as a new script, Tether_07b.jl ? Then it is easier to compare both versions.
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'm working on a MTK/Modia3D comparison. For a special case I was running in a stability problem. See: ModiaSim/Modia3D.jl#136
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 prepared a summary of simulations which can be found on: https://github.com/johhell/TestTether.jl
- original MTK implementation
- modified
Tether_07a.jl
(acc. PR) Modia3D
- for comparison
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.
Thanks a lot, that is great! But I have to hand in a paper until 25th of January, not sure if I find the time to look it it earlier.
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.
After reviewing the MTK documentation, I now have a segment-based (not monolithic) model available that provides the same results but offers a better understanding.
The current models do not provide any damping. Rotational damping at each node seems to be very complicated to implement (refer to Modia3D
).
To get a more realistic result, I added a velocity^2
dependent damping force for each mass segment.
This approach can also be used to study the effects of wind on the tether.
See here a first result of 15 segments model with friction-based damping
After some refactoring I will proved the model for discussion within the next few days.
updated version of the segmented based tether model new features are:
|
I added your commit as Tether_08.jl and fixed issues with the latest version of MTK and use ControlPlots instead of PyPlot. I also fixed most issues of Tether_07.jl. If you have the time, please check if the new version of Tether_07.jl matches your results. |
with ref to #4