Showing substitutions in a formula

Showing substitutions in a formula - Сообщения

#21 Опубликовано: 30.05.2024 01:54:34
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

I’m confused because on your original Evals() function everything was input into the Evals() function. ...



With some cheats: all variables must to be undefined and units are input as undefined global variables ~N instead true SMath units 'N. For that units appear in bold black but not in bold blue. Also, decimal numbers are converted into symbolic global variables.

Mathcad block gives the chance to use only standard SMath expressions.

Best regards.
Alvaro.

#22 Опубликовано: 31.05.2024 21:28:17
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

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

Группа: User

Greetings!

For what it is worth, here is my attempt at the problem at hand:
SMath_2024-05-31.jpg


These equations only require the use of Davide's "Custom Functions"; you can download the sheet here:
EquationsWithSymbolicSubstitution.sm (84 КиБ) скачан 56 раз(а).


In order for this to work:
  • Customized units: the symbolic results are not true units; else there were issues with simplifying to base units
  • Abuse of unique 'units' properties: Units will cheat numbers tighter together, and will not use the multiplication symbol: giving a cleaner look. However, they will display as blue...
  • Reliance on Strings: Without passing certain units/variables through as a string, I would have no control to reference the numbers/units/variables at hand. SMath likes to simplify to base units, and substitute variables for contents. This creates a hassle for input, but once configured: should be hassle free.
  • Assumption that nobody really uses Absolute Variables (the ~ Bold Black Variables): I use these variables as alias: being assumed undefined, I can work with them as math, and then just substitute the actual variable at the proper time (use of 「~a」 to be replaced with 「a」 as/if desired. This could have been accomplished through a 'string', but the benefit of working with math objects was too great to ignore.
  • Grouping Hack: At the end of the day, Symbolic will attempt to group terms together and report numbers as fractions. Thus, I utilize the "function" feature, thus having math in an undefined function that cannot evaluate: thus remains ungrouped in what appears to be parenthesis. I use a "UNIT of NONBRACKING-SPACE CHARACTER as the UNDEFINED function name (ie., '\FEFF\() )
  • Heavy use of special Unicode characters: Terms like "=" and ":" have special meaning that cannot be avoided. My only recourse was to use characters that look like "=" in order to produce aesthetically appealing results (e.g.,"꞊꞊"; "꞉"; "⚌" ). It is through the trick of a period like character that the numbers can appear to be a decimal within the Symbolic Evaluation environment.


I will admit, this will not be perfect as error handling is lacking, you will notice some multiplication symbols bleed through (as the 'result' is just a GIANT multiplication statement of variables, Functions, units, and numbers). The absolute variables must be undefined to work as expected, and some terms like lele() will unravel to its core SMath definition (e.g., lele(~1,~2,~3) =-> (~2≤~1)&(~1≤~3) ). I will also note that it does not like multiple units (like 'ft*'in); it really can only handle (1) unit: thus you may need to create a custom unit to serve the desired effect.


May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
1 пользователям понравился этот пост
Alvaro Diaz Falconi 01.06.2024 00:06:00
#23 Опубликовано: 31.05.2024 22:43:02
Wesly Centerwall

Wesly Centerwall

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

Группа: User

Wrote



With some cheats: all variables must to be undefined and units are input as undefined global variables ~N instead true SMath units 'N. For that units appear in bold black but not in bold blue. Also, decimal numbers are converted into symbolic global variables.

Mathcad block gives the chance to use only standard SMath expressions.

Best regards.
Alvaro.



So, there is no feasible way to produce something like this?

2024-05-31 11_34_35-SMath Solver - [Evals v3.sm_].png

If that is the case, at the very least we should be able to do this:
Maybe we just have the formula and "unit" part in a separate MathCAD block so that it can be hidden?

2024-05-31 11_42_51-SMath Solver - [Evals v3.sm_].png
#24 Опубликовано: 31.05.2024 22:45:19
Wesly Centerwall

Wesly Centerwall

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

Группа: User

Wrote

Greetings!

For what it is worth, here is my attempt at the problem at hand:

May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ



Well, this is definitely a unique approach, thanks for the input.
#25 Опубликовано: 01.06.2024 00:06:00
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

One more thing that I noticed when testing. Seems like the MathCAD blocks don't like subscripts on variables. ...



Hi. Mathcad block must to cover all the equations regions. The subscript enlarge the region. Just enlarge the Mathcad block a little bit.

pa.png

Best regards.
Alvaro.
#26 Опубликовано: 01.06.2024 00:08:34
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Greetings! For what it is worth, here is my attempt at the problem at hand ...



Hi Great approach.

Best regards.
Alvaro.
#27 Опубликовано: 06.06.2024 00:25:39
Wesly Centerwall

Wesly Centerwall

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

Группа: User

Alvaro,

What did you think about the idea of variables in one region and the formula and output unit in another?
Seems like an easy way to hide the second region and have a cleaner end result. Do you think that’s feasible?

Thanks,
#28 Опубликовано: 06.06.2024 11:04:33
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Alvaro,

What did you think about the idea of variables in one region and the formula and output unit in another?
Seems like an easy way to hide the second region and have a cleaner end result. Do you think that’s feasible?
Thanks,



Hi. Yes, it's a very good idea. This is a way about how to implement that.

eval.png

eval2.png

EvalSF.sm (185 КиБ) скачан 51 раз(а).

Best regards.
Alvaro.
#29 Опубликовано: 27.06.2024 10:08:18
Wesly Centerwall

Wesly Centerwall

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

Группа: User

Hey Alvaro, any way to do this like you did with V3 only showing the initial substitution without showing extra steps?
#30 Опубликовано: 30.06.2024 05:32:41
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Hey Alvaro, any way to do this like you did with V3 only showing the initial substitution without showing extra steps?



Hi. Yes. You can delete the undesirable elements at the end of the function:

ans1.png

Editing:

ans2.png

Result:

ans3.png

Best regards.
Alvaro.
#31 Опубликовано: 02.09.2024 22:43:01
Wesly Centerwall

Wesly Centerwall

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

Группа: User

Hey Alvaro,

Is there any way to replace the "≈" symbols in the results to be other symbols?
I think a regular equals sign or U2550 "═" could be used for the first one since it is just showing the formula. Then perhaps arrows (→) to the substitution part and the result part.
Was trying to replace these within the function, but it messes it all up. Seems like it can't be done as in some earlier versions of the function.
Thanks,
#32 Опубликовано: 03.09.2024 07:56:44
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

Hey Alvaro,

Is there any way to replace the "≈" symbols in the results to be other symbols?
I think a regular equals sign or U2550 "═" could be used for the first one since it is just showing the formula. Then perhaps arrows (→) to the substitution part and the result part.
Was trying to replace these within the function, but it messes it all up. Seems like it can't be done as in some earlier versions of the function.
Thanks,



Hi. Yes, but it's not trivial replacing ≈ by SMath equals ≡ because it returns zero after evaluation. This is a workaround.

EvalSF with arrow.sm (188 КиБ) скачан 42 раз(а).

fig.png

fig.png

Best regards.
Alvaro.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений