Single pendulum with elastic spring (k) and friction (f)

Single pendulum with elastic spring (k) and friction (f) - Why I have an error (???) - Сообщения

#1 Опубликовано: 01.11.2025 03:14:26
Valery Ochkov

Valery Ochkov

62 сообщений из 655 понравились пользователям.

Группа: User

Why I have an error (???) in the sum energy?
Pendulum-PE-KE-SE.sm (71,29 КиБ) скачан 35 раз(а).
Pendulum-PE-KE-SE.gif
Отредактировано 01.11.2025 03:15:46
#2 Опубликовано: 01.11.2025 06:04:33
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1 073 сообщений из 1 734 понравились пользователям.

Группа: User

Hi. With a spring pendulum you have 2 degrees of freedom, thus you need two generalized coords. Using this post: https://smath.com/en-US/forum/topic/AeeMSM/Using-differentials:

image.png

image.png

sp.gif

Spring_Pendulum_lagrangian.sm (120,05 КиБ) скачан 34 раз(а).

Best regards.
Alvaro.
1 пользователям понравился этот пост
Valery Ochkov 01.11.2025 07:22:30
#3 Опубликовано: 01.11.2025 07:22:14
Valery Ochkov

Valery Ochkov

62 сообщений из 655 понравились пользователям.

Группа: User

Is it not correct?
We have 2 degrees of freedom, but can use only one!
Pend-1-Hook.sm (16,68 КиБ) скачан 34 раз(а).
Pend-1-Hook.gif
Отредактировано 01.11.2025 08:38:01
#4 Опубликовано: 01.11.2025 08:39:40
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1 073 сообщений из 1 734 понравились пользователям.

Группа: User

Wrote

Is it not correct?


It isn't. You can not determine the variable length only with the angle. You need another differential equation for the length. For example, see https://www.maplesoft.com/applications/Preview.aspx?id=4897

image.png

with this result:

image.png

The Viacheslav's ode solver It can't handle those types of equations with that degree of coupling yet. For that, you should use the dsol I created, which should be somewhere in the forum, or use al_nleqsolve within the D function as in the other examples, or some other technique for decoupling the system.

In this case, the Lagrangian is uncoupled, so it can be solved directly.

Also, remember that the total energy is the Hamiltonian, so this is probably the correct method for solving problems when the Lagrangian is coupled.

Best regards.
Alvaro.
1 пользователям понравился этот пост
Valery Ochkov 01.11.2025 10:47:16
#5 Опубликовано: 01.11.2025 09:17:26
Valery Ochkov

Valery Ochkov

62 сообщений из 655 понравились пользователям.

Группа: User

I do not stretch or compress the spring before starting.
My case is one partical case of moution. Correct?
Start-Spring.png


Отредактировано 01.11.2025 09:18:33
#6 Опубликовано: 01.11.2025 15:47:34
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1 073 сообщений из 1 734 понравились пользователям.

Группа: User

Wrote

I do not stretch or compress the spring before starting.
My case is one partical case of moution. Correct?



image.png

From your first file. In this example, you know the time law of Longitude, as in the first Maple example. While specifically here it's stationary (it doesn't depend directly on time, but on the angle, which does depend on time), the result is the same: you introduce a constraint, so the system's degrees of freedom are 1 instead of 2. This constraint on motion is imposed by an external force, which causes energy to flow into and out of the system, making the system's energy variable, which I understand is the original question.

However, for the system to be realistic, you need a way to control the length of the bar so that it shortens or lengthens according to the angle it forms with the vertical, which, by the way, is perfectly possible. But that system is precisely what will be modifying the total energy of the system.

Best regards.
Alvaro.

Отредактировано 01.11.2025 15:48:43
1 пользователям понравился этот пост
Valery Ochkov 01.11.2025 17:57:58
#7 Опубликовано: 01.11.2025 19:19:31
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1 073 сообщений из 1 734 понравились пользователям.

Группа: User

Hi. Using the RKA file ( https://smath.com/en-US/files/Download/dZeevW/RKA.sm ) from https://smath.com/en-US/forum/topic/QWpkkQ/Mathcad-Toolbox both methods (Newton and Lagrange) for the spring pendulum. The code in RKA is, like the other one, just only in SMath, this is, it does not use maple nor maxima.

image.png

image.png

Spring_Pendulum_lagrangian.pdf (395,32 КиБ) скачан 31 раз(а).

Spring_Pendulum_lagrangian.sm (271,1 КиБ) скачан 32 раз(а).

Best regards.
Alvaro.
Отредактировано 01.11.2025 19:21:12
1 пользователям понравился этот пост
Valery Ochkov 04.11.2025 10:25:21
#8 Опубликовано: 02.11.2025 02:49:34
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1 073 сообщений из 1 734 понравились пользователям.

Группа: User

Hi. Friction added, Newton and Lagrange parametrized methods.

image.png

Spring_Pendulum_with_friction.sm (275,88 КиБ) скачан 33 раз(а).

Best regards.
Alvaro.
1 пользователям понравился этот пост
sergio 02.11.2025 16:40:15
#9 Опубликовано: 03.11.2025 05:06:46
Valery Ochkov

Valery Ochkov

62 сообщений из 655 понравились пользователям.

Группа: User

  • Новые сообщения
  • Нет новых сообщений