Ask Your Question
0

Problem with matrix echelon form

asked 2023-09-07 07:03:34 +0200

Sotto gravatar image

updated 2023-09-07 09:09:15 +0200

FrédéricC gravatar image

Dear all,

if we define A to be

A = matrix([[1,-3,0,2],[-2,4,0,h],[0,-2,1,k],[3,-1,7,1]])
A.echelon_form()

gives diag(1,1,1,1). But this is wrong for some values of h and k.In some cases the last 1 could be 0.

How can I fix this? Thanks, N

edit retag flag offensive close merge delete

Comments

A possible approach would be defining a function of h and k.

Max Alekseyev gravatar imageMax Alekseyev ( 2023-09-07 17:29:37 +0200 )edit

Sorry not clear enough for me … What do you mean?

Sotto gravatar imageSotto ( 2023-09-09 12:27:11 +0200 )edit

Like this:

def myform(h,k):
    A = matrix([[1,-3,0,2],[-2,4,0,h],[0,-2,1,k],[3,-1,7,1]])
    return A.echelon_form()
Max Alekseyev gravatar imageMax Alekseyev ( 2023-09-09 14:46:49 +0200 )edit

I see. Thanks. But in this case I have to enter the values for h and k. That's not what I want... I'd like Sage to tell me what condition on h and k gives an echelon form like drag(1,1,1,1) and which one gives drag(1,1,1,0).

Sotto gravatar imageSotto ( 2023-09-10 10:13:37 +0200 )edit

diag not drag :-)

Sotto gravatar imageSotto ( 2023-09-10 10:15:11 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2023-09-10 18:17:50 +0200

Max Alekseyev gravatar image

updated 2023-09-12 16:20:12 +0200

I'm not sure why this does not work over the symbolic ring, but it does so over the rational field of polynomials in h and k:

R.<h,k> = PolynomialRing(QQ,2)
A = matrix([[1,-3,0,2],[-2,4,0,h],[0,-2,1,k],[3,-1,7,1]])
A.echelon_form()

gives

[              1               0               0      -3/2*h - 4]
[              0               1               0      -1/2*h - 2]
[              0               0               1      -h + k - 4]
[              0               0               0 11*h - 7*k + 39]

ADDED. Explanation for why this does not work over SR is given in this answer.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2023-09-07 07:03:34 +0200

Seen: 135 times

Last updated: Sep 12 '23