Create an account on the HP Community to personalize your profile and ask a question
09-08-2018 01:57 PM
I'd like to ask your help with creative ideas.
I guess it's gonna take some time to reach the final solution. But ideas for the small steps will certainly be very useful.
I intend to solve a linear system using Spreadsheet as user's interface that may run a solve set of equations in background.
Please think about 3 or for rows of repetitive calculations through which the user will input all numerical data available and then the Solve app calculates the missing data. This calculation might be triggered by pressing a button.
Ideas are welcome.
09-09-2018 11:56 PM
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:
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 D1:D3 (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...
09-10-2018 03:17 AM
To answer the other part of your question, there is no way to put a "button" to start a calculation. Spreadsheets always just calculate when changes happen. I'm not sure if I've ever seen one that allows you to have buttons to "start" or anything.
Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
09-10-2018 08:43 PM
Yes, I'm using a CHOOSE already.
I must choose one component to be something like a "pivot" of the whole system.
I've seen you've given a very detailed idea. I should save tomorrow evening to read it mindfully and try it. I might return you some questions.
Thank you very much.
09-10-2018 08:52 PM
Yes, I've seen it.
In fact, now I'm not sure it would be realy necessary.
When filling the spreadsheet with known value, I thought about placing the cursor somewhere at the "pivot" component's column, so the "Solve" considered these data as "frozen" and taking them to calculate the rest of the table.
I guess CHOOSE is doing the job quite well.
But I still am not sure exactly how to implement solve feature inside the spreadsheet.
Thank you very much.
09-11-2018 05:38 PM
Your solution is creative and sounds feasible. I guess the data extraction can be done in a program running loops and character recognition for data separation.
Reading the explanation I guess you understood by "solve" the CAS line command. However, I have in mind the Solve App. The option for combining both Apps (Spreadsheet and Solve) relies on two main reasons. Spreadsheet has the capability of showing data and data fields in organized way, making it easy for the user to read and input data. Solve allows the user to feed data according to their availability, leaving enpty the unknown value cells, then unknown data are calculaed
Thank you very much.