home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / calculat / sm30a.zip / SYMBMATH.H33 < prev    next >
Text File  |  1993-11-07  |  3KB  |  65 lines

  1.                    4.2.1 Assuming domain
  2.     A second way is to assume x>0 before evaluation. If you assume
  3. the variable x is positive or negative, the output expression is simpler 
  4. than that if you do not declare it.
  5.  
  6. IN:  assume(x > 0, y <0)             # assume x > 0, y < 0
  7. OUT: assumed
  8. IN:  sqrt(x^2), sqrt(y^2), sqrt(z^2)
  9. OUT: x*sign(x), y*sign(y), z*sign(z)
  10. IN:  last                            # simplify last output
  11. OUT: x, -y, z*sign(z)
  12.  
  13.     In this way, all of x is affected until the assume() is cleared by 
  14. clear(). The first method is local simplification, but the second method 
  15. is global simplification. 
  16.         By default, |x| < inf and all variables are complex, except that
  17. variables in inequalities are real, as usual only real numbers can be
  18. compared. e.g. x is complex in sin(x), but y is real in y > 1.
  19.     You can restrict the domain of a variable by assuming the variable
  20. is even, odd, integer, real number, positive or negative.
  21.     Example 4.2.3.
  22.  
  23. IN:  isreal(b) := 1          # assume b is real
  24. IN:  sqrt(b^2)
  25. OUT: abs(b)
  26.     
  27.     Table 4.2       Assuming
  28. ---------------------------------------------------------------------
  29. Assume          Assignment              Meaning                
  30.  
  31. assume(x>y)     x>y := 1                # assume x > y
  32. assume(x>=y)    x>=y := 1               # assume x >= y
  33. assume(x<y)     x<y := 1                # assume x < y
  34. assume(x<=y)    x<=y := 1               # assume x <= y
  35. assume(x==y)    x==y := 1               # assume x == y
  36. assume(x<>y)    x<>y := 1               # assume x <> y
  37.         iseven(b) := 1          # assume b is even
  38.         isodd(b) := 1           # assume b is odd
  39.         isinteger(b) := 1       # assume b is integer
  40.         isratio(b) := 1         # assume b is ratio
  41.         isreal(b) := 1          # assume b is real
  42.         iscomplex(b) := 1       # assume b is complex
  43.         isnumber(b) := 1        # assume b is number
  44.         islist(b) := 1          # assume b is a list
  45.         isfree(y,x) := 1        # assume y is free of x
  46.         issame(a,b) := 1        # assume a is same as b
  47.         sign(b) := 1            # assume b is positive complex
  48.         sign(b) := -1           # assume b is negative complex
  49. ------------------------------------------------------------------------
  50.  
  51.     The assume() can be cleared by clear(). e.g. clear(x>y).
  52.  
  53.                    Simplification in different domains
  54. ---------------------------------------------------------------------
  55. exprsseion         complex               real             x > 0
  56.  
  57. sqrt(x^2)          x sign(x)             |x|              x
  58. x*sign(x)          x sign(x)             |x|              x
  59. |x|*sign(x)        |x| sign(x)           x                x
  60. |x|/x              |x|/x                 1/sign(x)        1
  61. x+inf              x+inf                 inf
  62. x-inf              x-inf                 -inf
  63. abs'(x)            |x|/x                 1/sign(x)        1
  64. ----------------------------------------------------------------------
  65.