Thursday, April 11, 2013

Variable Domains

Currently calculations done with the assumption that variables can contain any real number (although there are some cases where this isn't true).  This isn't documented anywhere which may lead to some confusion on exactly how variables behave.  In addition, sometimes it may be desirable for variables to only be positive, only integers, etc.

For example, entering sqrt(x^2)/sqrt(x) currently simplifies to abs(x)/sqrt(x).  However, if x can only be a positive value, then it could be simplified to sqrt(x).

In the next update, you will have the ability to set the domain of variables.  The options will be:
  • Positive Integers
  • All Integers
  • Positive Reals
  • All Reals
  • Complex
Expressions will simplify based on the domains of the variables used in it.  This will not only make it more clear to users exactly what variables can contain, but also allow more flexibility in calculations.

No comments:

Post a Comment