Substitution Optimization - Optimization for the display of Eng./Sci. calculations - Messages
It seems like this request never really moves forward, and I'm not sure why, since it is always being asked for. I've seen similar requests from as far back as 11 years.
We really need an additional type of optimization.
The current optimization options do not provide for a means to achieve this outcome.
The only current way to make it work is to manually write the formula with the values and units in it, but this totally defeats the point of having a powerful program like SMath!
I can do manual calcs on paper without any programs...
All that is needed is for the display of the initial substitution, with the user defined units, before the final result is shown.
We don't need the formula evaluated with the user defined units, we only need the substitution displayed in the format of the expressed formula, that's it!
Like this:
It's totally fine if the default result is in default units, the user can manually define other units as needed.
I think it makes sense to have this as an additional type of optimization, perhaps called "Substitution"?
It would be the same as numeric, since you still need the formula evaluated, but it would only display the initial substitution before the final result.
I for one would be willing to help pay for the development of this, and I think that there are many other users who would too.
Not having this feature is honestly the biggest draw back to using SMath for engineering calculations.
So please, can I get some support on this? Any other users willing to pitch in for the development of this feature?
In short words:
1) You do not need to pay for this feature.
2) I will try to prioritize your request to release it next Month (can't guarantee, but will try).
Best regards.
I wonder whether the optimization (I'd call it evaluation) can be set separately for storage at definition time (as given, simplified) and for display (none, substitution, numerical, symbolical, substitution+numeric).
Storage/assignment:
- As given: stores the expression verbatim without even touching the units (operator # := #)
- simplified: stores the expression with context substituted and simplified symbolically (operator # <- #)
Evaluation:
- none: as stored without substitution or simplification (operator # ≡ #)
- substitution: with substitution of context but without further simplification (operator # = #)
- numerical: with substitution and numeric evaluation (eventually with symbolic evaluation (operator # = #)
- symbolical: with substitution and symbolic simplification (operator # => #, consistent with operator palette)
- substitution + numerical: ternary display operator with first the expression, then substitution, then numeric result (operator # = # = #, optional with two-lines of display and aligned = signs)
What is missing in the above list is an assignment operation with numerical evaluation (mainly for programming to avoid exploding symbolic expressions in loops). One could invent another operator or use the eval() function for just this.
The original request would be handled by defining the inputs with storage "as given" and displaying results with "substitution + numerical"
There is an interesting point on how to handle intermediate results. You may want them to be stored using the custom unit you specified for display. Otherwise, substitution display would use some arbitrary base unit which you can't control and which might be plain wrong (e.g. Hz for angular velocity or J for a torque).
F:=3*'kN
h:=2*'m
M:=F*h (stores F*h)
M.1:=F*h=3*'kN*2*'m=6*'kN*'m (stores 6*'kN*'m)
This raises the problem of how to control the decimal precision of intermediate results. Die-hard pencil-and-paper way would be to store the intermediate results with the precision used for display, but hat is probably something no one wants, because round-off errors would accumulate.
On the other hand full precision decimal fractions would look very ugly in substitution display. But for consistency, this is perhaps the best option.
Wrote
There is an interesting point on how to handle intermediate results.
I think we are talking about two totally different things. From a pure engineering calculation point of view there is no need for intermediate results to be calculated or shown.
Now I understand, that from an academic point of view, the intermediate results is a desirable feature, but this is really not needed for engineering.
Perhaps my proposal is a much easier objective than a complete intermediate calculation functionality/display. So lets not put them in the same bucket?
All I am asking for, and I think all the engineers who use SMath would agree, is for the initial substitution to be displayed, not calculated, just displayed before the final result is shown, as I showed in my original post.
WroteWrote
There is an interesting point on how to handle intermediate results.
I think we are talking about two totally different things. From a pure engineering calculation point of view there is no need for intermediate results to be calculated or shown.
Now I understand, that from an academic point of view, the intermediate results is a desirable feature, but this is really not needed for engineering.
Perhaps my proposal is a much easier objective than a complete intermediate calculation functionality/display. So lets not put them in the same bucket?
All I am asking for, and I think all the engineers who use SMath would agree, is for the initial substitution to be displayed, not calculated, just displayed before the final result is shown, as I showed in my original post.
So you vote for some mechanism to prevent people from applying substitution display to variables not directly defined by user input?
Wrote
So you vote for some mechanism to prevent people from applying substitution display to variables not directly defined by user input?
Really not sure what you mean. Variables not directly defined by user input? Do you mean like constants? Gravitational acceleration?
I see three scenarios:
1. Any "variable" that is not "user defined/displayed" (g.e in this example) is not shown in the substitution, since there is nothing to substitute that is being displayed.
g.e is not "displayed" before the equation, but "a" is.
2. If g.e is "displayed", in this case with default units, then it is shown in the substitution as such.
3. We can also "redefine" the units of g.e and this "new" definition is what is shown in the substitution.
Note that the units for the result of "b" can be changed to a user defined unit. If "b" was "defined/displayed" as lbf, then the next time it is called into an equation, the substitution will show what was displayed for the result/definition.
We are simply showing what is being "defined/displayed", however you want to describe it. The system will always default to the default units, this is fine. Users can decide what units they want to see, and this "definition/display" is what should be in the substitution display. It is still a regular Numerical optimization, but with a view of the variables substituted into their place.
Does this make sense?
Maybe we should call this new optimization Numerical+ or Numerical+S?
Little resulted from long exposition, including Units as well.
You get 12.95 N/m ... I get 12.95 mPa
W = b*h^2/6 being the section modulus, M=F*l being the bending moment.
You can put all this into a single equation or display M and W separately.
If you then write sigma=M/W and ask for display with substitutions, then we both want the same: display the value as it was formatted in earlier displays (as in your example with g.e, where you just set the favourite units.)
Still I think that it would be clean to separate storage (definition) and display (evaluation) options. But that is just for easier explanation/teaching.
This is also a feature I desire. However, the implementation as proposed will not behave as expected because of (2) things: inability to assign default units (i.e., units of preference) and the inability to control which variables are shown, and how they should be shown
While this may seem trivial, the complications arise when you are working with complex equations and these shortcomings will compound on each other; ultimately this would just recreate Mathcad's 「explicit」 keyword (symbolic evaluation) where it works great for simple implementations, but will easily produce a nasty representation/unworkable solution once you get into anything meaningful:
Here is what I propose: allow a user to apply 「evaluation」 to a variable, so that a:=b+c can be written as a:=(b=12mm)+c where b is defined as 12mm before this equation, the result is just shown inline. Just like any other evaluation, units can be modified inline: a:=(b=12mm▮)+c --> a:=(b=0.47in)+c; the inline 'display result' of variable b would also grant the user to declare symbolic/numeric/none as optimization, as well as decimal points/fraction/rounding conditions currently enjoyed by an equation.
One way to think about it is that a mathregion can be nested within a mathregion:
If such an implementation can be pulled off, this nesting effect can be applied 「n」 levels deep. I think such an operation would require the variable being displayed to be contained within parentheses; if a new operator/grouping is required to make this happen, curly brackets { } could be used to contain/display/interact with such a feature (those keypresses seem to be empty, and the difference between { and ( is slight, but noticeable)
May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
WroteOh, now I understand the misunderstanding. With intermediate result I mean the handling of cascades of equations. E.g. you might want to compute stress by
W = b*h^2/6 being the section modulus, M=F*l being the bending moment.
You can put all this into a single equation or display M and W separately.
If you then write sigma=M/W and ask for display with substitutions, then we both want the same: display the value as it was formatted in earlier displays (as in your example with g.e, where you just set the favourite units.)
Still I think that it would be clean to separate storage (definition) and display (evaluation) options. But that is just for easier explanation/teaching.
Exactly, now we are on the same page. I also agree that we need to separate the definition and display of substitutions, as you have called it. I think the storage definition is going to be much harder than just the display.
Here is a visual of your example:
As for the display for the variables, you can see it right in the html code. Both the user defined units, and the number of decimal places are there.
Remember, we are talking only about the display of the variables substituted into the defined equation exactly as they are displayed before the equation. In the background, the evaluation is still numeric as before.
WroteGreetings,
This is also a feature I desire. However, the implementation as proposed will not behave as expected because of (2) things: inability to assign default units (i.e., units of preference) and the inability to control which variables are shown, and how they should be shown [indent][SPOILER]no easy way to produce the following effect, and no easy way to force it to report the appropriate dec. points either...
You can assign whatever units you want to each calculation individually. Default units are just for calculations in the background. You can even change in which units the result is displayed.
As I showed before, both the decimal places and the units that are displayed are part of the html code. So these "definitions" as we might call them, should be able to be recalled as such, and substituted and displayed in the format of the equation they are placed into.
Again folks, what I am proposing, is simply a display of what is already displayed. Everyone keeps thinking within the bounds of how SMath currently works.
Here is an example of a nonsense equation that is a bit more complex in its formatting.
As you can see, c has only 1 decimal place, while a and b have 3. The default decimal place setting is 2.
So when the calculation of d is performed, the result is shown with only 2 decimal places, because of the default setting. I can change that if I want.
The variables are displayed in the format of the equation exactly as they are previously displayed.
Lets say that I decide to show the result of d with 4 decimal places instead of 2, and then I use it in a new equation, d will be shown with 4 as it is shown just before the equation.
As far as I understand, unless you activate significant figures, SMath is running full precision in background regardless of how you display the results.
I absolutely agree with what you displayed, thanks for illustrating my statements.
Are the reviewers fine with the possible difference between full precision background result and a result obtained from using truncated substitutions?
Wrote
Are the reviewers fine with the possible difference between full precision background result and a result obtained from using truncated substitutions?
Isn't this no different than how things are now? If you define a variable out to 15 decimal places, the calculations will carry that precision through. If you define it only to 4 decimal places, then 4 is all you can get. In the end you can chose to display values differently than how SMath is using them in the calculations. Even when you get a result from an equation. That result has a level of precision that is determined by the level of precision of the variables/numbers used in the equation. You can still chose to display 2 or whatever decimals you can.
In this example, pi is defined out to 15 decimal places, I am choosing to display only 5 decimal places, but the calculation is being done with the full 15. On the side is the direct substitution calculation with the numbers as displayed. As you can see, it produces different results.
Now in this example, I have defined pi only to 4 decimal places. With trailing zeros on, you can see that the calculation is limited by the 4 decimal places I have defined.
When we mix "accuracy" we see that we get a total combined level of precision. 6+4=10.
So I'm not sure it would be any different for what I'm asking for. The calculation would still be done as before, just like any other numerically optimized calculation. Even the final result would be the same as before. You would chose how to display it, but the calculations are being done to full possible precision.
I have no idea how this would be done if you want to show step by step simplifications of equations (which is not what I'm looking for). That seems like a much bigger/harder problem to solve.
Storage/assignment:
- Always store the definition in simplified form and in formatted form.
- The formatted form by default is the verbatim form of the definition.
- The formatted form is updated whenever a variable is displayed (either with default formatting or specific settings including units)
- Thus no need for separate control on storage as given or simplified.
Evaluation:
- none: show the formatted form (operator # ≡ #)
- substitution: substitute formatted form in the expression (operator # = #)
- numerical: use simplified form and apply numeric evaluation (operator # = #)
- symbolical: use simplified form and apply symbolic simplification (operator # => #, consistent with operator palette)
- substitution + numerical: ternary display operator with first the expression, then substitution, then numeric result (operator # = # = #, optional with two-lines of display and aligned = signs)
Access to the formatted form is perhaps the key infrastructure requirement.
This should be backwards compatible, i.e. would not modify existing sheets.
WroteWhen we mix "accuracy" we see that we get a total combined level of precision. 6 + 4=10
Nope. If pi = pi limited by 'b', last decimal not true.
-
New Posts
-
No New Posts