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: [mg45157] Re: [mg45122] Get theoretical answer on linear equations
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Thu, 18 Dec 2003 06:55:35 -0500 (EST)
  • References: <200312171254.HAA07583@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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
Subject: [mg45157] [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: Mathematically rigorous .NET programming
  • Next by Date: RE: Condensing a 4-Tensor into a 2-Tensor
  • Previous by thread: Get theoretical answer on linear equations
  • Next by thread: Re: Get theoretical answer on linear equations