This is a feature I really hope can be automated as part of SMath. (One day...)
The goal is to show the values of the variables in an equation as they are shown in their last definition.
Only a display as a means to simplify the checking and review of "hand calculations". (We all know how annoying it is to dig back and find the values for all the variables used in an equation...)
What I have done is create a simple snippet (SubstitutionTemplate) that can be saved in the snippet manager folder (user/AppData/Local/Programs/SMath Studio/snippets) or wherever you have your snippet folder...
When working on a calculation, you define variables as you normally do.
![2024-05-23 23_41_47-SMath Solver - [Substitution Example.sm_].png](/forum/resource.ashx?a=49362&b=2)
Then you go to the snippet manager and select the snippet you added (Substitution Template) and insert it (uncheck inset inside area).

![2024-05-24 00_01_36-SMath Solver - [Worksheet1].png](/forum/resource.ashx?a=49371&b=2)
![2024-05-23 23_44_18-SMath Solver - [Substitution Example.sm_].png](/forum/resource.ashx?a=49363&b=2)
This snippet is just a few formula regions inside a text region, so everything looks nice.
Highlight v# and replace it with the variable you wish to define.
Highlight eq# and write the formula that defines the variable.
Highlight eqs# and write the formula again, but this time manually input the values of the variables with units, so it looks nice and neat.
Lastly, highlight vr# and type the variable you are defining, and press "=", then right click over the variable and deselect "Display Input Data"
![2024-05-23 23_49_38-SMath Solver - [Substitution Example.sm_].png](/forum/resource.ashx?a=49366&b=2)
The final result looks like this:
![2024-05-23 23_51_17-SMath Solver - [Substitution Example.sm_].png](/forum/resource.ashx?a=49367&b=2)
The variable is assigned the value the same way as a standard calculation (because it is just a regular calculation inside a text region), you can change the display unit if you want.
![2024-05-23 23_53_20-SMath Solver - [Substitution Example.sm_].png](/forum/resource.ashx?a=49368&b=2)
The only thing snippet does is optimize the manual work.
Yes, it is annoying to manually type in the values and units you want to display as substitutions, but this is not more work than any other solution.
It would be amazing if someone could come up with a way to automate this substitution on the basis of the equation and the defined variables used in that equation.
As far as I can see, this sort of thing requires coding changes within SMath and will not be possible with the tools available now.
So, in the meantime, this is the best we have.
Substitution Example.sm (8kb) downloaded 32 time(s).
SubstitutionTemplate.sm (4kb) downloaded 32 time(s).