Double pendulum model and animation

Double pendulum model and animation - Is the model correct? - Messaggi

#1 Pubblicato: 29/10/2025 09:15:19
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Hi friends!
Now I am on the forum again!
Anime2.sm (55,59 KiB) scaricato 1043 volta(e).
Anime2.png
But the model is not correct. See please Alvaro model!
Modificato 30/10/2025 19:22:14
#2 Pubblicato: 29/10/2025 10:45:45
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Using X-Y Plot

Anime2-xyplot.sm (57,84 KiB) scaricato 1078 volta(e).

Double pendulum model and animation.gif
Russia ☭ forever, Viacheslav N. Mezentsev
2 utenti hanno apprezzato questo post
sergio 29/10/2025 14:50:17, Ricardo_Herrera 03/01/2026 14:15:17
#3 Pubblicato: 29/10/2025 11:14:52
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Thanks, Слава!
Anime2-x-y-plot.png
Modificato 29/10/2025 13:53:54
1 utenti hanno apprezzato questo post
Alvaro 30/10/2025 07:04:33
#4 Pubblicato: 29/10/2025 13:56:31
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User


Anime-x-y-plot.sm (18,24 KiB) scaricato 1002 volta(e).
And where here is a bug?
#5 Pubblicato: 29/10/2025 14:01:44
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Vector t must be defined below before the component.
The animation feature is still being developed when I have time for it.

image.png
Modificato 29/10/2025 14:05:45
Russia ☭ forever, Viacheslav N. Mezentsev
1 utenti hanno apprezzato questo post
Alvaro 30/10/2025 07:04:42
#6 Pubblicato: 29/10/2025 17:02:10
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Слава, а когда этот новая версия плагина появилась?
#7 Pubblicato: 29/10/2025 18:19:29
Вячеслав Мезенцев

Вячеслав Мезенцев

1.558 apprezzamenti in 1.868 post.

Gruppo: Moderator

Citazione

Слава, а когда этот новая версия плагина появилась?


В конце лета.

image.png
Modificato 29/10/2025 18:21:02
Russia ☭ forever, Viacheslav N. Mezentsev
#8 Pubblicato: 30/10/2025 07:07:54
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi. My approach to solving the double pendulum problem.

dp.gif

double_pendulum.sm (75,92 KiB) scaricato 1090 volta(e).

Best regards.
Alvaro.
3 utenti hanno apprezzato questo post
Вячеслав Мезенцев 30/10/2025 09:13:40, sergio 30/10/2025 12:18:26, Valery Ochkov 30/10/2025 07:45:32
#9 Pubblicato: 30/10/2025 13:32:00
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Newton vs Lagrange
Pendulum-2.xmcd (119,12 KiB) scaricato 1069 volta(e).
Pendulum-2.gif
#10 Pubblicato: 30/10/2025 18:31:11
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

My little edit
Pendulum-Animation-Correct.gif
1 utenti hanno apprezzato questo post
Alvaro 31/10/2025 04:29:45
#11 Pubblicato: 30/10/2025 19:33:11
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Triple pendulum - see errors at the second haft of time interval.
Pendulum-3-for-SMath.xmcd (220,62 KiB) scaricato 1150 volta(e).
Pendulum-3-for-SMath.gif
Modificato 30/10/2025 19:39:16
1 utenti hanno apprezzato questo post
Alvaro 31/10/2025 05:05:16
#12 Pubblicato: 31/10/2025 05:03:31
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi. Using pure SMath code to deduce the equations of motion from the Lagrangian, with the functions in this post: https://smath.com/en-US/forum/topic/AeeMSM/Using-differentials.

image.png

double_pendulum_lagrangian.sm (174,64 KiB) scaricato 1032 volta(e).

double_pendulum_lagrangian.pdf (503,4 KiB) scaricato 781 volta(e).

Best regards.
Alvaro.
2 utenti hanno apprezzato questo post
Valery Ochkov 31/10/2025 07:37:56, sergio 31/10/2025 08:48:37
#13 Pubblicato: 31/10/2025 05:10:58
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Wrote

Triple pendulum - see errors at the second haft of time interval.



I no longer use Mathcad, except on rare occasions, when I rely on Mathcad version 11, which I consider the last decent version. So I can't see the triple pendulum file. And I suppose this is the situation for many SMath users who no longer have Mathcad readily available. But more than worrying about the conservation of energy, which seems to be a problem with the numerical method used, I'm more surprised to see how the future affects the past, since the animation shouldn't alter the trajectories already described by the particles as time passes.

This is my approach to the triple pendulum.

image.png

tp.gif

triple_pendulum_lagrangian.sm (135,01 KiB) scaricato 1006 volta(e).

triple_pendulum_lagrangian.pdf (248,09 KiB) scaricato 644 volta(e).

Best regards.
Alvaro.
Modificato 31/10/2025 06:13:23
2 utenti hanno apprezzato questo post
Valery Ochkov 31/10/2025 07:38:10, Вячеслав Мезенцев 31/10/2025 07:18:43
#14 Pubblicato: 31/10/2025 07:35:30
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Wrote


I no longer use Mathcad,


See pls pdf
Pendulum-3-for-SMath.pdf (589,25 KiB) scaricato 685 volta(e).
Modificato 31/10/2025 07:38:52
#15 Pubblicato: 31/10/2025 08:37:45
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Wrote

See pls pdf


With those values:

image.png

tp2.gif

triple_pendulum_lagrangian.sm (159,26 KiB) scaricato 1035 volta(e).

Best regards.
Alvaro.
1 utenti hanno apprezzato questo post
Valery Ochkov 31/10/2025 10:39:04
#16 Pubblicato: 31/10/2025 10:38:47
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Wrote

Wrote


I'm more surprised to see how the future affects the past, since the animation shouldn't alter the trajectories already described by the particles as time passes.
Best regards.
Alvaro.



For me too!
#17 Pubblicato: 01/11/2025 01:52:48
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Wrote

Wrote

See pls pdf


With those values:
image.png
Best regards.
Alvaro.


One my plot:
Change of three types of energy of a swinging pendulum on an elastic suspension - SE - the spring energy
PKE-Energy.png
Modificato 01/11/2025 01:55:02
#18 Pubblicato: 05/11/2025 07:01:02
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Alvaro, hi!
Is it posibble to solve the single pendulun problem with Lagrangian and rkfixed but without the al_nleqsolve function?
Modificato 05/11/2025 08:29:15
#19 Pubblicato: 06/11/2025 04:03:01
Alvaro

Alvaro

1.139 apprezzamenti in 1.805 post.

Gruppo: User

Hi Valery. For the single pendulum you can get the lagrangian from the olf post about differentials ( https://smath.com/en-US/forum/topic/AeeMSM/Using-differentials ) It's very simple and doesn't require much processing to use rkfixed.

image.png

For the double pendulum, you can use Newton-Raphson to solve the system within the function D. Here, a very simple version of the method is used.

image.png

double_pendulum_lagrangian-NR.sm (178,15 KiB) scaricato 1018 volta(e).

Something similar applies to the pendulum with a spring. Note that the Lagrange equations become somewhat complicated because I use the x,y coordinates to calculate the kinetic energy, and SMath cannot simplify trigonometric functions. However, if you use r, θ' (in green), the equations of motion are greatly simplified. But that breaks the principle that the program should do the calculations, not the user.

image.png

Best regards.
Alvaro.
1 utenti hanno apprezzato questo post
Valery Ochkov 06/11/2025 05:16:18
#20 Pubblicato: 06/11/2025 11:47:20
Valery Ochkov

Valery Ochkov

67 apprezzamenti in 713 post.

Gruppo: User

Wrote

Hi Valery. For the single pendulum you can get the lagrangian from the olf post about differentials ( https://smath.com/en-US/forum/topic/AeeMSM/Using-differentials ) It's very simple and doesn't require much processing to use rkfixed.
Alvaro.



Hi Alvaro!

Can you create this simple sm-file with animation? Single pendulum!
Thanks!
  • Nuovi post
  • Nessun nuovo post