home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!37.1!sunthpi3.difi.unipi.it!campo
- Newsgroups: sci.math.symbolic
- Subject: Re: mathematica solve and rules
- Message-ID: <1992Sep3.091337.434@cine88.cineca.it>
- From: campo@sunthpi3.difi.unipi.it (Massimo Campostrini)
- Date: 3 Sep 92 09:13:37 +0100
- Reply-To: campo@sunthpi3.difi.unipi.it
- References: <1992Sep3.004655.21678@athena.mit.edu> <BtzEo8.A36@bunyip.cc.uq.oz.au>
- Distribution: world
- Organization: Istituto Nazionale di Fisica Nucleare, Pisa, Italy
- Nntp-Posting-Host: sunthpi3.difi.unipi.it
- Lines: 29
-
- In article <BtzEo8.A36@bunyip.cc.uq.oz.au>, coates@newton.physics.uq.oz.au (Tony Coates) writes:
- |>
- |> "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
- --------------
-
- The reason is that if you solve a (system of) polynomial (higher degree)
- equation(s) you will get a list of solutions:
-
- In[1]:= Solve[{x^2+x+y==3, x-y==a}, {x,y}]
-
- -2 - 2 a + 2 Sqrt[4 + a]
- Out[1]= {{x -> -1 + Sqrt[4 + a], y -> ------------------------},
- 2
-
- -2 - 2 a - 2 Sqrt[4 + a]
- > {x -> -1 - Sqrt[4 + a], y -> ------------------------}}
- 2
-
- --
- Massimo Campostrini, Theoretical Physicist,
- Istituto Nazionale di Fisica Nucleare, Sezione di Pisa,
- Piazza Torricelli 2, I-56126 Pisa, Italy || Phone: (+39)(50)42093
- Internet: campo@sunthpi3.difi.unipi.it || Fax: (+39)(50)48277
-