Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline uni  
#1 Posted : 21 July 2018 20:52:47(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
SADEL

SMath Studio compatibility SMath Viewer compatibility mono compatibility Extension page Sources


Functions list: manzhuk(5|6|7)


DAE (ODE) solvers:

manzhuk(init, x1, x2, intvls, D)

Arguments:

- init is either a vector of n real initial values, where n is the number of unknowns (or a single scalar initial value, in the case of a single ODE).
- x1 and x2 are real, scalar endpoints of the interval over which the solution to the ODE(s) is evaluated. Initial values in init are the values of the ODE function(s) evaluated at x1.
- intvls is the integer number of discretization intervals used to interpolate the solution function. The number of solution points is the number of intervals + 1.
- D is a vector function of the form D(x,y) specifying the right-hand side of the system

manzhuk(init, x1, x2, intvls, G, J1)
manzhuk(init, x1, x2, intvls, G, J1, J2)




manzhuk. Kinetic curves.sm (14kb) downloaded 65 time(s).
manzhuk. Van der Pol oscillator 1.sm (11kb) downloaded 57 time(s).
manzhuk. Van der Pol oscillator 2.sm (14kb) downloaded 49 time(s).
manzhuk. Lorenz-Attractor.sm (17kb) downloaded 50 time(s).

manzhuk. Kinetic curves.pdf (39kb) downloaded 48 time(s).
manzhuk. Van der Pol oscillator 1.pdf (47kb) downloaded 39 time(s).
manzhuk. Van der Pol oscillator 2.pdf (63kb) downloaded 41 time(s).
manzhuk. Lorenz-Attractor.pdf (66kb) downloaded 42 time(s).

Manual (rus): DAE-solver-manzhuk.pdf (3,499kb) downloaded 72 time(s).

Links:

1. SADEL.

Edited by user 15 August 2019 13:57:03(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 5 users thanked uni for this useful post.
on 21/07/2018(UTC),  on 21/07/2018(UTC),  on 21/07/2018(UTC),  on 23/07/2018(UTC),  on 07/12/2018(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline uni  
#2 Posted : 22 July 2018 02:00:49(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. Short form added.



manzhuk. Kinetic curves (short).sm (12kb) downloaded 48 time(s).
manzhuk. Lorenz-Attractor (short).sm (16kb) downloaded 41 time(s).
manzhuk. Van der Pol oscillator 1 (short).sm (10kb) downloaded 39 time(s).
manzhuk. Van der Pol oscillator 2 (short).sm (13kb) downloaded 38 time(s).
manzhuk. Arenstorf Orbit (short).sm (17kb) downloaded 47 time(s).

manzhuk. Kinetic curves (short).pdf (38kb) downloaded 34 time(s).
manzhuk. Lorenz-Attractor (short).pdf (64kb) downloaded 33 time(s).
manzhuk. Van der Pol oscillator 1 (short).pdf (46kb) downloaded 33 time(s).
manzhuk. Van der Pol oscillator 2 (short).pdf (62kb) downloaded 33 time(s).
manzhuk. Arenstorf Orbit (short).pdf (56kb) downloaded 35 time(s).

Edited by user 22 July 2018 02:49:39(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 22/07/2018(UTC),  on 22/07/2018(UTC)
Offline uni  
#3 Posted : 22 July 2018 19:21:16(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated. manzhuk() now more stable. Don't use hmx parameter. By default, its value is dt / 2.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 22/07/2018(UTC)
Offline Jean Giraud  
#4 Posted : 23 July 2018 02:41:12(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: uni Go to Quoted Post
Updated. Short form added.


Thanks Uni.
The complete Smath code might be educative.
mwode45 solves as well.

Jean

ODE manzhuk Arenstorf Orbit.sm (22kb) downloaded 53 time(s).

Offline Jean Giraud  
#5 Posted : 23 July 2018 04:16:45(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Circular/elliptic orbits.

ODE rkfixed Orbit.sm (42kb) downloaded 50 time(s).
Offline omorr  
#6 Posted : 23 July 2018 09:23:04(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello uni,

It seems this is a quite interesting ODE-DAE solver. I did not understand what the matrices J1 and J2 are. The manual is quite complicated for me. I just supposed that J1,J2 have something to do with DAE (differential algebraic equations). It seems to me that J1 is the Jacobian matrix regarding the vector of parameters (third argument in the function G()). I suppose J2 is again some kind of Jacobian matrix.

If one of your motivation was to have a DAE solver in SMath, I appreciate that very much.

Looking forward for some more examples from you about using this solver - especially DAE systems.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline uni  
#7 Posted : 23 July 2018 11:55:52(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
I'll add the examples later.

2018-07-23_18-43-02.png

Edited by user 23 July 2018 16:43:25(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 3 users thanked uni for this useful post.
on 23/07/2018(UTC),  on 23/07/2018(UTC),  on 23/07/2018(UTC)
Offline Jean Giraud  
#8 Posted : 23 July 2018 16:58:21(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: omorr Go to Quoted Post
If one of your motivation was to have a DAE solver in SMath, I appreciate that very much.


DAE are each specific, I don't think a generalized solver can be designed,
only for odd examples ... I may be wrong , and wish the best.

DAE.PNG
Offline uni  
#9 Posted : 23 July 2018 17:54:48(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
I have more than 12 examples of how to use it, but, unfortunately, symbolic interpreter slows down the computation of the algorithm. So I decided to show an alternative version of its use, using the Script component. I hope that I will succeed.
Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 23/07/2018(UTC),  on 23/07/2018(UTC)
Offline uni  
#10 Posted : 01 August 2018 18:10:59(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Simple test 1.



manzhuk.test1.sm (12kb) downloaded 51 time(s).
manzhuk.test1.pdf (49kb) downloaded 50 time(s).

Edited by user 01 August 2018 19:14:42(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 01/08/2018(UTC)
Offline uni  
#11 Posted : 06 December 2018 22:12:13(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Updated.

Changes:
- zero point issue partially fixed;
- added support for the simple D(t,x) definition.

Edited by user 06 December 2018 22:24:09(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline figa  
#12 Posted : 12 March 2020 18:44:42(UTC)
figa

Rank: Newbie

Groups: Registered
Joined: 12/03/2020(UTC)
Posts: 4
Russian Federation
Location: krasnoyarsk

Good afternoon!

I use sadel to calculate the parameters of the transient in the RLC-circuit.
Why doesn't time go by in calculations? file attached model2_sadel_p.sm (26kb) downloaded 33 time(s).
Offline uni  
#13 Posted : 12 March 2020 19:43:04(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Можно посмотреть на описание задачи в изначальной форме?
Russia ☭ forever
Viacheslav N. Mezentsev
Offline figa  
#14 Posted : 12 March 2020 19:55:48(UTC)
figa

Rank: Newbie

Groups: Registered
Joined: 12/03/2020(UTC)
Posts: 4
Russian Federation
Location: krasnoyarsk

Originally Posted by: uni Go to Quoted Post
Можно посмотреть на описание задачи в изначальной форме?


Схема замещения https://i.imgur.com/9p8FrH3.png
Система дифуров, описывающая процессы, происходящие при разряде https://i.imgur.com/Qf2fE8w.png
Взаимная индуктивность https://i.imgur.com/lRdX1Hp.png

Входные параметры электрической цепи рассчитаны, но сомнений не вызывают
Offline uni  
#15 Posted : 13 March 2020 14:00:34(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Для начала нужно в выражении G(t,x,xp) исправить xp на px. Смущает выражение для второй производной. Кажется, что первая и вторая производные dx/dt должны быть как-то связаны. Я не составлял подобных систем и с ходу не могу сказать что не так. Хорошо бы ещё посмотреть на результат моделирования схемы в специализированной программе, чтобы убедиться, что начальные условия и параметры схемы действительно приводят к какому-то не нулевому результату.

Ещё, мне кажется, что не обязательно использовать библиотеку SADEL для решения этой системы, а можно попробовать использовать любые другие решатели, чтобы избавиться от px-параметра.

Edited by user 13 March 2020 14:04:44(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline figa  
#16 Posted : 13 March 2020 14:09:48(UTC)
figa

Rank: Newbie

Groups: Registered
Joined: 12/03/2020(UTC)
Posts: 4
Russian Federation
Location: krasnoyarsk

Originally Posted by: uni Go to Quoted Post
Для начала нужно в выражении G(t,x,xp) исправить xp на px.

действительно! не заметила. Но конечно это исправление не помогло, программа видимо умнее меня, сама догадалась что имелось ввиду

Originally Posted by: uni Go to Quoted Post
Смущает выражение для второй производной. Кажется, что первая и вторая производные dx/dt должны быть как-то связаны. Я не составлял подобных систем и с ходу не могу сказать что не так.

dx/dt=v, dv/dt=a. Когда составлялась система дифуров вместо второй производной использовалась первая

Originally Posted by: uni Go to Quoted Post
Хорошо бы ещё посмотреть на результат моделирования схемы в специализированной программе, чтобы убедиться, что начальные условия и параметры схемы действительно приводят к какому-то не нулевому результату.

это хорошая идея, попробую. Просто я опираюсь на источники, где описаны именно такая схема, именно такая система дифуров и именно такие входные параметры. Я пытаюсь пока что просто повторить. Это дает определенную уверенность, что должно работать. Хотя не исключено, что где-то упущена ошибка.

То, что в результатах расчета время не движется - это такая реакция программы на то, что она не может посчитать? Не могу понять о чем это говорит

Offline uni  
#17 Posted : 13 March 2020 14:24:49(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Нужно, чтобы ier был равен нулю, тогда можно делать интерпретации результата. Этого можно достичь, если исправить указанную ошибку и отключить задание минимального шага интегрирования (hmn) или сделать его меньше. Дальше нужно проверить опечатки в системе. Я посмотрю под отладчиком почему время не меняется.

Edited by user 13 March 2020 14:31:53(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline uni  
#18 Posted : 13 March 2020 14:55:08(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Можно писать вот так, чтобы было нагляднее, но промежуточные вычисления в этом случае замедлят работу функции.

Sistema DU.png
Russia ☭ forever
Viacheslav N. Mezentsev
Offline figa  
#19 Posted : 13 March 2020 16:45:36(UTC)
figa

Rank: Newbie

Groups: Registered
Joined: 12/03/2020(UTC)
Posts: 4
Russian Federation
Location: krasnoyarsk

Originally Posted by: uni Go to Quoted Post
Можно писать вот так, чтобы было нагляднее, но промежуточные вычисления в этом случае замедлят работу функции.



вы имеете ввиду нагляднее для того, кто пишет/читает функцию? т.е. другая форма записи?

это здорово - я попробовала так написать, так тоже запускается расчет, правда результат тот же плачевный :'(
Offline uni  
#20 Posted : 13 March 2020 17:24:51(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,493
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
По сути это та же форма записи, так как результат работы функции определяется последним выражением блока программы. Определение переменных из вектора k можно вынести из программного блока на лист, т.к. это константы. Ещё нужно всем выражениям указать численный тип оптимизации в свойствах контекстного меню.
Что касается численного моделирования, то можно попробовать посчитать в Proteus данную схемку. Там только нужно подумать как имитировать ключ.

А что за книжка-то?

Edited by user 13 March 2020 17:27:09(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.