MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Get theoretical answer on linear equations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45166] Re: [mg45122] Get theoretical answer on linear equations
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Fri, 19 Dec 2003 06:57:32 -0500 (EST)
  • References: <200312171254.HAA07583@smc.vnet.net> <004301c3c508$7cde75b0$3f57fea9@Tomas> <3FE15871.8050407@telia.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Stefan,
That's precisely why I suggested you read a little about the Mathematica
basics (BTW, you may use the Help Browser, where a copy of The Book is
found). The output of a Solve execution is always given in terms of what is
called a "replacement rule", i.e., something like {x -> "something"}. Now,
you must know the meaning of that in order to use the solution. See e.g.
Section 1.5.7 (click Help and then The Mathematica Book | A Practical
Introduction | Symbolic Mathematics | Solving Equations). There you'll find
enough material to keep you busy (and interested, I hope).

Tomas
----- Original Message ----- 
From: "Stefan Fredriksson" <mcriley at telia.com>
To: mathgroup at smc.vnet.net
Subject: [mg45166] Re: [mg45122] Get theoretical answer on linear equations


> Hi Thomas,
>
> Thanks for your answer. I have one followup question though if you
> please could help.
> How do you get the answer fomatted in such nice way? When I try to copy
> or save my answer the formatting is messed up totally.
> I use Mathematica 4 it that matters.
>
> Also, unfortunatly I dont have a book because I bought a student version
> that did not include it.
>
> Regards
> Stefan
>
> Tomas Garza wrote:
>
> >There should be no problem, in principle. Watch out for your syntax,
though.
> >Equal sign must be replaced by two equal signs, and there should be a
space
> >between coefficients and variables. Try this
> >
> >In[5]:=
> >Solve[{A1*x + B1*y + C1*z == D1,
> >   A2*x + B2*y + C2*z == D2, A3*x + B3*y + C3*z ==
> >    D3}, {x, y, z}]
> >
> >
> >Out[5]=
> >{{x -> -((B3*C2*D1 - B2*C3*D1 - B3*C1*D2 + B1*C3*D2 +
> >       B2*C1*D3 - B1*C2*D3)/((-A3)*B2*C1 + A2*B3*C1 +
> >       A3*B1*C2 - A1*B3*C2 - A2*B1*C3 + A1*B2*C3)),
> >   y -> -((A3*C2*D1 - A2*C3*D1 - A3*C1*D2 +
> >       A1*C3*D2 + A2*C1*D3 - A1*C2*D3)/
> >      (A3*B2*C1 - A2*B3*C1 - A3*B1*C2 + A1*B3*C2 +
> >       A2*B1*C3 - A1*B2*C3)),
> >   z -> -((A3*B2*D1 - A2*B3*D1 - A3*B1*D2 +
> >       A1*B3*D2 + A2*B1*D3 - A1*B2*D3)/
> >      ((-A3)*B2*C1 + A2*B3*C1 + A3*B1*C2 - A1*B3*C2 -
> >       A2*B1*C3 + A1*B2*C3))}}
> >
> >I suggest you spend some time reading the Mathematica Book (at least the
> >first part).
> >
> >Tomas Garza
> >
> >Mexico City
> >--- Original Message ----- 
> >
> >From: "Stefan Fredriksson" <mcriley at telia.com>
To: mathgroup at smc.vnet.net
> >To: <mathgroup at smc.vnet.net>
> >Sent: Wednesday, December 17, 2003 6:54 AM
> >Subject: [mg45166] [mg45122] Get theoretical answer on linear equations
> >
> >
> >
> >
> >>Hi,
> >>
> >>I wonder if Mathematica can give me the theoretical answer on linear
> >>equations. In other words, can it solve these equations without haveing
> >>the "numbers".
> >>
> >>Example:
> >>
> >>  I have three equations, and three unknowns;
> >>
> >>  EQ1 = A1x + B1y + C1z = D1
> >>  EQ2 = A2x + B2y + C2z = D2
> >>  EQ3 = A3x + B3y + C3z = D3
> >>
> >>....and get the theoretical answer;
> >>
> >>         A2*D3 - A3*D2   A1*D2 - A2*D1
> >>         ------------- - -------------
> >>         A2*B3 - A3*B2   A1*B2 - A2*B1
> >>    z = -------------------------------
> >>         A2*C1 - A1*C2   A3*C2 - A2*C3
> >>         ------------- - -------------
> >>         A1*B2 - A2*B2   A2*B3 - A3*B2
> >>
> >>
> >>        (A1*D2 - A2*D1) + (A2*C1 - A1*C2)*z
> >>    y = -----------------------------------
> >>                  (A1*B2 - A2*B1)
> >>
> >>        D1 - B1*y - C1*z
> >>    x = ----------------
> >>               A1
> >>
> >>I can do this by hand but I need to implement it in a program I write
> >>and it is so easy to make errors when you solve it by hand. Especially
> >>since I need the solution for 4,5,6 and 7 equations/unknonws.
> >>
> >>I have no idea how to work with matrixs in my programing language so
> >>please dont give me that as a hint :)
> >>
> >>Regards
> >>Stefan
> >>
> >>
> >>
>
>



  • Prev by Date: Copy as InputForm
  • Next by Date: RE: RE: speed-up of a function
  • Previous by thread: Re: Get theoretical answer on linear equations
  • Next by thread: Re: Get theoretical answer on linear equations