Differences in Home vs CAS
|
10-19-2022, 08:55 PM
(This post was last modified: 10-20-2022 01:22 AM by ftneek.)
Post: #1
|
|||
|
|||
Differences in Home vs CAS
Hello, I'm fairly new to the HP Prime and PPL. I started out by trying to recreate a program I wrote in python as a CAS program, but was running into some problems. After a few days of debugging and writing it as a non-CAS program, it works as I'm expecting in the home view, but when I run it in the CAS view it generates warnings that "A/B with B a square matrix is misleading notation interpreted as inv(B)*A", and error "Ifte: Unable to check test Error: Bad Argument Value". Can someone help me understand why that is? Are matrix calculations treated differently in Home vs CAS mode? Ideally I would like my program to works in both modes, with decimals returned in home view and fractions in CAS. I have also tried using the syntax for a cas program but then it errors in either mode. I would appreciate any insights or suggestions.
For reference it is the iterative conjugate gradient method to solve Ax=b, where in this case A is the nxn Hilbert matrix and b is an nx1 matrix which is the rowsum of A, so the exact solution for x is an nx1 matrix composed of 1's, but the computed solution should be "close" to 1's. Code: EXPORT conjugate_gradient(A, b) Here is also a method for generating the rowsum, since I couldn't find an easy way to that with any of the built in methods. It works in both CAS and home view. Code: #cas update: So after some more digging, I think it those warnings came from a leftover file from when I was writing it as a CAS program. I reset my virtual calculator and retransferred the files. It works in Home mode but when I call Code: conjugate_gradient(hilbert(20), rowsum(hilbert(20))) - neek |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Differences in Home vs CAS - ftneek - 10-19-2022 08:55 PM
RE: Differences in Home vs CAS - parisse - 10-20-2022, 05:56 AM
RE: Differences in Home vs CAS - ftneek - 10-21-2022, 12:42 AM
RE: Differences in Home vs CAS - parisse - 10-21-2022, 10:02 AM
RE: Differences in Home vs CAS - ftneek - 10-21-2022, 03:00 PM
RE: Differences in Home vs CAS - Didier Lachieze - 10-20-2022, 09:25 PM
RE: Differences in Home vs CAS - parisse - 10-21-2022, 03:52 PM
RE: Differences in Home vs CAS - ftneek - 10-21-2022, 05:43 PM
|
User(s) browsing this thread: 1 Guest(s)