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

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline brotjob  
#1 Posted : 09 October 2014 09:02:27(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

Was thanked: 7 time(s) in 7 post(s)
After lengthy calculations I sometimes wish to show the variables that affect my numbers. I attached a small example. Besides showing the power P numerically, I would like to display P=a^2mt. How do I achieve this?
brotjob attached the following image(s):
Neues Bild.png

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

Offline uni  
#2 Posted : 09 October 2014 09:36:02(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
You can do like this
uni attached the following image(s):
2014-10-09 12-31-25 SMath Studio Desktop - [Лист1 ].png
Russia ☭ forever
Viacheslav N. Mezentsev
Offline brotjob  
#3 Posted : 09 October 2014 10:03:46(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

Was thanked: 7 time(s) in 7 post(s)
Thank you, while this works in this short example it is not feasible in real world calculations:

  1. Engineering calculations usually start with the inputs (constraints), output is at the end. In an extended calculation that is several pages long you can't define all the calculations at the beginning and then just fill the variables.
  2. This example does not work if you have any loops or if statements in between.

Are there other means to optimize symbolically without putting figures?
brotjob attached the following image(s):
volume.png
Offline mkraska  
#4 Posted : 09 October 2014 11:50:12(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: brotjob Go to Quoted Post

Are there other means to optimize symbolically without putting figures?


For the given problem a global switch would be handy, which could disable all assignments with the right hand side being numerically evaluable.

You can fake this behaviour by using a custom conditional definition statement. You also might need a modified display function, because for numeric results symbolic optimization just gives ugly formatting.
File Attachment(s):
condef.sm (7kb) downloaded 14 time(s).
mkraska attached the following image(s):
condef1.PNG
condef2.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline brotjob  
#5 Posted : 09 October 2014 12:44:45(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

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

You can fake this behaviour by using a custom conditional definition statement.


This is a step towards the right direction. Again, however :-)

  1. Your file does not work for me. If I choose sym, I get "a not defined" in the last line P:= I am using the portable version and everything seems to be up to date.
  2. The usage of a function drastically decreases the readibility of the sheet.
  3. It is not efficient. I have to put every variable definition in the ugly function just to display one line symbolically.
  4. You probably didn't mean g_e but g Biggrin


I do not think a global switch is the thing an average engineering user wants. The purpose is to show the dependibility. So only for a selected number of results I want the numerical result and the symbolical result just close to each other. If you define 20 variables and make long calculations you would like to know which variables affect the numerical result and which ones don't.
Users browsing this topic
Guest
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.