home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / sci / math / symbolic / 2306 < prev    next >
Encoding:
Text File  |  1992-09-02  |  3.1 KB  |  89 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!newton.physics.uq.oz.au!coates
  3. From: coates@newton.physics.uq.oz.au (Tony Coates)
  4. Subject: Re: mathematica solve and rules
  5. Message-ID: <BtzEo8.A36@bunyip.cc.uq.oz.au>
  6. Sender: news@bunyip.cc.uq.oz.au (USENET News System)
  7. Organization: Physics Dept. The University of Queensland
  8. References:  <1992Sep3.004655.21678@athena.mit.edu>
  9. Date: Thu, 3 Sep 1992 02:52:49 GMT
  10. Lines: 77
  11.  
  12. In article <1992Sep3.004655.21678@athena.mit.edu>, Matthias Imhof <gondwana@basalt.mit.edu>  writes:
  13. |> when i use solve in mma, i get 
  14. |> 
  15. |>         u4      y4         y4
  16. |> {{a -> ----- - -----, b -> --, 
  17. |>        120 h   120 h       24
  18. |>  
  19. |>         u2    h u4   y2    h y4       y2
  20. |>    c -> --- - ---- - --- - ----, d -> --, 
  21. |>         6 h    36    6 h    18        2
  22. |>  
  23. |>                        3                   3
  24. |>         u0   h u2   7 h  u4   y0   h y2   h  y4
  25. |>    e -> -- - ---- + ------- - -- - ---- + -----, f -> y0}
  26. |>         h     6       360     h     3      45
  27. |>  
  28. |>    }
  29. |> 
  30. |> but what i actally want is something like
  31. |> 
  32. |>         u4      y4         y4
  33. |> a =    ----- - -----, b =  --, 
  34. |>        120 h   120 h       24
  35. |>  
  36. |>         u2    h u4   y2    h y4       y2
  37. |>    c =  --- - ---- - --- - ----, d =  --, 
  38. |>         6 h    36    6 h    18        2
  39. |>  
  40. |>                        3                   3
  41. |>         u0   h u2   7 h  u4   y0   h y2   h  y4
  42. |>    e =  -- - ---- + ------- - -- - ---- + -----, f =  y0}
  43. |>         h     6       360     h     3      45
  44. |>  
  45. |> 
  46. |> which defines the solution to be a, b, c, d, e and f and not just the
  47. |> transform rules which could be applied
  48. |> 
  49. |> is there a way to do that? can someone explain the concept of rules and  
  50. |> definitions?
  51. |> 
  52. |> matthias
  53.  
  54. Look at it this way:
  55.  
  56.     "Solve[{a + b = 1, a - b = -1}, {a, b}]"
  57. gives
  58.     "{{ a -> 0, b -> 1}}".
  59. Usually, to use these rules, I would do something like
  60.     "subs = First[Solve[...]]"
  61. where the "First" is to get rid of the outer list braces, which I have
  62. never understood the reason for.  If you want to assign these values to
  63. "a" and "b", you can then type
  64.     "{a, b} = {a, b} /. subs"
  65. and there you have it.
  66.  
  67.     I should add, though, that my experience is that while sometimes
  68. you want to give specific values to variables, sometimes you also want
  69. to change definitions within a single notebook.  In this case, I find it
  70. more convenient to quote which substitutions I specifically want for
  71. each operation.  So the way that "Solve" returns results is not so bad
  72. at all; it just depends somewhat on what you want and what things you do
  73. inside a single notebook.
  74.     I hope this helps a bit.
  75.                             Tony.
  76. _______________________________________________________________________________
  77.  
  78. Anthony.B.Coates (Tony)
  79. Department of Physics
  80. The University of Queensland  QLD  4072
  81. Australia
  82.  
  83. Phone: (+617)365 3424           (Physics Departmental Office)
  84. Fax:   (+617)365 1242           (   "         "         "   )
  85. Email: coates@physics.uq.oz.au
  86.  
  87. "My messages mirror my feelings, but do not reflect University policy."
  88. _______________________________________________________________________________
  89.