Mathcad Toolbox

Mathcad Toolbox - Contains analogs of functions from Mathcad - Сообщения

#61 Опубликовано: 08.10.2015 02:28:39
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

I have solved one equation in sage math but not able understand how to solve in smath anybody can guide me on this. below is my equation

exercise1

r = var('r')
PI = pi.n()
rc = 281
rw = 262
Bc = 36/180*PI
F = (r^2-rw^2)*sqrt(rc^2-r^2*sin(Bc)^2)/sqrt((rc^2-rw^2)^2*rc^2*cos(Bc)^2-(r^2-rw^2)^2*(rc^2-r^2*sin(Bc)^2))
F.show()

z = function('z',r)
d = desolve_rk4(diff(z,r)-F,z,ics=[rc,0],end_points=255,step=-0.01)
list_plot(d,plotjoined=True, aspect_ratio=1)


Try this.

ODE example.sm (8 КиБ) скачан 97 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
#62 Опубликовано: 05.09.2016 14:09:30
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

This also means that those who installed ODESolvers plug-in before 17 August 2015 will never see any updates of this plug-in and will always use outdated version. That is why I think SMath Studio message you mentioned is a good thing. I suggest to delete installed version of ODESolvers plug-in (using Extensions Manager - select plug-in and press uninstall button at the bottom of the dialog) and then install it again.

Best regards, Andrey Ivashov.



Please, uninstall and install the plugin again.
Russia ☭ forever, Viacheslav N. Mezentsev
#63 Опубликовано: 06.09.2016 01:01:43
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I have solved one equation in sage math but not able understand how to solve in smath anybody can guide me on this. below is my equation


_____________________________

Commonly, many are confused with RK's. RK's does not output the integral curve.
They output the "cumulative area". They belong to the class "Lagrangian methods".
RK's are NOT solvers, RK's are "Integrators". They are considered more exact than
the simple Finite Differences. Very useful for integrating "systems".

Here is your example in Smath 5346 [April 2014].

Jean

ODE RK4 Example.sm (17 КиБ) скачан 79 раз(а).

1 пользователям понравился этот пост
#64 Опубликовано: 06.09.2016 02:01:49
Jean Giraud

Jean Giraud

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

Группа: User

... suite:

I have sanity checked your example, bad news: RK4 is very inaccurate.
Why is that so ? RK's are "ping pong" pieces of polynomials. Thus
turning affected by the large range of the 'x' variate. For ultimate
accuracy in this simple example, you can use the "Romberg" integrator.
This integrator works in the 0..1 range, scaled back to the 'x' range.
From various testing, I have categorised Romberg accurate to 12...15
decimals. In Scientific/Engineering works, the RK4 example is not
the best candidate. The Romberg= data is disabled, it takes few minutes.

Jean

ODE RK4 Example.sm (24 КиБ) скачан 78 раз(а).


#65 Опубликовано: 06.09.2016 02:32:07
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

Jean,

We all know that rkfixed() is not accurate, why you did not use Rkadapt() as usual we do in Mathcad?

Regards,
Ra

EDIT: BTW, If Romberg was activated in the recent SMath, it will be solved in few seconds (not in few minutes as mentioned)

Moreover, if you use lower number of steps ( "4:number" ), for example if you use 20:

sol:= Rkadapt([0],255,280,20,D(x,y))

Rkadapt will fail with the error: "Index was outside the the bonds of the array". I know that uni made these two functions rkfixed() and Rkadapt() quite long time ago, and he also made much better ODE solvers in the meantime
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#66 Опубликовано: 06.09.2016 09:39:21
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Jean,

We all know that rkfixed() is not accurate, why you did not use Rkadapt() as usual we do in Mathcad?

Regards,
Ra



Can't be more right Radovan, thanks for the comment.
1. Refactored a bit
2. Lorenz attractor Rkadapt added.
This attractor was animated last week [visit: Lorenz attractor]

Have a good day, Jean

ODE [rk4, Rkadapt, Lorenz].sm (37 КиБ) скачан 98 раз(а).

#67 Опубликовано: 16.09.2016 10:40:33
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated for the fully automatic build using Release Manager.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Andrey Ivashov 16.09.2016 12:57:00
#68 Опубликовано: 23.06.2018 17:53:16
overlord

overlord

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

Группа: Moderator

Installing ODE Solvers plugin this is causing forced close on Arch Linux + Mono.
After forced close you cannot be able to open Smath again unless manually deleting the plugin.

Regards
#69 Опубликовано: 23.06.2018 18:34:17
Вячеслав Мезенцев

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

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

Группа: Moderator

Because the plugin is not compatible with Linux + Mono:

Цитата

Intel ODE Solvers Library (VS2013 + VS2008, .Net 2.0, C#, C++/CLI, Win32 + x64).



Win32 + x64 - means Windows only, C++/CLI - unmanaged code used.
Russia ☭ forever, Viacheslav N. Mezentsev
#70 Опубликовано: 19.07.2018 07:45:36
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. Skip intel ode assembly loading if Linux used. So in Linux only 2 functions available: rkfixed() and Rkadapt().

Raspbian on RaspberryPi 3.

2018-07-19_15-43-48.png
Russia ☭ forever, Viacheslav N. Mezentsev
#71 Опубликовано: 01.08.2018 13:12:03
Вячеслав Мезенцев

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

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

Группа: Moderator

Simple intel ode test 2.

[albumimg]1500[/albumimg]

iode.test2.sm (22 КиБ) скачан 126 раз(а).
iode.test2.pdf (121 КиБ) скачан 98 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
sergio 01.08.2018 18:06:00
#72 Опубликовано: 03.12.2018 17:21:26
Вячеслав Мезенцев

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

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

Группа: Moderator

Updated. Fixed issue with zero point.

ODE test 3. Something wrong with Rkadapt().

[albumimg]1526[/albumimg]

iode.test3.sm (24 КиБ) скачан 54 раз(а).
iode.test3.pdf (112 КиБ) скачан 52 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 03.12.2018 22:25:00
#73 Опубликовано: 03.12.2018 23:32:02
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote



ODE test 3. Something wrong with Rkadapt().



Hi Viacheslav. It seems that for Rkadapt t repeats itself, at least for low N values. Maybe you can handle that with some if abs(t[n+1]-t[n])<(some tol) then do something for modify t, and not add it to the final solution. Probably it could be because your step size goes too short.

Clipboard01.gif

Best regards.
Alvaro.

PD: I try to use albuming for the image, but fails.
#74 Опубликовано: 04.12.2018 01:40:00
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

ODE test 3. Something wrong with Rkadapt().



Nothing more deceiving than experimenting ODEsolve.
The attached is worth the visit !

ODE Yuk.sm (28 КиБ) скачан 58 раз(а).
#75 Опубликовано: 04.12.2018 01:43:31
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Nothing more deceiving than experimenting ODEsolve.
The attached is worth the visit !



This one is interesting as well

ODE_0 Rkadapt Analyze.sm (40 КиБ) скачан 52 раз(а).
#76 Опубликовано: 04.12.2018 09:55:44
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

Hi Viacheslav. It seems that for Rkadapt t repeats itself, at least for low N values.



It looks OK to me from Rkadapt design.
It reaches solution in 42 steps vs fixed 100.

iode.test3 Strip Rkadapt.sm (11 КиБ) скачан 49 раз(а).
#77 Опубликовано: 04.12.2018 10:17:01
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

It reaches solution in 42 steps vs fixed 100.



... In fact: Rkadapt reaches solution in 35 steps.
MCD Rkadapt results in equally spaced solutions.
MCD rkadapt comes with two extra parameters
"acc" accuracy
"s" step size
As it looks Smath Rkadapt muffs the start,
Try 34/35 => observe the result.

iode.test3 Strip Rkadapt.sm (16 КиБ) скачан 49 раз(а).

#78 Опубликовано: 04.12.2018 10:31:24
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

ODE test 3. Something wrong with Rkadapt().



Here is another oddity: NO Smath ODE solvers cope with the 'Floor".

ODE rkfixed Pulse Pitfall.sm (57 КиБ) скачан 59 раз(а).
#79 Опубликовано: 04.12.2018 12:10:00
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Wrote



ODE test 3. Something wrong with Rkadapt().



Hi Viacheslav. It seems that for Rkadapt t repeats itself, at least for low N values. Maybe you can handle that with some if abs(t[n+1]-t[n])<(some tol) then do something for modify t, and not add it to the final solution. Probably it could be because your step size goes too short.



Wrote


MCD rkadapt comes with two extra parameters
"acc" accuracy
"s" step size



Hi. Probably, acc = (some tol) and s = minimun step size, in case that s = s/2 is too small.

Best regards.
Alvaro.
#80 Опубликовано: 05.12.2018 15:34:53
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

ODE test 3. Something wrong with Rkadapt().



Thanks Viacheslav for your dedication,

There is no such test function wrt ODE solvers. Each case is specific.
This is so true that the specific Radau ODE solver was designed for HIRES.
Many projects need fixed steps, other are solved via Rkadapt.
YUK & RK4 lasted quite a while in the Mathsoft Collaboratory.
They are reliable, again no way to verdict with others w/o test reference data.

Cheers ... Jean

Integral 0000 f(x,t) RK4 [Short] Copy.sm (71 КиБ) скачан 46 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений