The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Interesting question in the HP forums
09-10-2018, 05:58 AM
Post: #1
Interesting question in the HP forums
Hello,

Someone posted an interesting question in the HP powered Prime newsgroup..

https://h30434.www3.hp.com/t5/Calculator...-p/6821845

Basically, he wants to make a spreadsheet to solve 3*3 linear systems (like the lin solve app)..

Here is what I came up with... Does anyone have any better idea?



Althrough they are other ways to do it (for example with an app program)... Here is one sollution.


It is kind of kludgy due to some idiosyncraties of the spreadsheet, but it works..


Assume that you enter the system in A1:C4, enter, for A5, the following formula:

=M3:=((M2:=A1:C3)^(-1)*(M1:=D1Big Grin3))


Then, enter for A6 to C6: =M3(1), =M3(2) and =M3(3)


Here is why/how it works.

On the mathematic sides of thing, it works because if you put your system in a 3*3 matrix (M) form with the right side of the ax+by+cz=d equations in a vector (V), M^-1*V returns a vector which are the values for x, y and z... But I assume that you knew that.


A1:C3 will return a list of list which correspond to the "system" part of things. The problem is transforming it into a matrix. the cas list2mat can do this, BUT the cas can not extract values from the spreadsheet in the A1:C3 form as it does not know how to handle the ":" charater :-(

Hence the trick of storing the list of list into the M1 global variable. Since M1 is a matrix, the store operation will internally convert the list of list into a matrix and RETURN said matrix. Causing the transformation of the list of list into a matric.

We do the same for D1Big Grin3 (vector) and M2. We can now easely do the math...


Now the next step is the extraction of the 3 components of the responce.

Normally var(n), when var is a composit (list or matrix) gives access to the various elements...

Problem is that in the spreadsheet, call(n) gives access to the cell meta data (value, equation, format...).

Which is why the equation in A5 has the M3:= store. This make sure that the result vector is stored in M3 and allows the A6, B6 and C6 to access the nth elements of the result...


As as I said, kludgy, but works...


Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Interesting question in the HP forums - cyrille de brébisson - 09-10-2018 05:58 AM



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