home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math.symbolic
- Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!newton.physics.uq.oz.au!coates
- From: coates@newton.physics.uq.oz.au (Tony Coates)
- Subject: Re: mathematica solve and rules
- Message-ID: <BtzEo8.A36@bunyip.cc.uq.oz.au>
- Sender: news@bunyip.cc.uq.oz.au (USENET News System)
- Organization: Physics Dept. The University of Queensland
- References: <1992Sep3.004655.21678@athena.mit.edu>
- Date: Thu, 3 Sep 1992 02:52:49 GMT
- Lines: 77
-
- In article <1992Sep3.004655.21678@athena.mit.edu>, Matthias Imhof <gondwana@basalt.mit.edu> writes:
- |> when i use solve in mma, i get
- |>
- |> u4 y4 y4
- |> {{a -> ----- - -----, b -> --,
- |> 120 h 120 h 24
- |>
- |> u2 h u4 y2 h y4 y2
- |> c -> --- - ---- - --- - ----, d -> --,
- |> 6 h 36 6 h 18 2
- |>
- |> 3 3
- |> u0 h u2 7 h u4 y0 h y2 h y4
- |> e -> -- - ---- + ------- - -- - ---- + -----, f -> y0}
- |> h 6 360 h 3 45
- |>
- |> }
- |>
- |> but what i actally want is something like
- |>
- |> u4 y4 y4
- |> a = ----- - -----, b = --,
- |> 120 h 120 h 24
- |>
- |> u2 h u4 y2 h y4 y2
- |> c = --- - ---- - --- - ----, d = --,
- |> 6 h 36 6 h 18 2
- |>
- |> 3 3
- |> u0 h u2 7 h u4 y0 h y2 h y4
- |> e = -- - ---- + ------- - -- - ---- + -----, f = y0}
- |> h 6 360 h 3 45
- |>
- |>
- |> which defines the solution to be a, b, c, d, e and f and not just the
- |> transform rules which could be applied
- |>
- |> is there a way to do that? can someone explain the concept of rules and
- |> definitions?
- |>
- |> matthias
-
- Look at it this way:
-
- "Solve[{a + b = 1, a - b = -1}, {a, b}]"
- gives
- "{{ a -> 0, b -> 1}}".
- Usually, to use these rules, I would do something like
- "subs = First[Solve[...]]"
- where the "First" is to get rid of the outer list braces, which I have
- never understood the reason for. If you want to assign these values to
- "a" and "b", you can then type
- "{a, b} = {a, b} /. subs"
- and there you have it.
-
- I should add, though, that my experience is that while sometimes
- you want to give specific values to variables, sometimes you also want
- to change definitions within a single notebook. In this case, I find it
- more convenient to quote which substitutions I specifically want for
- each operation. So the way that "Solve" returns results is not so bad
- at all; it just depends somewhat on what you want and what things you do
- inside a single notebook.
- I hope this helps a bit.
- Tony.
- _______________________________________________________________________________
-
- Anthony.B.Coates (Tony)
- Department of Physics
- The University of Queensland QLD 4072
- Australia
-
- Phone: (+617)365 3424 (Physics Departmental Office)
- Fax: (+617)365 1242 ( " " " )
- Email: coates@physics.uq.oz.au
-
- "My messages mirror my feelings, but do not reflect University policy."
- _______________________________________________________________________________
-