Mathcad Toolbox - Contains analogs of functions from Mathcad - Сообщения
WroteLinear 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.
Cubic spline interpolation using Mathcad (2009).pdf (256 КиБ) скачан 119 раз(а).
cspline1.mcdx.zip (12 КиБ) скачан 62 раз(а).
cspline.sm (38 КиБ) скачан 77 раз(а).
cspline.pdf (88 КиБ) скачан 68 раз(а).
Odesolve interpolation test.sm (59 КиБ) скачан 85 раз(а).
Odesolve interpolation test.pdf (102 КиБ) скачан 77 раз(а).
(*) rkfixed() with a bug now, so you will see something differ.
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.
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
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.
Wroterkfixed(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.sm (2 КиБ) скачан 60 раз(а).
WroteThis 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.

Plugin updated. Please try.
Examples:


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.
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.
ODEQuestion.sm (15 КиБ) скачан 73 раз(а).
Best regards.
Alvaro.
This is how to use it with symbolic solutions using Solve() (Maxima plugin):
Solve block.sm (5 КиБ) скачан 83 раз(а).
Looking forward to a RK integrator for multi-DOF systems. This is how I would imagine the user interface.
Federpendel-block.sm (48 КиБ) скачан 82 раз(а).
WroteLooking 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.

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.
WroteWroteLooking 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:
Solve block.sm (54 КиБ) скачан 91 раз(а).
Best regards.
Alvaro.
-
Новые сообщения
-
Нет новых сообщений