AW: Get theoretical answer on linear equations
- To: mathgroup at smc.vnet.net
- Subject: [mg45145] AW: [mg45122] Get theoretical answer on linear equations
- From: Matthias.Bode at oppenheim.de
- Date: Thu, 18 Dec 2003 06:55:19 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello Stefan,
Mathematicas does indeed produce the solution you desire:
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}]
{{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)}}
And it works for larger systems as well!
Best regards,
Matthias Bode
Sal. Oppenheim jr. & Cie. KGaA
Koenigsberger Strasse 29
D-60487 Frankfurt am Main
GERMANY
Tel.: +49(0)69 71 34 53 80
Mobile: +49(0)172 6 74 95 77
Fax: +49(0)69 71 34 95 380
E-mail: matthias.bode at oppenheim.de
Internet: http://www.oppenheim.de
Von: Stefan Fredriksson [mailto:mcriley at telia.com]
Gesendet: Mittwoch, 17. Dezember 2003 13:55
An: mathgroup at smc.vnet.net
Betreff: [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