Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline wb.c  
#1 Posted : 06 July 2023 23:12:10(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
I know, this is a feature that has been requested over and over, and over, with many attempts by lots of users to produce a similar outcome. Most of these don't work very well, or are at best extremally tedious use in any practical sense and do not make it easier than just manually doing the substitution.

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.
2023-07-06 15_43_49-SMath Solver 1.0.8348 - [Concepts.sm_].png
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:
2023-07-06 15_43_36-SMath Solver 1.0.8348 - [Concepts.sm_].png
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"?
2023-07-06 15_41_30-SMath Solver 1.0.8348 - [Concepts.sm_].png
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?
thanks 1 user thanked wb.c for this useful post.
on 07/07/2023(UTC)

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Andrey Ivashov  
#2 Posted : 07 July 2023 01:08:57(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,617
Man
Russian Federation

Was thanked: 1981 time(s) in 667 post(s)
Hello. Responded to you by e-mail.

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.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 11/07/2023(UTC)
Offline mkraska  
#3 Posted : 07 July 2023 19:43:03(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,023
Germany

Was thanked: 1153 time(s) in 739 post(s)
I am looking forward to the next release. If the proposed substitution display is going to work, this perhaps implies a lot of changes under the hood.

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.

Edited by user 07 July 2023 19:45:20(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline wb.c  
#4 Posted : 12 July 2023 06:12:50(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Originally Posted by: mkraska Go to Quoted Post

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.
thanks 1 user thanked wb.c for this useful post.
on 12/07/2023(UTC)
Offline mkraska  
#5 Posted : 12 July 2023 09:01:32(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,023
Germany

Was thanked: 1153 time(s) in 739 post(s)
Originally Posted by: wb.c Go to Quoted Post
Originally Posted by: mkraska Go to Quoted Post

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?

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline wb.c  
#6 Posted : 12 July 2023 10:34:19(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Originally Posted by: mkraska Go to Quoted Post

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.
2023-07-12 03_13_45-SMath Solver 1.0.8348 - [Worksheet1_].png

2. If g.e is "displayed", in this case with default units, then it is shown in the substitution as such.
2023-07-12 03_13_54-SMath Solver 1.0.8348 - [Worksheet1_].png

3. We can also "redefine" the units of g.e and this "new" definition is what is shown in the substitution.
2023-07-12 03_14_04-SMath Solver 1.0.8348 - [Worksheet1_].png

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?
2023-07-12 03_28_32-SMath Solver 1.0.8348 - [Worksheet1_].png
Offline wb.c  
#7 Posted : 12 July 2023 10:50:56(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Just to clarify what I mean when I say I don't want/need "intermediate results".

2023-07-12 03_44_21-SMath Solver 1.0.8348 - [Worksheet1_].png

I don't need SMath to show me algebra and arithmetic steps.

Note: The default output unit for this example is m*Pa, I just changed it for a cleaner look.
Offline Jean Giraud  
#8 Posted : 12 July 2023 15:47:55(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 983 time(s) in 811 post(s)
Expanded intermediate step was discussed Mathsoft Collaboratory.
Little resulted from long exposition, including Units as well.
You get 12.95 N/m ... I get 12.95 mPa
Offline mkraska  
#9 Posted : 12 July 2023 15:52:47(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,023
Germany

Was thanked: 1153 time(s) in 739 post(s)
Oh, 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.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Kenny Lemens  
#10 Posted : 12 July 2023 16:00:17(UTC)
Kenny Lemens


Rank: Advanced Member

Groups: Registered
Joined: 11/01/2018(UTC)
Posts: 144
Man
United States
Location: Wisconsin

Was thanked: 67 time(s) in 42 post(s)
Greetings,

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:
SMath_subsitituton.jpg

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. ᵂᴵ
"No matter where you go, there you are." -Buckaroo Banzai

Hotkeys: https://en.smath.com/for...rce.ashx?a=45771&b=2
Offline wb.c  
#11 Posted : 12 July 2023 17:29:51(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Originally Posted by: mkraska Go to Quoted Post
Oh, 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:

2023-07-12 10_23_18-SMath Solver 1.0.8348 - [Test1.sm_].png

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.

2023-07-12 10_08_28-SMath Solver 1.0.8348 - [Test1.sm].png
2023-07-12 10_09_38-Test1.sm - Notepad.png

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.
Offline wb.c  
#12 Posted : 12 July 2023 18:02:19(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Originally Posted by: Kenny Lemens Go to Quoted Post
Greetings,

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.

2023-07-12 10_08_28-SMath Solver 1.0.8348 - [Test1.sm].png
2023-07-12 10_09_38-Test1.sm - Notepad.png


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.

2023-07-12 11_00_02-SMath Solver 1.0.8348 - [Test1.sm_].png

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.
2023-07-12 10_57_49-SMath Solver 1.0.8348 - [Test1.sm_].png

As far as I understand, unless you activate significant figures, SMath is running full precision in background regardless of how you display the results.

Edited by user 14 July 2023 04:14:23(UTC)  | Reason: Not specified

thanks 1 user thanked wb.c for this useful post.
on 12/07/2023(UTC)
Offline mkraska  
#13 Posted : 12 July 2023 21:22:45(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,023
Germany

Was thanked: 1153 time(s) in 739 post(s)
Significant figures or decimal places are just two ways to format the result. I guess they should not affect the background calculation, otherwise we would go back to the times of the slide rule and accumulate round-off errors.

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?
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline wb.c  
#14 Posted : 12 July 2023 22:36:16(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Originally Posted by: mkraska Go to Quoted Post

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.

2023-07-12 15_18_25-SMath Solver 1.0.8348 - [Worksheet1_].png

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.

2023-07-12 15_18_41-SMath Solver 1.0.8348 - [Worksheet1_].png

When we mix "accuracy" we see that we get a total combined level of precision. 6+4=10.

2023-07-12 15_23_55-SMath Solver 1.0.8348 - [Worksheet1_].png

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.
Offline mkraska  
#15 Posted : 13 July 2023 08:54:19(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 2,023
Germany

Was thanked: 1153 time(s) in 739 post(s)
Based on the above discussion I'd modify the above description of the expected features:

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.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline wb.c  
#16 Posted : 14 July 2023 04:12:06(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Great description Martin. I concur.
Offline wb.c  
#17 Posted : 18 October 2023 05:27:00(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
Any update on this?
Offline Jean Giraud  
#18 Posted : 19 October 2023 01:35:32(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 983 time(s) in 811 post(s)
Originally Posted by: wb.c Go to Quoted Post
When 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.
Offline wb.c  
#19 Posted : 19 October 2023 04:56:45(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 152
United States

Was thanked: 25 time(s) in 21 post(s)
One of the best features of this forum:
2023-10-18 11_55_01-Substitution Optimization.png

It's almost as good as Adblocker!
thanks 3 users thanked wb.c for this useful post.
on 19/10/2023(UTC),  on 19/10/2023(UTC),  on 19/10/2023(UTC)
Offline oscampo  
#20 Posted : 19 October 2023 06:10:31(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 250
Man
Colombia
Location: Cali, Colombia

Was thanked: 89 time(s) in 68 post(s)
Originally Posted by: wb.c Go to Quoted Post
One of the best features of this forum:
2023-10-18 11_55_01-Substitution Optimization.png

It's almost as good as Adblocker!


What a useful contribution!!!
thanks 2 users thanked oscampo for this useful post.
on 19/10/2023(UTC),  on 19/10/2023(UTC)
Users browsing this topic
2 Pages12>
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.