Rope

Rope - Сообщения

#1 Опубликовано: 26.03.2024 17:52:29
Valery Ochkov

Valery Ochkov

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

Группа: User

How can we solve this task in SMath?
3-mass.pdf (313 КиБ) скачан 59 раз(а).
#2 Опубликовано: 09.04.2024 01:07:47
StvMath

StvMath

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

Группа: User

I decided to have some fun by trying to solve this using only SMath basic capabilities. I found it easier to turn everything upside-down (i.e. to pretend that gravity pulled up instead of down!) and only reverted to the normal view when plotting the position graphs.
I used an ultra-simple approach based on getting three sets of guesses for each mass coordinate and iterating until their differences were smaller than my specified tolerance. It’s crude, but it worked!
Life would be much simpler of course if SMath had its own minimize or maximize function.


3_weights_stvmath.sm (37 КиБ) скачан 34 раз(а).
1 пользователям понравился этот пост
Valery Ochkov 09.04.2024 02:40:00
#3 Опубликовано: 09.04.2024 03:08:28
Valery Ochkov

Valery Ochkov

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

Группа: User


>Life would be much simpler of course if SMath had its own minimize or maximize function...

...with constrains.
#4 Опубликовано: 09.04.2024 14:52:23
Valery Ochkov

Valery Ochkov

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

Группа: User

3-mass.png
#5 Опубликовано: 09.04.2024 16:25:15
StvMath

StvMath

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

Группа: User

Posted 




Yes. In the loop where it checks for unacceptable y2 values I should have added the line, msg:="Unacceptable y2 values. Try different initial guesses".
Additionally, by changing lambda = lambda/2 to lambda = -lambda, it seems to work ok!
If you change the initial guess for y2 to 11.5 it also works ok.


Note: The method is very crude. It won't work for more than three weights, for example, without significant modification.
#6 Опубликовано: 13.04.2024 23:07:21
StvMath

StvMath

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

Группа: User

I'm still playing with this example!

The attached uses a force-based approach, rather than an energy=based one.

I couldn't figure out how to use the in-built Jacobian functions for my forces function, so had to construct it by hand (luckily, it's a very simple task here).

3_weights_stvmath_b.sm (38 КиБ) скачан 33 раз(а).
3 пользователям понравился этот пост
Oscar Campo 13.04.2024 23:59:00, Valery Ochkov 14.04.2024 02:16:00, ioan92 14.04.2024 02:54:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений