Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

johhell
Copy link

@johhell johhell commented Jan 8, 2024

with ref to #4

  • update calculation of tether cross-section
  • changes in chain model

* 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
Copy link
Owner

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)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that?

Copy link
Author

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.

Copy link
Owner

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?

Copy link
Owner

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...

Copy link
Owner

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.

Copy link
Author

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

Copy link
Author

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

  1. original MTK implementation
  2. modified Tether_07a.jl (acc. PR)
  3. Modia3D - for comparison

Copy link
Owner

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.

Copy link
Author

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
T8

After some refactoring I will proved the model for discussion within the next few days.

@johhell
Copy link
Author

johhell commented Feb 17, 2024

updated version of the segmented based tether model Tether_08.jl is available on https://github.com/johhell/TestTether.jl

new features are:

  • segmented
  • air friction of moving segments
  • boundary condition at the end can be free defined
  • impact of wind to the tether can be studied (first draft)

@ufechner7
Copy link
Owner

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.

@ufechner7 ufechner7 closed this Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants