SMath Studio Forum
»
SMath Studio
»
Samples
»
Showing substitutions in a formula
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,475 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: wb.c 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 11/01/2018(UTC) Posts: 150 Location: Wisconsin Was thanked: 71 time(s) in 45 post(s)
|
Greetings! For what it is worth, here is my attempt at the problem at hand: These equations only require the use of Davide's "Custom Functions"; you can download the sheet here: 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. ᵂᴵ |
|
1 user thanked Kenny Lemens for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/04/2018(UTC) Posts: 155 Was thanked: 26 time(s) in 22 post(s)
|
Originally Posted by: Razonar
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? 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?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/04/2018(UTC) Posts: 155 Was thanked: 26 time(s) in 22 post(s)
|
Originally Posted by: Kenny Lemens 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,475 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: wb.c 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. Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,475 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: Kenny Lemens Greetings! For what it is worth, here is my attempt at the problem at hand ... Hi Great approach. Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/04/2018(UTC) Posts: 155 Was thanked: 26 time(s) in 22 post(s)
|
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,
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,475 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: wb.c 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. EvalSF.sm (186kb) downloaded 23 time(s).Best regards. Alvaro. Edited by user 06 June 2024 17:08:48(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/04/2018(UTC) Posts: 155 Was thanked: 26 time(s) in 22 post(s)
|
Hey Alvaro, any way to do this like you did with V3 only showing the initial substitution without showing extra steps?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,475 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: wb.c 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: Editing: Result: Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/04/2018(UTC) Posts: 155 Was thanked: 26 time(s) in 22 post(s)
|
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,
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,475 Was thanked: 925 time(s) in 588 post(s)
|
Originally Posted by: wb.c 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 (189kb) downloaded 11 time(s).Best regards. Alvaro.
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Samples
»
Showing substitutions in a formula
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.