Mathcad Toolbox

Mathcad Toolbox - Contains analogs of functions from Mathcad - 消息

#181 已发布: 2024/10/26 20:25:46
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

Coming soon...

The ability to explicitly specify the placement of block elements will be added.

It looks strange, maybe I'll add some numbering: #1, #2, #3, ...

MathcadBlock-extended.jpg
Russia ☭ forever, Viacheslav N. Mezentsev
#182 已发布: 2024/10/27 09:34:21
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

... It looks strange, maybe I'll add some numbering: #1, #2, #3, ...



Hi. That's the Mathematica default notation for pure function's arguments: https://reference.wolfram.com/language/howto/WorkWithPureFunctions.html

Best regards.
Alvaro.

1位用户喜欢此帖子
#183 已发布: 2024/11/13 03:47:53
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

SMath Studio compatibility

Plugin updated.

Changes:

- fixed image handling functions (READRGB(),...);
- the appearance of brackets has been changed;
- added the ability to explicitly specify an insert for MathcadBlock (##, #1, #2, ...).

mathcadblock-explicit-paste.sm (15.97 KiB)已下载 1812 次。

mathcadblock-explicit-paste.png

mathcadblock-explicit-ode.png
Russia ☭ forever, Viacheslav N. Mezentsev
1位用户喜欢此帖子
sergio 2024/11/13 16:08:00
#184 已发布: 2024/11/13 16:42:40
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

Expanding the idea of ​​numbering, we can add syntax:

## - take all as sys|mat|line
#i#j - take from i to j
##j - take from 1 to j
#i# - take from i to end

and

#i#js - sys(#i,..,#j)
#i#jm - mat(#i,..,#j)
#i#jl - line(#i,..,#j)

#i#jfun - fun(#i,..,#j)

or

### - insert as parameters: foo(x,y,###) -> foo(x,y,#1,#2,...)
##3# - insert as parameters: foo(x,y,##3#) -> foo(x,y,#1,#2,#3)
Russia ☭ forever, Viacheslav N. Mezentsev
#185 已发布: 2024/11/13 23:20:14
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

I encountered a plot problem with the list version of rkfixed(). Probably this also applies to other ODE-integrators with embedded function assignment.

In the native 2D Plot:
- When plotting a solution function along with a matrix of marker points, then the points won't display
- Yet, when using lspline() directly, both objects plot without problems.

In X-Y Plot:
- When the independent variable has the same name as the solution function (e.g. x(x), then x() is not treated as a function but as the expression x (similar with v(v) or any other name).
- A workaround is to use a variable name different from the function name. Yet this is strange, because in SMath x() and x usually are independent objects.

plotproblem.sm (30.62 KiB)已下载 1782 次。
2024-11-13 17_08_58-SMath Solver - [plotproblem.sm_].png
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
#186 已发布: 2024/11/14 01:45:31
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

A little step further? (And I say little because I'm not the one who has to improve the code) Take #arg as function parameter?

further.png

Best regards.
Alvaro.
1位用户喜欢此帖子
#187 已发布: 2024/11/15 03:34:05
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

SMath Studio compatibility

Plugin updated.

Changes:

- MathcadBlock: the syntax for explicit insertion has been extended.

mathcadblock-explicit-paste.jpg
Russia ☭ forever, Viacheslav N. Mezentsev
1位用户喜欢此帖子
Alvaro 2024/11/16 08:51:00
#188 已发布: 2024/11/15 05:14:39
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator



mathcadblock-alnleqsolve.sm (12.12 KiB)已下载 1867 次。

mathcadblock-alnleqsolve.png
Russia ☭ forever, Viacheslav N. Mezentsev
1位用户喜欢此帖子
Alvaro 2024/11/16 08:51:00
#189 已发布: 2024/11/15 16:11:09
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

Visualization of transformations and matrix norms using implicit plots and automatic scaling of the X-Y plots.

Matrixnormen 2D.png
Matrixnormen 2D.sm (28.12 KiB)已下载 1819 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
3位用户喜欢此帖子
ioan92 2024/11/15 21:21:00, Вячеслав Мезенцев 2024/11/15 16:24:00, Oscar Campo 2024/11/15 17:41:00
#190 已发布: 2024/12/12 04:09:39
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

I want to add a set of simple examples to the Mathcad block context menu that demonstrate how it works. Can you suggest such examples?
Similar to the X-Y Plot component. In this case, you will be able to fill in not only the input values, but also the description. You can insert arbitrary expressions inside the component.
Imagine that you can formalize the solution to a simple problem. What would you suggest as educational examples?
Russia ☭ forever, Viacheslav N. Mezentsev
1位用户喜欢此帖子
Martin Kraska 2024/12/13 20:06:00
#191 已发布: 2024/12/13 17:18:46
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

Imagine that you can formalize the solution to a simple problem. What would you suggest as educational examples?



I suggest a handbook like Martin's one, with examples where the user can reuse the code (Code reusability is the technical expression for when you don't want to say that you are going to copy and paste). Or like Mathcad quicksheets. This is my idea of a clean use of the block for solving high school problems.

BasicHandbook-nsol.pdf (352.52 KiB)已下载 1148 次。

BasicHandbook-nsol.sm (327.84 KiB)已下载 1941 次。

Best regards.
Alvaro.

5位用户喜欢此帖子
francesco rapuano 2024/12/13 18:43:00, Вячеслав Мезенцев 2024/12/13 23:41:00, NDTM Amarasekera 2024/12/13 19:02:00, Martin Kraska 2024/12/13 20:06:00, sergio 2024/12/13 21:15:00
#192 已发布: 2024/12/13 20:06:09
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

I'd like to have such things like nsol in SMath core.

How about embedded assignment, similar to FindRoot? I don't like poking the values out of S. I see that this might reduce flexibility, e.g. in the case of parametrized initial guess.

I tried to demonstrate a generic approach, i.e. you get the variables assigned without having to issue any specific command except for the generic content of the placeholder. It is just a try and fails with single variables but you get the idea.

Of course, one would like to have a solve block without the cryptic generic expression in the placeholder.

Perhaps, such a block could be created from the insert menu with pre-allocated content of the placeholder and with setting it to hidden.

2024-12-13 13_47_32-SMath Solver - [BasicHandbook-nsol.sm_].png
BasicHandbook-nsol_Kr.sm (333.12 KiB)已下载 1882 次。
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
Alvaro 2024/12/13 22:00:00
#193 已发布: 2024/12/13 22:21:36
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Hi Martin. I put "0" as argument because there are no more args. The second could be a vector of options, like this:

options.png

or the solved variables. Also, I use "S" because this error, which I imagine that could be corrected, but don't know how hard it could be:

err.png

Best regards.
Alvaro.

PD: Notice that x# : transpose(str2num(x#))*diag(U#) or x# : diag(U#)*str2num(x#) if you want to return the answer as column vector, like normal people, returns x# as scalar if length(x#) = 1.
#194 已发布: 2024/12/14 07:36:10
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

... How about embedded assignment, similar to FindRoot? I don't like poking the values out of S. I see that this might reduce flexibility, e.g. in the case of parametrized initial guess



Hi Martin. I think the opposite: the implicit assignment of the names of the variables sought to a solution makes its call very rigid, since many times there is no direct relationship between the variables of the equation and the names of the variables that are intended to be assigned to the solution, as is precisely demonstrated in this case

rel.png

Another variant among many would be to find a limiting speed and call the result v.lim, even though the variable of the equation is "v".

Best regards.
Alvaro.
#195 已发布: 2024/12/31 00:07:50
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

SMath Studio compatibility History page
Mathcad Block.sm Mathcad Block. Examples.sm

Plugin updated

Changes:

- Mathcad Block: restored drawing of curly bracket (SS >= 1.3.*).

MathcadBlock-curly-bracket.jpg
Russia ☭ forever, Viacheslav N. Mezentsev
4位用户喜欢此帖子
churichuro 2024/12/31 02:12:00, Oscar Campo 2025/1/1 06:23:00, Alvaro 2025/1/1 13:20:00, sergio 2024/12/31 01:47:00
#196 已发布: 2025/8/20 23:31:03
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

SMath Studio compatibility History page Changes AI Assistant

Plugin updated.

Changes:

- CreateMesh() and CreateSpace() added;
- cspline() added;
- lspline() and pspline() fixed.
Russia ☭ forever, Viacheslav N. Mezentsev
#197 已发布: 2025/8/21 13:22:30
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

SMath Studio compatibility History page Changes AI Assistant

Plugin updated.

Changes:

- find() function added.

MathcadToolbox-find-handbook.sm (303.37 KiB)已下载 1382 次。
MathcadToolbox-find-handbook.pdf (183.29 KiB)已下载 649 次。

There are some problems with obtaining the values ​​themselves. Their nature is still unclear. This is the first trial implementation.

image.png
已编辑 2025/8/21 13:23:20
Russia ☭ forever, Viacheslav N. Mezentsev
#198 已发布: 2025/8/21 14:13:10
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

This effect is called a "classic case of circular dependency"

Never use the same variables for initial approximations and to store results - AI advised me.

image.png
Russia ☭ forever, Viacheslav N. Mezentsev
1位用户喜欢此帖子
Martin Kraska 2025/8/21 20:59:57
#199 已发布: 2025/8/21 17:11:48
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

The problem is in the delayed evaluation. It is nice if you want to evaluate the solution for multiple configurations with S just storing the task instead of the solution.
It may well be fine to have this behaviour by design, but then we should not get an error message (undefined Ix).

So my proposal is
- if the solution can be found numerically with the data given at processing of the block, then store the data and not the task description.
- if the task has undefined variables other than the solution variables, then just store the task description (as it is done now but don't complain.

If you enforce intermediate evaluation, then there are no restrictions on the variable names any more. The recursivity is broken.

BTW, I'd propose to allow for scalar arguments for the single equation/single variable case.

In case you provide solvers with range specification, my ideas would be to use Davides ternary operators a
If no initial guesses or ranges are given, try to apply a linear solver.



image.png

MathcadToolbox-find-handbook_Kr.sm (331.8 KiB)已下载 1338 次。

image.png

1-2-Maßeinheiten.sm (153.83 KiB)已下载 1369 次。
已编辑 2025/8/21 17:12:37
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#200 已发布: 2025/8/21 18:43:51
Вячеслав Мезенцев

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

1,558个赞,共1,868个帖子。

组: Moderator

SMath Studio compatibility History page Changes AI Assistant

Plugin updated.

Changes:

Refactors the `find` function to be more powerful and intuitive, aligning its behavior with user expectations from similar math software.

- The set of variables to be solved is now implicitly determined from all initial guesses (`≈`) provided in the input system. This removes the need to explicitly declare all variables.
- The function signature is now more flexible. Users can either omit the variable list to get all results, or specify which variables they want returned.
- Output variables can be specified either as a flat list (`find(sys, x, y)`) or as a `sys`/`mat` block (`find(sys, sys(x,y))`).
- Introduces `_` as a wildcard argument (`find(sys, _)` or `MathcadBlock -> find(_)`). This provides an elegant way to explicitly request all solved variables, which is particularly useful for integration with `MathcadBlock`.
- The output is now filtered to return only the subset of variables requested by the user, in the specified order.

Available nonlinear solvers: FixedPoint, LevenbergMarquardt, NewtonRaphson, Broyden.
Default solver: "LevenbergMarquardt"

Understanding the Calculation Behavior. A Circular Dependency (Gemini).pdf (87.1 KiB)已下载 806 次。

image.png
已编辑 2025/8/21 19:02:15
Russia ☭ forever, Viacheslav N. Mezentsev
2位用户喜欢此帖子
Alvaro 2025/8/21 19:57:42, Martin Kraska 2025/8/21 20:59:43
  • 有新帖
  • 无新帖