Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline DeepButi  
#1 Posted : 23 October 2021 13:23:31(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Hi, new to SMath and trying to figure how to get the formula with the variable values before the final result.

I want to write

a: = 3
b: = 4
a + b


click = and get

a + b = 3 + 4 = 7


Is this possible?

Thks
Offline Jean Giraud  
#2 Posted : 23 October 2021 14:57:31(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 5,801
Canada

Was thanked: 867 time(s) in 697 post(s)
Adnoseum.PNG
Offline overlord  
#3 Posted : 23 October 2021 15:04:36(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 564
Turkey

Was thanked: 172 time(s) in 124 post(s)
Originally Posted by: DeepButi Go to Quoted Post
Hi, new to SMath and trying to figure how to get the formula with the variable values before the final result.

I want to write

a: = 3
b: = 4
a + b


click = and get

a + b = 3 + 4 = 7


Is this possible?

Thks

Not how you wanted in single line but possible.

2021-10-23_15-03.png
Offline DeepButi  
#4 Posted : 23 October 2021 17:11:27(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Originally Posted by: overlord Go to Quoted Post
Originally Posted by: DeepButi Go to Quoted Post
Hi, new to SMath and trying to figure how to get the formula with the variable values before the final result.

I want to write

a: = 3
b: = 4
a + b


click = and get

a + b = 3 + 4 = 7


Is this possible?

Thks

Not how you wanted in single line but possible.

2021-10-23_15-03.png


Thks a lot, it will do.

Just my decimal values get displayed as fractions

a := 3.5
b := 4.5
a + b = 7/2 + 9/2


Blush Blush I can live with that Blush Blush


Offline Jean Giraud  
#5 Posted : 23 October 2021 19:25:33(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 5,801
Canada

Was thanked: 867 time(s) in 697 post(s)
Originally Posted by: DeepButi Go to Quoted Post
Just my decimal values get displayed as fractions

Evaluate Numeric.
Offline overlord  
#6 Posted : 23 October 2021 21:39:21(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 564
Turkey

Was thanked: 172 time(s) in 124 post(s)
Originally Posted by: DeepButi Go to Quoted Post
Thks a lot, it will do.

Just my decimal values get displayed as fractions

a := 3.5
b := 4.5
a + b = 7/2 + 9/2


You can write variables inside simple functions with this method.
This is not a practical way to write variables inside complex functions.
And it does not look good too. Yet it is better than nothing.
You can write a + b with Ctrl+Shift+K.

2021-10-23_21-20.png
Offline Razonar  
#7 Posted : 23 October 2021 22:29:43(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 872
Uruguay

Was thanked: 475 time(s) in 308 post(s)
Hi. This is another way.

intermediate_results.sm (15kb) downloaded 13 time(s).

Imagen1.png

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 24/10/2021(UTC)
Offline DeepButi  
#8 Posted : 23 October 2021 23:59:30(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Originally Posted by: Razonar Go to Quoted Post
Hi. This is another way.

intermediate_results.sm (15kb) downloaded 13 time(s).

Imagen1.png

Best regards.
Alvaro.


That looks exactly as I was looking for ... going to study it. Thks a lot, it will save me quite a bit of time.
Offline DeepButi  
#9 Posted : 24 October 2021 22:00:36(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Hi Razonar,
it works perfectly well for initial formulas, but cannot find any way to use a previous result on a new one.

Sin titulo.jpg

Cannot put all values in a single vals, the simbolic substitution will show in the second formula the formula (not the value) of the calculated value (ee).

Cannot either reuse names.

Any idea?
Offline Jean Giraud  
#10 Posted : 25 October 2021 00:40:20(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 5,801
Canada

Was thanked: 867 time(s) in 697 post(s)
... use this document that you can fabricate at will.
Cheers ... Jean.

Maths Infix QUICK.sm (7kb) downloaded 5 time(s).
Offline Jean Giraud  
#11 Posted : 25 October 2021 03:18:26(UTC)
Jean Giraud


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 5,801
Canada

Was thanked: 867 time(s) in 697 post(s)
noob.PNG
Offline overlord  
#12 Posted : 25 October 2021 04:10:44(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 564
Turkey

Was thanked: 172 time(s) in 124 post(s)
Originally Posted by: DeepButi Go to Quoted Post
Any idea?

I have an idea, if someone has better you can use it.
Rewrite expressions and hide them inside areas.
Configure page setup with "no areas".
When you save as pdf or print, it will show as continuous.

MySum.sm (9kb) downloaded 7 time(s).

MySum.png

But here is a humble suggestion.
SMath was not coded with intent to show intermediate results.
You are going to struggle very much with this approach.

Regards
Offline PompelmoTell  
#13 Posted : 25 October 2021 13:36:36(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 275
Man
Italy
Location: italy

Was thanked: 96 time(s) in 81 post(s)
I point out that in a previous post DeepButi used the function Clear("all" ) that despite not giving error does not have a feedback in SM: does not delete any variable.
sergio
thanks 1 user thanked PompelmoTell for this useful post.
on 25/10/2021(UTC)
Offline Razonar  
#14 Posted : 25 October 2021 19:29:52(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 872
Uruguay

Was thanked: 475 time(s) in 308 post(s)
Hi. This is another way. The feature request actually is here.

Using

img0.png

You can get

Hold.sm (10kb) downloaded 5 time(s).

img1.png

or

Hold_v2.sm (10kb) downloaded 5 time(s).

img2.png

Best regards.
Alvaro.

Edited by user 25 October 2021 19:42:55(UTC)  | Reason: Not specified

thanks 1 user thanked Razonar for this useful post.
on 25/10/2021(UTC)
Offline DeepButi  
#15 Posted : 26 October 2021 00:31:25(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Too easy to be true Dry Final step uses fractions to substitute ... Use a:=1.2 in your example and you will see.

Actual formulas are for sure more complex so the data display is really confusing.

Sin titulo.jpg
Offline Razonar  
#16 Posted : 26 October 2021 03:06:10(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 872
Uruguay

Was thanked: 475 time(s) in 308 post(s)
Originally Posted by: DeepButi Go to Quoted Post
... Use a:=1.2 in your example and you will see.


Hi. Insert eval( ) in UnHold

img0.png

Best regards.
Alvaro.
Offline DeepButi  
#17 Posted : 26 October 2021 11:48:01(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Hi. Insert eval( ) in UnHold

Best regards.
Alvaro.


You are a genious. Thks!

Just trying to figure out how to avoid too many decimals now Acute Acute

Decimal places set to 4 everywhere Dry

Sin titulo.jpg



Offline Razonar  
#18 Posted : 26 October 2021 18:21:13(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 872
Uruguay

Was thanked: 475 time(s) in 308 post(s)
Originally Posted by: DeepButi Go to Quoted Post
...
Just trying to figure out how to avoid too many decimals now Acute Acute

Decimal places set to 4 everywhere Dry



Hi. Thanks! ... but ... not ... but thanks. That behavior seems to be a bug or an oversight: set the decimal places in the output of an expression with None Optimization.

In the meantime, this could be a workaround, but could be dangerous, because change the stored value. Actually I don't really recommend it.

img.png

Best regards.
Alvaro.
Offline DeepButi  
#19 Posted : 26 October 2021 20:01:06(UTC)
DeepButi

Rank: Newbie

Groups: Registered
Joined: 23/10/2021(UTC)
Posts: 7
Spain
Location: Sant Cugat

Originally Posted by: Razonar Go to Quoted Post


Hi. Thanks! ... but ... not ... but thanks. That behavior seems to be a bug or an oversight: set the decimal places in the output of an expression with None Optimization.

In the meantime, this could be a workaround, but could be dangerous, because change the stored value. Actually I don't really recommend it.

Best regards.
Alvaro.


Ok, ok. Really it's a BIG THANKS.

:round(eval(... works perfectly well

:eval(round(... didn't.

Offline johnspark  
#20 Posted : 27 October 2021 08:25:12(UTC)
johnspark


Rank: Advanced Member

Groups: Registered
Joined: 26/09/2021(UTC)
Posts: 48
Australia
Location: Adelaide

Was thanked: 5 time(s) in 3 post(s)
Originally Posted by: DeepButi Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post


Hi. Thanks! ... but ... not ... but thanks. That behavior seems to be a bug or an oversight: set the decimal places in the output of an expression with None Optimization.

In the meantime, this could be a workaround, but could be dangerous, because change the stored value. Actually I don't really recommend it.

Best regards.
Alvaro.


Ok, ok. Really it's a BIG THANKS.

:round(eval(... works perfectly well

:eval(round(... didn't.




Another way...
Capture27.JPG
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.