Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

7 Pages«<567
Options
Go to last post Go to first unread
Offline Razonar  
#121 Posted : 10 December 2021 18:35:23(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 908
Uruguay

Was thanked: 506 time(s) in 325 post(s)
Hi Viacheslav. Thanks again. I guess that with this new feature SMath must to be very close of version 1.0.

Just a question about derivatives. Yours ode solvers returns n-1 columns for the n-degree differential equation, so: which is the better way to implement y <n> (x) : diff(y(x),x,n) ? Because SMath diff doesn't recognize lspline.

I think in 3 or 4 ways: return n columns for the differential equation of degree n, return functions y'(x), y''(x), ... and y<n>(x) as you do for y(x), a function like lspline(3) but for the derivative (something like dlspline) since cubic splines have information about the derivative or a diff function like matlab's, which simply calculates the difference in the values of a vector, for each column of a matrix.

But the truth is, I don't know which method could be the best, nor do I have any idea what is the best way to obtain the function derived from the result of any of your many solvers at this time.

And one last question: could it be possible to implement the graph of parametric functions in the XY Plot plugin? Something like ParamtricPlot (x (t), y (t), a, b ) and that takes the number of points from the plugin configuration, or ParamtricPlot (x (t), y (t), a, b, N ) for N subdivisions (N + 1 points) of the interval a < t < b.

Best regards.
Alvaro.
Offline uni  
#122 Posted : 10 December 2021 20:42:11(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
Originally Posted by: Razonar Go to Quoted Post
And one last question: could it be possible to implement the graph of parametric functions in the XY Plot plugin? Something like ParamtricPlot (x (t), y (t), a, b ) and that takes the number of points from the plugin configuration, or ParamtricPlot (x (t), y (t), a, b, N ) for N subdivisions (N 1 points) of the interval a

I think it is possible to mark a "vector" variable with a tilde "~": ~t. It might look like this. I need to think about whether this will work.

2021-12-10_22-38-31.png

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 11/12/2021(UTC)
Offline Razonar  
#123 Posted : 11 December 2021 10:14:06(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 908
Uruguay

Was thanked: 506 time(s) in 325 post(s)
Originally Posted by: uni Go to Quoted Post

I think it is possible to mark a "vector" variable with a tilde "~": ~t. It might look like this. I need to think about whether this will work.


It looks pretty good.

In the attached an example about how to add an "extra" column to the ode solver for return the last derivative. In the "traditional" implementation it it is not necessary because it is simply the last component of D (t, Y), the argument function of the solvers for systems of differential equations. But if what you have is the higher-order differential equation, things are no longer so simple.

It also shows how to "sterilize units", an expression that I had never read or heard, but that I am copying from Pompelmo. I think it is an easy and effective way to be able to program functions like nonlinear or ode solvers that accept units.

RK23.sm (72kb) downloaded 20 time(s).
RK23.pdf (341kb) downloaded 17 time(s).

Best regards.
Alvaro.

Edited by user 11 December 2021 10:16:00(UTC)  | Reason: Not specified

thanks 2 users thanked Razonar for this useful post.
on 11/12/2021(UTC),  on 11/12/2021(UTC)
Offline uni  
#124 Posted : 13 December 2021 13:52:46(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
SMath Studio compatibility

Plugin updated.

Changes:

- added support for ODE systems with many variables;
- Adams() ode solver added (explicit Adams-Bashforth 5);
- CWD and TOL variables added;
- project restructured.

I don't know what AB method is used in Mathcad, but it clearly uses an adaptive step, since the usual explicit AB method is unstable (the small stiffness of the task makes it so).

Click to enlarge Click to enlarge Click to enlarge

Mathcad%20Block.%20Adams.sm Lorenz%20attractor.sm Chua's%20circuit.sm

Edited by user 13 December 2021 18:22:33(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 13/12/2021(UTC),  on 14/12/2021(UTC)
Offline uni  
#125 Posted : 13 December 2021 21:48:49(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
SMath Studio compatibility

Plugin updated.

Changes:

- Adams variable added (allows you to choose a method for the Adams() solver): "AB1".."AB8", "AB5" - default;
- CWD variable value changed.

To calculate the first steps of the method, Runge-Kutta of the 4th order is used, so while the order is not higher than the 5th it makes sense.

Click to enlarge

Edited by user 15 December 2021 15:50:36(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 14/12/2021(UTC)
Offline uni  
#126 Posted : 15 December 2021 15:49:35(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
SMath Studio compatibility rkfixed.cs

Plugin updated.

Changes:

- rkfixed variable added (allows you to choose a method for the rkfixed() solver: "RK1".."RK6", "RK4" - default);
- to calculate the first steps for the Adams() solver now Runge-Kutta of the 6th order is used.

Edited by user 16 December 2021 11:16:47(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 1 user thanked uni for this useful post.
on 15/12/2021(UTC)
Offline AleksMoisei  
#127 Posted : 17 December 2021 18:39:58(UTC)
AleksMoisei

Rank: Newbie

Groups: Registered
Joined: 15/05/2020(UTC)
Posts: 7
Russian Federation
Location: Voronezh

Скажите пожалуйста, можно ли с помощью данного расширения производить символьные расчеты как в Маткаде или только это касается графиков. Пробую посчитать символьно передаточную функцию, задействовал Maple Tools, simplify выдал что-то не то что должен был по моим разумениям. Raschjot17.sm (25kb) downloaded 8 time(s).

Edited by user 17 December 2021 18:41:52(UTC)  | Reason: Not specified

Offline uni  
#128 Posted : 17 December 2021 19:30:28(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
Originally Posted by: AleksMoisei Go to Quoted Post
Скажите пожалуйста, можно ли с помощью данного расширения производить символьные расчеты как в Маткаде или только это касается графиков. Пробую посчитать символьно передаточную функцию, задействовал Maple Tools, simplify выдал что-то не то что должен был по моим разумениям.]

Это расширение большей частью реализует численные аналоги некоторых функций из Mathcad. Символьные же вычисления можно попробовать выполнять при помощи MapleTools и функции maple(). Если она работает как-то не так, то можно посмотреть о "переговорах" между движками при помощи файла лога MapleTools.log, который находится в папке с плагином, если в файле конфигурации MapleTools.config включена опция отладки (<Debug>True</Debug>).

Путь такой: %appdata%\SMath\extensions\plugins\32dfd679-8cfd-483a-b79a-19d5ea838750\

Его нужно скопировать и вставить в адресную строку Проводника. Дальше выбрать подпапку с последний версией плагина, отредактировать файл MapleTools.config при закрытой программе и запустить её снова. После этого при старте будет создаваться файл лога MapleTools.log, в котором можно увидеть что именно передаёт функция maple() в символьный движок дополнения и как тот отвечает. Ну, а дальше уже искать ошибки.

Следует также отметить, что синтаксис команды скорее всего будет отличаться, т.к. Mathcad имеет специальную обёртку, "скрывающую" некоторые дополнительные действия, чтобы перевести его запрос на понятный символьному движку "диалект". Поэтому нельзя в общем случае писать также как в Mathcad. Нужно понимать как работает Maple и быть знакомым с его командами, их форматами вызова.

Edited by user 17 December 2021 19:39:14(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline Razonar  
#129 Posted : 17 December 2021 22:45:31(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 908
Uruguay

Was thanked: 506 time(s) in 325 post(s)
Originally Posted by: AleksMoisei Go to Quoted Post


... Maple Tools, simplify выдал что-то не то что должен был по моим разумениям. Raschjot17.sm (25kb) downloaded 8 time(s).


Hi. Notice that SMath does not operate automatically expands matrix operations. Also, the maple's linalg package have some issues too, and sometimes needs to call evalm function, which means "eval as matrix".

If D is a scalar I suppose that the correct result is (2), but if it is a 2x2 matrix I think it is (3).

In both cases you cannot calculate A ^ (- 1) because the second column of A is zero.

img0.png

Could you comment what is the expression you expect for A? Also perhaps something from this post may be useful to you: https://en.smath.com/for...d-laplace-transform.aspx

Best regards.
Alvaro.
Offline uni  
#130 Posted : 21 December 2021 12:26:33(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
Updated test for the ODE solvers.

Section Math ODE precision (uni).sm (35kb) downloaded 4 time(s).

Original document: Section Math ODE precision.sm (24kb) downloaded 46 time(s).

Click to enlarge Click to enlarge

Edited by user 22 December 2021 22:38:38(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 21/12/2021(UTC),  on 22/12/2021(UTC)
Offline uni  
#131 Posted : 27 December 2021 23:04:34(UTC)
uni


Rank: Advanced Member

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

Was thanked: 1117 time(s) in 644 post(s)
I finally figured out how it works Good

Mathcad Block. Spring pendulum.sm (49kb) downloaded 14 time(s).

Click to enlarge Mathcad Block. Spring pendulum.gif

Edited by user 28 December 2021 01:19:04(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 27/12/2021(UTC),  on 28/12/2021(UTC)
Users browsing this topic
7 Pages«<567
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.