Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equation solver

Status
Not open for further replies.

DDSpetro

Petroleum
Jan 13, 2010
39
Dear all,

Hello !!

Eq.1 : a1X1+b1X2+c1X3+d1X4+.....+t1X20=3825;
..
..
..
Eq. 20 : a20X1+b20X2+c20X3+d20X4+......+t20x20=4520

where a,b,c ...t =coefficient are known; there are 20 such equations, is it possible to solve the equation and to find out X1 to X20 value through any software ? How ?

The data is available with as attached.Kindly refer sheet 1.

 
Replies continue below

Recommended for you

Sure can! With matlab of course.

You have a matrix A, vector X and solution vector b.
So you have A * X = b and you wanna know the vector X.
So in matlab, you fill in the matrix with your coefficients, then type on the following line B = inv(A); This will inverse your matrix.
Then compute B*b'; (dont forget to put a ' behind the b, it indicates you take the transpose of your vector b so the rowvector becomes a columnvector)
The solution will be a vector with your solution, from x1 to x20 in order.
 
Nah, try this

>> help \

or more verbosely

>> help mldivide

Computing the inverses of large matrices is pretty expensive.

- Steve
 
The attached data sheet is very typical ; because a*x does not equal to b in real practical scenario ;

actually, this b answer is nothing but we can say a1x1+b1x2+c1x3+.....+t1x20 = b ;where b is known, a1,b1,...t20 is known but x1,x2 ,x3 are not known. like that equation is there.

similary , a2x1+b2x2+c2x3+.......+t2x20 = c ; where c is known, a2,x2...t2 are known but x1,x2,x3 ....are not known which is same as in section 1. basically, a1,a2...etc. are stream composition which is known through laboratery while x1,x2...x20 are 20 different streams flow is not known which is to be find out,ultimately all 20 streams mix to the main stream where composition and total flow is known that is why b,c..on right side is known. like this way.as attached in sheet.
 
While running Matlab,some of the X1,X2 values out of 20 sterams are coming negative which is practically not possible as these are all flow rates of streams , how to correct in Matlab , is there any provisition in Matlab so, that we can have postiive coefficient and not negative ?
 
You'd need to study the Matlab help docs for options that can be used


You may find something in there that's useful. Alternatively, ask some of the specialists in the comp.soft-sys.matlab newsgroup. There are many people well versed in linear equations and their nuances.

- Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor