Mathcad Toolbox

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

#101 Опубликовано: 30.11.2021 02:35:46
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

Linear interpolation and linear spline interpolation are different things. I will try to find the formulas that are used in these functions.


We can restore the interpolation functions: lspline(), pspline() and cspline(). This is how the cspline() function works. Based on the attached document and file from the PTC Mathcad forum.

Click to enlarge Click to enlarge

Cubic spline interpolation using Mathcad (2009).pdf (256 КиБ) скачан 75 раз(а).
cspline1.mcdx.zip (12 КиБ) скачан 33 раз(а).

cspline.sm (38 КиБ) скачан 47 раз(а).
cspline.pdf (88 КиБ) скачан 38 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
#102 Опубликовано: 30.11.2021 09:58:24
Jean Giraud

Jean Giraud

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

Группа: User

With enough points, simply cinterp Smath.

ODE HIRES.sm (67 КиБ) скачан 37 раз(а).
#103 Опубликовано: 04.12.2021 00:46:37
Вячеслав Мезенцев

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

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

Группа: Moderator

rkfixed(3|4) added, but I still don’t know which derivative symbol is better to take. (ʹ) - modifier letter prime (U+02B9) used below. I don't know how to enter it from the keyboard.

Click to enlarge Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 04.12.2021 02:44:00
#104 Опубликовано: 04.12.2021 05:19:00
Вячеслав Мезенцев

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

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

Группа: Moderator

Full set: interp(), [l,p,c]spline().

Click to enlarge

Odesolve interpolation test.sm (59 КиБ) скачан 46 раз(а).
Odesolve interpolation test.pdf (102 КиБ) скачан 40 раз(а).

(*) rkfixed() with a bug now, so you will see something differ.
Russia ☭ forever, Viacheslav N. Mezentsev
#105 Опубликовано: 05.12.2021 06:55:49
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

(ʹ) - modifier letter prime (U 02B9) used below. I don't know how to enter it from the keyboard.


This can be done in 2 steps:

1. Copy \02B9\ to text region. This code will turn into a text simbol (ʹ).
2. Select and copy it as variable name.

PS. It looks like it's time to combine all Mathcad functions into one plugin - Mathcad Toolbox. It will contain all such functions: ODE solvers, spline functions, in/out functions and so on.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 05.12.2021 13:06:00
#106 Опубликовано: 05.12.2021 13:18:42
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Hi. Your develop looks brillant.

Wrote

...
1. Copy \02B9\ to text region. This code will turn into a text simbol (ʹ).
2. Select and copy it as variable name. ...



Also, you can get any unicode char with this

img0.png

Wrote

... PS. It looks like it's time to combine all Mathcad functions into one plugin - Mathcad Toolbox. It will contain all such functions: ODE solvers, spline functions, in/out functions and so on.



And don't forget the possibility that the area simply returns the equations of the differential equation or a non-linear system of equations so that the user can then try to solve the ode or nle systems with the functions he chooses.

Best regards.
Alvaro.
1 пользователям понравился этот пост
#107 Опубликовано: 05.12.2021 18:30:56
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

rkfixed(3|4) added, but I still don’t know which derivative symbol is better to take. (ʹ) - modifier letter prime (U+02B9) used below. I don't know how to enter it from the keyboard.



This looks very interesting. Seems that it is not yet in the online gallery?

In principle, the built-in diff(1) operator would be an option but it looks ugly if applied twice.
The ordinary prime would be ok for me (just as it is used as tag in unit names), it is input as Shift # on german keyboards.

diff2.png
diff2.sm (2 КиБ) скачан 27 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#108 Опубликовано: 05.12.2021 22:15:07
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I still don’t know which derivative symbol is better to take. (ʹ) - modifier letter prime (U 02B9) used below. I don't know how to enter it from the keyboard.


My preference goes for book style.
US keyboard D apostrophe (x):=

Derivatives.PNG

#109 Опубликовано: 06.12.2021 00:07:58
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

This looks very interesting. Seems that it is not yet in the online gallery?


I can't contact Andrey directly. The server does not allow compiling the sources, as there is no free space. Therefore, the latest changes are not yet available.

I've made some changes. I liked the idea with the str2num() function. Also I can override the diff(1) function, but that can be confusing.

Now it is possible to numerically solve the Cauchy problem for one variable: diff(y(x),x,n)=F(x,y(x),...,diff(y(x),x,n-1)) . Later, I will expand the rest of the ODE solvers to support this simplified form. But for this I need to combine plugins and add interpolation functions similar to Mathcad (lspline(), interp(), ...). It will be more convenient for me to test the solvers, comparing the results with Mathcad.

Block region collects equations in the form of a system and substitutes it as the first parameter into the function.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
#110 Опубликовано: 06.12.2021 04:32:09
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

The ordinary prime would be ok for me (just as it is used as tag in unit names), it is input as Shift # on german keyboards.


I can add the ability to set this symbol directly in the document. This way you can change the default symbol.

2021-12-06_12-29-03.png

Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
sergio 06.12.2021 07:09:00
#111 Опубликовано: 06.12.2021 09:11:48
Вячеслав Мезенцев

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

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

Группа: Moderator

SMath Studio compatibility

Plugin updated. Please try.

Examples:

Mathcad Block.sm Mathcad Block. Examples.sm

Changes:

- rkfixed() now works correctly;
- Odesolve block renamed to Mathcad Block;
- the task for the ODE solver in the usual mathematical notation is supported;
- default diff symbol is apostrophe ( ' );
- linterp() is used as an interpolation function;
- refactored.

Click to enlarge Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
Alvaro Diaz Falconi 06.12.2021 11:41:00, sergio 06.12.2021 10:52:00
#112 Опубликовано: 06.12.2021 13:41:05
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote


- linterp() is used as an interpolation function;



Hi Viacheslav, thanks, great job. One question: Why to use linterp instead cspline? The problem with cspline is about the border of the interval, where you have only diff by the left and the right, and there you can adapt the cubic splines to be linear or parabolic, but in the interior of the interval I guess that it's better cubic splines interpolation.

img0.png

ODEQuestion.sm (15 КиБ) скачан 37 раз(а).

Best regards.
Alvaro.
#113 Опубликовано: 06.12.2021 15:44:46
Вячеслав Мезенцев

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

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

Группа: Moderator

I will add the interpolation functions ( interp(), lspline(),... ) to the plugin and rename it to Mathcad Toolbox. After that, it will be possible to test its work, comparing it with the Mathcad numerically.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 06.12.2021 17:55:00
#114 Опубликовано: 07.12.2021 05:56:03
Вячеслав Мезенцев

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

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

Группа: Moderator

SMath Studio compatibility

Plugin updated.

Changes:

- plugin renamed to Mathcad Toolbox;
- version changed to 0.3.*;
- interp(), lspline() functions added;
- lspline() function used in any ode solvers.

Файл не найден. Файл не найден.
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
overlord 07.12.2021 09:10:00, Martin Kraska 07.12.2021 07:12:00
#115 Опубликовано: 07.12.2021 08:32:19
Martin Kraska

Martin Kraska

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

Группа: Moderator

Really nice generic block concept! It is a really good reason for updating the handbook and the portable distribution.

This is how to use it with symbolic solutions using Solve() (Maxima plugin):

Solve block.png
Solve block.sm (5 КиБ) скачан 44 раз(а).

Looking forward to a RK integrator for multi-DOF systems. This is how I would imagine the user interface.

2021-12-07 11_42_03-SMath Solver - [Federpendel-block.sm_].png
Federpendel-block.sm (48 КиБ) скачан 43 раз(а).

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
#116 Опубликовано: 07.12.2021 09:32:51
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

Looking forward to a RK integrator for multi-DOF systems. This is how I would imagine the user interface.


This is the next step, but the existing solution is not stable and has some bugs.

Russia ☭ forever, Viacheslav N. Mezentsev
#117 Опубликовано: 07.12.2021 11:13:30
Вячеслав Мезенцев

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

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

Группа: Moderator

SMath Studio compatibility

Plugin updated.

Changes:

- plugin merged with Mathcad File Access (all functions are inside Mathcad Toolbox);
- the condition has changed in the definition of the solver function (to support both directions of integration): (x-xmin)*(xmax-x)>=0;
- pspline() function added.
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Arie 07.12.2021 11:35:00
#118 Опубликовано: 07.12.2021 14:00:34
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Wrote

Looking forward to a RK integrator for multi-DOF systems. This is how I would imagine the user interface.


This is the next step, but the existing solution is not stable and has some bugs.



Hi. In the meantime, we can play with things like this:

img0.png

img1.png

Solve block.sm (54 КиБ) скачан 55 раз(а).

Best regards.
Alvaro.
1 пользователям понравился этот пост
#119 Опубликовано: 08.12.2021 02:24:11
Вячеслав Мезенцев

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

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

Группа: Moderator

Wrote

Hi. In the meantime, we can play with things like this


Looks great, but something is missing.

Click to enlarge
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 08.12.2021 06:53:00
#120 Опубликовано: 10.12.2021 05:59:47
Вячеслав Мезенцев

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

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

Группа: Moderator

SMath Studio compatibility

Plugin updated.

Changes:

- fixed algorithm for selecting regions (Mathcad Block).
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
sergio 10.12.2021 08:25:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений