domingo, 5 de junio de 2016

HP Prime programming

Today I am going to write about an HP Prime function I have found really useful:

REDIM: This function allows to change the size of either a matrix or a vector, adding null spaces to them without deleting the numbers stored previously.
  • The syntax is:
    • REDIM(name of the matrix,{number of rows, number of columns})
    • REDIM(name of the vector,{length})

This function is really useful in program that you do not know the size of the matrix beforehand and you have to ask the user. 

For example, for obtaining the impedance and admittance matrices of an overhead power line:




Please NOTE that for entering a vector in a program you must enter the data inside the vector, i.e. the scalar multiplication property does not apply:


A good example are when the overhead power line is in staggered rows, in which the easiest way to put coordinates are:



Another WARNING is to create a vector you always have to press the button (,).
Otherwise, if you press the ± the calculator will make a matrix and the functions will not work.

This blog post and the HP Prime program belongs to my friend Jaime Luengo who I am very grateful.