how would i go about the following: read in three coefficents and the constant term for three simultaneous equations in three unknowns: aix+biy+ciz=di for i=1,2,3 find the solution (for x,y and z).any help would be very much appreciated!
how would i go about the following: read in three coefficents and the constant term for three simultaneous equations in three unknowns: aix+biy+ciz=di for i=1,2,3 find the solution (for x,y and z).any help would be very much appreciated!
use linear algebra. Put the equations in matrix form (Ax = b) and then use gauss elimination. Make sure you get no zeros in the diagonal by using pivoting.
More in-depth info:
http://www.damtp.cam.ac.uk/user/fdl/...h98/linear.htm
If time is critical, you can first split A into two triangular matrices L & R (left triangular and right triangular):
LR = A
Ax = b
LRx = b
L(Rx) = b
Rx = y
Ly= b
First, solve Ly = b, then Rx = y. Since L and R are triangular, solving them will be easier.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
ok thanks.i know how to do matrices by hand but how do i incorporate them into a program?i really do not understand programming!please help me!!
Since you know the dimensions:
Code:typedef struct { double _11, _12, _13; double _21, _22, _23; double _31, _32, _33; }Matrix3x3; typedef struct { double _1; double _2; double _3; }Matrix1x3; Matrix3x3 A; Matrix1x3 b;Then perhaps you should start with something easier...i really do not understand programming
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.