Post Reply 
Interesting question in the HP forums
09-10-2018, 08:22 AM (This post was last modified: 09-10-2018 11:39 AM by Didier Lachieze.)
Post: #2
RE: Interesting question in the HP forums
Hi Cyrille,

I've tested it with the following system:

x+4*y+7*z = 10
-2*x+5*y+8*z = 11
3*x+6*y+9*z = 12

linsolve returns: [0,-1,2]

but your proposed solution returns: [-4.5, 0, 4.8333333...]

I think that you need to transpose M2 to make it work, and modify the formula in A5 to:

Code:
=M3:=((M2:=TRN(M2:=A1:C3))^(-1)*(M1:=D1:D3))


Here is an even more kludgy solution but which doesn't use the global variables M1, M2 or M3:

in A5 enter the formula:

Code:
=MAKEMAT(EXPR(CHAR(64+J)+I),3,3)^(-1)*MAKEMAT(EXPR("D"+I),3,1)

in A6 to C6 enter: =head(row(A5,0)), =head(row(A5,1)), =head(row(A5,2))

   

EDIT: here is another formula for A5 without using M1, M2 or M3 and avoiding the issue with CAS not recognizing the : in A1:C3

Code:
=TRN(list2mat(EXPR("A1:C3")))^(-1)*list2mat(EXPR("D1:D3"),1)

EDIT2: you can also replace the formula in A6 .. C6 by:

Code:
=row(A5,[0,0]), =row(A5,[1,0]), =row(A5,[2,0])
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Interesting question in the HP forums - Didier Lachieze - 09-10-2018 08:22 AM



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