Correction SS-1233
1 vote

Optimize symbolically without putting numbers

Created by brotjob on 10/16/2014 10:38 PM Last Updated by Mike Kaganski on 4/16/2016 5:25 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

In many cases of complex calculations (several pages or distributed in several files) it is desirable to show the variables that affect a result - and which ones are cancelled out. Typically you would do this close to the place where you show the numerical value. So this request is not for a global setting but for something you access through right click->optimize->symbolical. Symbolical optimization to me as a engineer is not to show the number 6 but to show a^2mt in this example. The attachment shows a photoshopped behaviour after implementing this change.

    Mike Kaganski (Saturday, April 16, 2016 5:25 AM) #

Please try to describe the exact rules, based on which the program should or should not substitute a definition for a name.

In your example, you want F and v to be substituted, while a, m and t should stay as names. How would the program notice the difference?

You may argue that those latter are "simple numerical values" - but they are not, actually, they are all formulas consisting of a number multiplied by a unit (and a is even more complex). Think about complex numbers that may happen in a formula - they are represented as formulas, too. Think about rational numbers.

Think about deep-nested cases where you would like the expansion to stop at some intermediate level, or to avoid expanding one part of formula.

You have imagined your wanted result by your human brain, that is capable of abstractions, sees higher-level picture and skips irrelevant at wanted level of detail of this specific task. But program should operate by universal precise algorithms.

This is just to show that the problem is very difficult and depends on user's demands, so if you really need this, you should try to strictly define the development requirements - so that developer could understand the problem limits and possible implementation. This by itself doesn't guarantee the result yet, but it improves chances that this will be considered.

    brotjob (Friday, April 15, 2016 9:10 AM) #

For me, smath ist an engineering calculation documentation system. Thus I want to make my calculations easily understandable for the reader. Such calculations usually spread for 2 to 20 pages. Readibility greatly suffers if you define a formula on page 2 and the numerical calculation is on page 20.

I knew the workaround from Mike. But for his (1) I would replace "allows" with "forces". The user has no choice which workflow he/she wants to use. This is not good in my point of view.

    Mike Kaganski (Wednesday, April 13, 2016 6:51 AM) #

Well, this is related to the order of declarations.
If you declare all relations before the symbolic result, without actual values, you will get what you need.

This sequence is logical, because (1) it allows you to separate logically the relations and the variable assignments; (2) it allows you to get resulting coefficients if you only assign those variables that are "constant" in your formula; and (3) it allows the program to symbolically construct the most efficient formula representation to use later in numerical calculations.

See here for a working result of your example.