Post Reply 
Find a basis from cartesian equations
08-31-2017, 07:06 PM
Post: #1
Find a basis from cartesian equations
Hello
I want to find an easier way to find vectors which are a basis of a vector space defined by cartesian equations. For eixample:
x1+2x2+x3+2x4+x5=0
-x1-2x2-x4+2x5=0
x1+2x2+3x3+4x4+7x5=0

So, first I reduce the system (applying Gauss reduction):
I use RREF(matrix of coefficients of the system)
rref([[1,2,1,2,1],[-1,-2,0,-1,2],[1,2,3,4,7]])
to obtain
[[1,2,0,1,-2],[0,0,1,1,3],[0,0,0,0,0]]

So we have two equations which means the subspace represented have 5-2 dimensions. So for a basis of this space we need three independent vectors.

Next I use solve() giving values to find three possible vectors:
solve([[x1+2*x2+x4-2*x5,x3+x4+3*x5,x2 = 1,x4 = 0,x5 = 0]],[x1,x2,x3,x4,x5])
which gives {[-2,1,0,0,0]}

So I will change values for x2=0, x4=1 and X5=0 which gives {[-1,0,-1,1,0]}

And third and last I change x2=0, X4=0 and X5=1 which gives {[2,0,-3,0,1]}

This is a very complicated way, to obtain the three vectors of the basis.
Is there a function to solve this directly?

Thanks for your help

Toni
Find all posts by this user
Quote this message in a reply
09-01-2017, 10:04 AM (This post was last modified: 09-01-2017 10:05 AM by AlexFekken.)
Post: #2
RE: Find a basis from cartesian equations
I suppose you could combine the last 3 steps by setting x2=a, x4=b, x5=c, with a, b and c unassigned.
Find all posts by this user
Quote this message in a reply
09-01-2017, 02:34 PM
Post: #3
RE: Find a basis from cartesian equations
Good point!

You could also use gbasis instead of RREF (that way, you wouldn't have to type the coefficients into a matrix).
Find all posts by this user
Quote this message in a reply
09-01-2017, 08:14 PM
Post: #4
RE: Find a basis from cartesian equations
Thanks very much for your helpful answers.
Both works:
First give {[-2*a-b+2*c,a,-b-3*c,b,c]}which giving values to a,b,c give same answer in one step (before three).

Second just jumps one step, so both together make it easier.

Anyway, if someone finds a direct way tell me
thanks again

Toni
Find all posts by this user
Quote this message in a reply
09-04-2017, 12:26 PM
Post: #5
RE: Find a basis from cartesian equations
Hello again

I have seen a different possibility. May not be very mathematically appropiate but the result seems OK:
The kernel of a linear map is a set of the vectors whose image is (0...0). So up to a point vectros who solve the equations.

If you aply Ker(matrix of coefficients of the former equations), this gives directly the the vectors of the basis in just one operation.

With so many functions it is not easy to find one that fits what you are looking for. HP manual is not very extensive.

Thanks again

Toni
Find all posts by this user
Quote this message in a reply
09-06-2017, 06:01 AM
Post: #6
RE: Find a basis from cartesian equations
Inside Giac/Xcas, syst2mat does the conversion from linear equations to matrix form, unfortunately it is not available on the Prime.
m:=syst2mat([x1+2x2+x3+2x4+x5=0,-x1-2x2-x4+2x5=0,x1+2x2+3x3+4x4+7x5=0],[x1,x2,x3,x4,x5]);
ker(m[0..2,0..4]);
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)