Derivative in Maple

Derivative in Maple - How insert - Сообщения

#21 Опубликовано: 08.12.2023 13:26:36
Valery Ochkov

Valery Ochkov

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

Группа: User

#22 Опубликовано: 08.12.2023 13:52:41
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

Another notable thing about this example is that I would like someone to please explain to me how the hell the Viacheslav plugin manages to handle l'(t) within the equations, because I honestly didn't expect it.


I can add that I did not expect the solver to work adequately. The numerical solver in Mathcad is much more complex. It allows solving mixed systems. Valery poses problems that can't be solved in the same way, since current tools have significant limitations.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 08.12.2023 22:55:00
#23 Опубликовано: 08.12.2023 14:15:21
Valery Ochkov

Valery Ochkov

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

Группа: User

Wrote

Wrote

Another notable thing about this example is that I would like someone to please explain to me how the hell the Viacheslav plugin manages to handle l'(t) within the equations, because I honestly didn't expect it.


I can add that I did not expect the solver to work adequately. The numerical solver in Mathcad is much more complex. It allows solving mixed systems. Valery poses problems that can't be solved in the same way, since current tools have significant limitations.



Слава! А можно снять это ограничение? Нужно, чтобы заработала функция odesolve. Тогда можно будет решать алгебро-дифференциальные уравнение (ADE).

#24 Опубликовано: 08.12.2023 14:20:11
Valery Ochkov

Valery Ochkov

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

Группа: User

#25 Опубликовано: 08.12.2023 14:36:03
Вячеслав Мезенцев

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

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

Группа: Moderator

Ну, теоретически можно доработать алгоритм, чтобы можно было решать совместные системы. Я примерно знаю как это можно было бы сделать, но это требует отдельного исследования. У меня сейчас нет столько времени как было раньше. Текущая реализация была создана "на коленке" в течении пару недель, но обдумывал я её в течении нескольких лет, т.к. мне не хватало знаний c#.
Я иногда знаю что и как можно сделать, но практическая реализация откладывается до лучших времён, т.к. это не основная моя работа. Я в основном занимаюсь разработкой электроники и пишу программы для встраиваемых систем.

Regarding some points in the operation of the solver algorithm. During the transformation process, all functions that have a derivative sign change to the general representation (d/dt). For this reason, it is possible that l'(t) function is calculated numerically. To know for sure, I need to see how the solver works under the debugger.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 08.12.2023 23:27:00
#26 Опубликовано: 08.12.2023 15:36:00
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Wrote

In this version you can specify the initial force in the spring. The initial conditions for x and y are adjusted appropriately. ...



A comparison between Martin's solution and that given by the equations of motion obtained from the Lagrangian. Spoiler: both give the same result.

I'd like to point out how incredibly complicated this problem actually is, and what a series of brilliant implementations Martin makes. For example, where the hell does he get the time derivative of the force on an elastic bar when he is given only the length of the bar as a function of the force? Obviously, it is not enough to apply the theorem of the derivative of the inverse function, but you also have to have a deep knowledge of the mechanics of the system to remember something called tangential stiffness, and although it uses k to represent it, we forgive it because It's German and they are well known to use their own abbreviations. Well, actually I don't know what letter to use, because I don't remember ever using that magnitude for any practical purpose, but in Spanish literature it is quite common to use k for its inverse, which is the constant that appears in Hooke's law. Or at least I think so, because the existence of elastic bodies is actually a complication, they should all be rigid better.

Another notable thing about this example is that I would like someone to please explain to me how the hell the Viacheslav plugin manages to handle l'(t) within the equations, because I honestly didn't expect it.

Federpendel-NL - Lagrangian.sm (257 КиБ) скачан 37 раз(а).

Best regards.
Alvaro.



Alvaro, thanks for the feedback. I know that for the stiffness c or k are used in our textbooks. c seems more natural to symbolize the compliance rather the stiffness. But anyways students can't rely on things always being written the same way, so they have to get used to get it from the context, not from the names. BTW the concept of tangential stiffness and it's inversion is quite common in nonlinear FEA, particularly in material modelling and there writing the matrix as K is quite common.

As to the integration of F: The innocent approach was to avoid the direct inversion of L(F) used by you in a previous example. Integrating the inverted derivative seemed to be a way to let rk do the work. Initially I wrote F'(x,y,x',y') explicitly bu I found that it is sufficient to provide dF/dL and l' is somehow converted and expanded by chain rule inside uni's magic.

And yes, something like odesolve() would be mandatory if the program is to cost nearly the same as Mathcad. Let's hope that there is actually some выручка by selling licenses so that we can expect emerging ressources for development of decent algorithms. And decent documentation, at least on the level of https://home.csulb.edu/~woollett/mbe3ode1.pdf

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Alvaro Diaz Falconi 08.12.2023 23:27:00
#27 Опубликовано: 09.12.2023 03:48:49
Martin Kraska

Martin Kraska

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

Группа: Moderator

Trying to solve a boundary value problem (posed by Valery): find the required angular velocity at an given angular position such that after a given time the pendulum is at a specified angular position
Here we try to get from 100° to 100° in two seconds. It turns out that we have to give an initial velocity of approx. 4 rad/s. The pendulum approaches north pole and comes back just in time. There are infinitely many solutions, if you allow for additional full rotations before the target is reached.

Most of the time I spent on finding a way to embed the numerical solution of the nonlinear differential equation into a numerical solver.
Unfortunately most of the solvers are "special needs" solvers. It is unclear why something can be plotted but not solved. And hardly any good error message. Exception is al_nleqsolve, which gives particularly helpful messages.

Any improvements or insights welcome.

Pendel NL RWP.png
Pendel NL RWP.sm (25 КиБ) скачан 22 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#28 Опубликовано: 09.12.2023 16:54:12
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Hi Martin. I guess that your issue is that the end angle is 460 degrees, not 100. You can also see this post.

Clipboard01.png

bvp2-pend.sm (145 КиБ) скачан 18 раз(а).

Best regards.
Alvaro.
#29 Опубликовано: 09.12.2023 22:42:50
Jean Giraud

Jean Giraud

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

Группа: User

That circle looks weird.

Circle_solve at(2).sm (12 КиБ) скачан 23 раз(а).
#30 Опубликовано: 10.12.2023 03:55:10
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Hi Martin. I guess that your issue is that the end angle is 460 degrees, not 100. You can also see this post.

Best regards.
Alvaro.



Thanks a lot for the hints. In fact, my issue was how to handle the problem with the other solvers. Yet, you seem to prefer al_nleqsolve(), obviously for good reason.

Your bvp-procedure is impressive, it should go to the kernel or at least to a plugin.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#31 Опубликовано: 10.12.2023 04:15:34
Valery Ochkov

Valery Ochkov

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

Группа: User

Well, who will be the first to create a calculation for a damped pendulum suspended on an elastic rod?
Fig-13-GravityTrain.sm (13 КиБ) скачан 18 раз(а).
Fig-13-GravityTrain.png
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений