Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. 
Notices 
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto 
Site FAQ 
Sitemap 
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQrelated cookies.

Introduction to Linux  A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free. 


06102006, 01:31 PM

#1

Member
Registered: Jan 2006
Posts: 174
Rep:

How to solvle this 4th system of equations.
hi guys, I am solving a 4 system of equations like this.
36 4 4 4 X1 40
36 32 4 4 X2 4
4 32 28 4 X3 = 4
4 4 28 24 X4 4
I search but don't find calculator online. Is there any
body know any sites can calculate it ?
Thanks a lot!



06102006, 01:34 PM

#2

LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep:

Do it by hand? You can use the normal way of solving simultaneous equations, but there's also a way to do it using matrices (though I can't remember what it is right now).
Why is this in programming? :/



06102006, 01:40 PM

#3

Member
Registered: Jan 2006
Posts: 174
Original Poster
Rep:

;( do you have a calculator?..



06112006, 06:26 AM

#4

Member
Registered: Oct 2004
Location: India
Distribution: Redhat
Posts: 88
Rep:

The equations do look weird. Where is the "equality" symbol ie '=' in the above equations? I found only one.. What calculator are you talking about?



06112006, 08:18 PM

#5

Member
Registered: Jan 2006
Posts: 174
Original Poster
Rep:

It hase been solved. I think some calculators has functions of solving SOE.



06112006, 09:18 PM

#6

Member
Registered: Jun 2006
Location: morocco
Posts: 195
Rep:

try to clarify ur system.
u can solve it by the GAUSS elemination method



06122006, 12:31 PM

#7

LQ Newbie
Registered: Jun 2006
Posts: 3
Rep:

Augmented Matrices
Quote:
Originally Posted by ArthurHuang
hi guys, I am solving a 4 system of equations like this.
36 4 4 4 X1 40
36 32 4 4 X2 4
4 32 28 4 X3 = 4
4 4 28 24 X4 4
I search but don't find calculator online. Is there any
body know any sites can calculate it ?
Thanks a lot!

Use augmented matrices.
[36 4 4 4 X1 40]
[ 36 32 4 4 X2 4 ]
[ 4 32 28 4 X3 4 ]
[ 4 4 28 24 X4 4 ]
Then use the RREF function on the matrix.
RREF  reduced row echelon form



06122006, 12:40 PM

#8

LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep:

You can also use Cramer's rule and do it with determinants. I've never learnt about augmented matrices, so don't know about those.



06122006, 01:19 PM

#9

Member
Registered: Jan 2005
Location: Chandler, AZ USA
Distribution: Mandrake/Mandriva 10.2
Posts: 186
Rep:

Yeah, use augmented matrices. You just reduce to reduced Row echelon from. A graphing calculator can also help solve this equation for you, but keeping track of matrix variables (prevents mistakes) and eases doing row operations.
Look up 'linear programming' on Google, and 'solving systems of linear equations'.
Quote:
Why is this in programming? :/

Likely because it is considered linear programming, and they did not see the context, but I do not know for sure.
Quote:
You can also use Cramer's rule and do it with determinants. I've never learnt about augmented matrices, so don't know about those.

An augmented matrix, is one that is just separated, typically to represent equality on one side. Cramer's rule and determinants of matrices are actually more advanced topics than augmented matrices
By the way, I am also curious where the equality symbols are here (only one as mentioned). Am I to assume the others are equal to zero, or that the last number in each equation is the Right Hand Side?
Code:
36 4 4 4 X1 40
36 32 4 4 X2 4
4 32 28 4 X3 = 4
4 4 28 24 X4 4
You should place the entire system of equations on here, as is.
Last edited by elyk1212; 06122006 at 01:32 PM.



06122006, 01:34 PM

#10

Member
Registered: Jan 2005
Location: Chandler, AZ USA
Distribution: Mandrake/Mandriva 10.2
Posts: 186
Rep:

Reduced Row Echelon example (giving answers). Say each row is X1,X2,X3, then given answer matrix:
Code:
[1 0 0  A]
[0 1 0  B]
[0 0 1  C]
X1 = A
X2 = B
X3 = C
But in your example, with 5 variables, and 4 equations, you will not get full answers, you will get answers in terms of themselves, as yours in an underdetermined system. Try it out and see!
Last edited by elyk1212; 06122006 at 01:39 PM.



06122006, 02:02 PM

#11

HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450
Rep:

Quote:
Originally Posted by Nylex
You can also use Cramer's rule and do it with determinants. I've never learnt about augmented matrices, so don't know about those.

Augmented matrices is just a shorthand way of using Gaussian elimination (which, by the way, is much less computationally intensive than Cramer's rule).



06122006, 05:30 PM

#12

Member
Registered: Jun 2006
Location: morocco
Posts: 195
Rep:

i want just to know if ur system like this A*x=b
Code:
Quote:
36 4 4 4 40] x1]
A= 36 32 4 4 b=  4] x= x2]
4 32 28 4  4] x3]
4 4 28 24  4] x4]

if it is the case so:
now the new A'=Ab
will be :
Code:
Quote:
36 4 4 4 40
A'= 36 32 4 4  4
4 32 28 4  4
4 4 28 24 4

ok try to use that algo :
note: it is an algo without pivoting!!!!!!!!
Code:
Quote:
function A=MEG(A,b)
[n,n] = size(A);
for k=1:n1
for i=k+1:n
m=A(i,k)/A(k,k) ;
for j = k :n
A(i,j)=A(i,j)m *A(k,j);
b(i)=b(i)m*b(k);
end
end
end

when ur A will be U which is an upper triangular matrice use that algo to find ur x vector:
Code:
Quote:
function[x]=subs_retro(A,b)
[n,n]=size(A);
x=zeros(n,1);
x(n)=b(n)/A(n,n);//b here is the new b
for i=n1:1:1
x(i)=(b(i)A(i,i+1:n)*x(i+1:n))/A(i,i);//b here is the new b
end

Last edited by adilturbo; 06122006 at 09:02 PM.



06172006, 02:49 PM

#13

Member
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 623

You can use `axiom':
> a := matrix[[36,4,4,4],[36,32,4,4],[4,32,28,4],[4,4,28,24]]
> b := [40,4,4,4]
> solve(a, b)
...
result: x = [5/6, 6/7, 5/6, 17/21]



06182006, 12:23 PM

#14

Member
Registered: Jan 2006
Posts: 174
Original Poster
Rep:

This axiom looks really cool. Now I have a 12X8 matrix of SOE, can I use it ?
Btw: is it a software or library?
Quote:
Originally Posted by firstfire
You can use `axiom':
> a := matrix[[36,4,4,4],[36,32,4,4],[4,32,28,4],[4,4,28,24]]
> b := [40,4,4,4]
> solve(a, b)
...
result: x = [5/6, 6/7, 5/6, 17/21]




06192006, 02:00 AM

#15

Member
Registered: Mar 2006
Location: Ekaterinburg, Russia
Distribution: Debian, Ubuntu
Posts: 623

Hi all.
Yes, you can use it for such SOE. If I understand correctly, 12x8 SOE have an infinite set of solutions  linear space. Axiom give you the basis of this space and a partial solution. Any linear function of basisvectors will be a solution of uniform equation A*x=0. Any solution of nonuniform SOE A*x=b looks like x = x_part + c*x_base.
Example:
Code:
> a:= matrix [[1/(i+j) for i in 1..12] for j in 1..8]
(4) >
+1 1 1 1 1 1 1 1 1 1 1 1+
           
2 3 4 5 6 7 8 9 10 11 12 13
 
1 1 1 1 1 1 1 1 1 1 1 1
           
3 4 5 6 7 8 9 10 11 12 13 14
 
1 1 1 1 1 1 1 1 1 1 1 1
           
4 5 6 7 8 9 10 11 12 13 14 15
 
1 1 1 1 1 1 1 1 1 1 1 1
           
5 6 7 8 9 10 11 12 13 14 15 16
(4)  
1 1 1 1 1 1 1 1 1 1 1 1
           
6 7 8 9 10 11 12 13 14 15 16 17
 
1 1 1 1 1 1 1 1 1 1 1 1
           
7 8 9 10 11 12 13 14 15 16 17 18
 
1 1 1 1 1 1 1 1 1 1 1 1
           
8 9 10 11 12 13 14 15 16 17 18 19
 
1 1 1 1 1 1 1 1 1 1 1 1
           
+9 10 11 12 13 14 15 16 17 18 19 20+
Type: Matrix Fraction Integer
(7) > b:= [i for i in 1..8]
(7) >
(7) [1,2,3,4,5,6,7,8]
Type: List PositiveInteger
(8) > s:= solve (a,b)
(8) >
(8)
[
particular =
[ 5112, 176400,  1912680, 9424800,  24144120, 33297264,  23423400,
6589440, 0, 0, 0, 0]
,
basis =
9 36 42 252 63 588 126 72
[[, ,, ,, ,, ,1,0,0,0],
24310 2431 221 221 17 85 17 17
4 315 180 1050 252 441 420 180
[, ,, ,, ,, ,0,1,0,0],
2431 4862 221 221 17 17 17 17
18 700 17325 49500 11550 19404 17325 6600
[, ,, ,, ,, ,0,0,1,0],
4199 4199 8398 4199 323 323 323 323
36 1386 16940 190575 21780 35574 30492 10890
[, ,, ,, ,, ,0,0,0,1]]
4199 4199 4199 8398 323 323 323 323
]
Type: Record(particular: Union(Vector Fraction Integer,"failed"),basis: List Vector Fraction Integer)
(16) >  test (comment)
(16) > a*s.particular
(16) >
(16) [1,2,3,4,5,6,7,8]
Type: Vector Fraction Integer
(17) > a*s.basis.1
(17) >
(17) [0,0,0,0,0,0,0,0]
Type: Vector Fraction Integer
(18) > a*(s.particular + 100 * s.basis.1)
(18) >
(18) [1,2,3,4,5,6,7,8]
Type: Vector Fraction Integer
I think you interested in partial solution. Axiom is a free (at this moment, I meant it was proprietary, but released as free) software, not library.
Last edited by firstfire; 06192006 at 02:04 AM.



Thread Tools 
Search this Thread 


Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off



All times are GMT 5. The time now is 10:13 AM.

LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.

Latest Threads
LQ News

