noob question

noob question - How to get intermediate formula - 消息

#1 已发布: 2021/10/23 07:23:31
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

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
#2 已发布: 2021/10/23 09:04:36
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

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
#3 已发布: 2021/10/23 11:11:27
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

Wrote

Wrote

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


I can live with that


#4 已发布: 2021/10/23 13:25:33
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Just my decimal values get displayed as fractions


Evaluate Numeric.
#5 已发布: 2021/10/23 15:39:21
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

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
#6 已发布: 2021/10/23 16:29:43
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Hi. This is another way.

intermediate_results.sm (14.4 KiB)已下载 1257 次。

Imagen1.png

Best regards.
Alvaro.
1位用户喜欢此帖子
sergio 2021/10/24 16:26:00
#7 已发布: 2021/10/23 17:59:30
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

Wrote

Hi. This is another way.

intermediate_results.sm (14.4 KiB)已下载 1257 次。

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.
#8 已发布: 2021/10/24 16:00:36
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

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?
#9 已发布: 2021/10/24 22:10:44
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

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 (8.16 KiB)已下载 1232 次。

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
#10 已发布: 2021/10/25 07:36:36
sergio

sergio

127个赞,共342个帖子。

组: User

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
1位用户喜欢此帖子
Alvaro 2021/10/25 13:22:00
#11 已发布: 2021/10/25 13:29:52
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Hi. This is another way. The feature request actually is here.

Using

img0.png

You can get

Hold.sm (9.78 KiB)已下载 1231 次。

img1.png

or

Hold_v2.sm (9.06 KiB)已下载 1230 次。

img2.png

Best regards.
Alvaro.
1位用户喜欢此帖子
sergio 2021/10/25 14:18:00
#12 已发布: 2021/10/25 18:31:25
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

Too easy to be true 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
#13 已发布: 2021/10/25 21:06:10
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

... Use a:=1.2 in your example and you will see.



Hi. Insert eval( ) in UnHold

img0.png

Best regards.
Alvaro.
#14 已发布: 2021/10/26 05:48:01
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

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

Decimal places set to 4 everywhere

Sin titulo.jpg



#15 已发布: 2021/10/26 12:21:13
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

Wrote

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

Decimal places set to 4 everywhere



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.
#16 已发布: 2021/10/26 14:01:06
DeepButi

DeepButi

0个赞,共7个帖子。

组: User

Wrote



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.

#17 已发布: 2021/10/27 02:25:12
John Heidenreich

John Heidenreich

5个赞,共67个帖子。

组: User

Wrote

Wrote



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
#18 已发布: 2021/10/27 18:53:09
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Wrote

Hello, John
I found no way to recover the symbolic Quaternion ?
Maple is not cracked for this demand ... Now, scratch your head.
Take care ... Jean.


Not related with OP's requests.
#19 已发布: 2022/7/10 09:45:20
Nicolae Olaru

Nicolae Olaru

1个赞,共115个帖子。

组: User

Wrote

... used thefunction Clear ...



Regarding the "Clear (arg)" function, my question is: is it possible to write an analytic function in Smath that has the same purpose ?!

PS - If so, maybe the moderator should separate a new topic. I have not studied this issue very well. Many apologies.
#20 已发布: 2022/7/11 09:47:13
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

Regarding the "Clear (▪,▪,▪ ...)" function, my question is: is it possible to write an analytic function in Smath that has the same purpose ?!


That's what Clear(,) does ... Maybe I don't understand analytical ?
Cheers ... Jean.

Maths Clear.sm (16.46 KiB)已下载 1248 次。

  • 有新帖
  • 无新帖