Interesting TI Nspire CAS CX programming features



#5

Hi All,

I decided to tinker with the TI Nspire CAS CX calculator and do some programming. The first feature that caught my attention is the ability to prompt for an equation (as a function of x). This allows one to write numerical analysis routines (e.g for solving roots and calculating the area under the curve) for equations that the user enters at run-time!

The other feature is the creation of matrices and vectors by a program. Here, I had to use a trick to first create an identity square matrix and then over-writing its elements with different values. To create a vector that has the same number of rows as a square matrix, I first create a vector made up of the diagonal elements of the square matrix and then assign new values to the vector.

Interestingly, the TI Nspire programming model regards vectors as either column matrices or row matrices. This means that when you access the elements of a vector you have to specify both the row and column indices. This dual orientation has to be monitored during the program development phases so you can correctly access the elements of a vector either as a row or a column matrix.

Namir


#6

Namir,

Watch it out! Working too long with the CX makes you addicted and you quit using HP calculators...

Have a great weekend and happy programming!

Cheers,
Joerg


#7

The worse part is that I am working with the Teacher version of the CAS CX emulator. So typing in the source code is a easier than on the machine.

The ability to declare variable and parameter names that are longer than one or two letters is also addictive!!!

Namir

#8

I did find the newMat command to create matrices of any size and with zeros as initial value for the matrix elements. The TI Nspire has the construtMat function that creates a matrix of any size and fill its values based on a user-defined expression that uses the indices of the rows and columns. For example,

constructMat(1/(i+j),i,j,3,4)->A

creates a matrix, A, with 3 rows and 4 columns. The value of each element A(i,j) is based on the values of row index i and column index j using the expression 1/(i+j).

Finally, the function randMat creates a matrix of any size with random values in its elements.

Namir

Edited: 15 Apr 2012, 4:23 p.m.

#9

The equation prompting part has been possible on the 50g for ever. Like so:


<< "Y=" PROMPT 'EQ' STO >>

Then you can go on solving or whatever you like to do with that equation.


#10

Way super cool Alexander!!! Thanks for the tip!

Namir


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: CAS taylor Alberto Candel 5 3,911 12-13-2013, 09:45 PM
Last Post: Alberto Candel
  HP Prime CAS curiosity bluesun08 11 4,744 12-10-2013, 01:03 PM
Last Post: Han
  [HP-Prime CAS] "Warning, ^ (Command) Is ambiguous on non square matrices"?? CompSystems 1 2,154 12-07-2013, 07:15 PM
Last Post: CompSystems
  HP Prime: complex numbers in CAS. Alberto Candel 1 1,868 12-06-2013, 02:36 PM
Last Post: parisse
  [HP Prime] plotfunc() bug in CAS Chris Pem10 2 2,379 12-04-2013, 02:46 PM
Last Post: Chris Pem10
  HP-80 History, Design and Interesting Facts BShoring 1 1,314 11-30-2013, 08:50 AM
Last Post: Xavier A. (Brazil)
  HP Prime: Home/CAS? Alasdair McAndrew 11 3,816 11-26-2013, 02:48 PM
Last Post: Alberto Candel
  HP Prime numerical precision in CAS and HOME Javier Goizueta 5 2,369 11-16-2013, 03:51 AM
Last Post: Paul Dale
  Need CAS help Michael de Estrada 6 2,592 11-13-2013, 01:29 AM
Last Post: cyrille de Brébisson
  HP Prime - CAS functions in Spreadsheet App CR Haeger 6 2,411 11-11-2013, 12:37 AM
Last Post: Michael de Estrada

Forum Jump: