home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / utility / sm22a.zip / SYMBMATH.H04 < prev    next >
Text File  |  1993-04-15  |  2KB  |  65 lines

  1.             7.2 Calculation
  2.  
  3.     SymbMath gives the exact value of calculation when the switch
  4. numerical=off (default), or the approximate value of calculation when 
  5. the switch numerical=on or by the function num().
  6.     SymbMath can manipulate units as well as numbers, be used as 
  7. a symbolic calculator, and do exact computation. The range of real 
  8. numbers is from -infinity to infinity, e.g. ln(-inf), exp(inf+pi*i), 
  9. etc. SymbMath contains many built-in algorithms for performing 
  10. numerical calculations when the switch numerical=on, e.g. ln(-9), i^i, 
  11. (-2.3)^(-3.2), 2^3^4^5^6^7^8^9, etc.
  12.     Warming that SymbMath only gives a principle value if there
  13. are multi-values, except for the function solve().
  14.  
  15.     Example 7.2.1. Find the values of sin(x) when x=pi/2
  16. and x=90 degree.
  17.     Input:
  18. num(sin(pi/2))
  19. num(sin(90*degree))
  20. end
  21.     Output:
  22. 1
  23. 1
  24. end
  25.  
  26.     Example 7.2.2. Set the units converter from the minute to
  27. the second, then calculate numbers with different units.
  28.     Input:
  29. minute=60*second
  30. v=2*meter/second
  31. t=2*minute
  32. d0=10*meter
  33. v*t+d0
  34. end
  35.     Output:
  36. 250 meter
  37.  
  38.     Example 7.2.3
  39.     Input:
  40. 1/2+1/3
  41. end
  42.     Output:
  43. 5/6
  44.         
  45.     Example 7.2.4. Assign sqrt(x) to z, then evaluate z
  46. when x=3 and y=4.
  47.     Input:
  48. z=sqrt(x)
  49. subs(z, x=3)            # evaluate z by substituting x=3
  50. x=4                     # assign 4 to x
  51. z                       # evaluate z 
  52. end
  53.     Output:
  54. z = sqrt(x)
  55. sqrt(3)
  56. x=4
  57. 2
  58.  
  59.     Note that after assignment by x=4, x should be cleared from 
  60. memory by clear(x) before differentiation of the new function. 
  61. Otherwise the values of x still is 4 until new values assigned. If 
  62. evaluating z by the function subs(z, x=3), the variable x is 
  63. automatically cleared after evaluation, i.e. the variable x in subs()
  64. is local variable. This rule applies to other functions. 
  65.