Sunday, April 24, 2016

HP Prime Firmware Update ( Firmware 10077) (Available through Archive)

HP Prime Firmware Update ( Firmware 10077)


7/27/2016 Update:   Sadly, version 10077 has been pulled due to issues and HP decided to take it off out of caution.  The latest firmware is back to 8151.  :(

http://www.hpmuseum.org/forum/thread-6085-post-57343.html#pid57343

9/1/2016:  Some users have downgraded back to 8151 and may had problems with the touch screen.  HP put the version 10077 back up so these users can restore their calculators.  

Link:  ftp://ftp.hp.com/pub/calculators/Prime/Archive/

If you have not used version 10077 yet, the writer of this blog assumes no warranty or risk.

http://www.hpmuseum.org/forum/thread-6085-page-5.html

Access


It is advised that you use the Internet Explorer browser to download the updated firmware.    This new firmware for the HP Prime (April 2016) provides new functionality and corrects a lot of issues.  A more complete list is included in the zip file, but let’s go over some highlights, which include creating backup files and jpg files (see towards the end):

What’s New in Firmware 10077?

Creating and Restoring Backups Directly on the Calculator



This maybe a first for graphing calculators, but you can create backup files directly on the HP Prime.  Press [ Shift ], [(toolbox)] (Mem) to access the memory list.  Backups is now listed as one of the memory types.  You can create a new backup, restore an old one, or delete old backups.

Picture Background on Plot Screens



The Prime can now have a picture as a background on the Plot Screen.  To set a picture, press [ Shift ], [ Plot ] (Plot Setup), and scroll to Page 3 of the options.  Pictures can be stretched, centered, or plotted on a specific (x,y) position.  Of course, you can choose No Background.


Sketching Functions (Functions and Statistics 2 Var app)



You can now draw certain classes of functions directly on HP Prime screen without entering an expression on the Symb page.  On the Function App’s Plot screen, select the soft key (Fcn), then Sketch.   Draw the function (by touch) on the screen.  The Prime attempts to fit a common equation to the curve in which you may be prompted to selected between two or three functions.  If the function is accepted, it is added to the Function list on the Symb screen.

You can draw a fit in a similar matter of the Statistics 2 Var app.  The difference is that you must have data in the Num database (and able to be plotted). 

Definition and Translations – Function App



The (Fcn) soft menu on the Function’s Plot screen has two additional functions:

*  Definition:  You can change the definition of a function by tapping the bottom of the screen and editing to the screen.  This command is also given in the Advanced Graphing App.

*  Transformation:  You can drag a function (up, down, left, and/or right) when Transformation is activated.  The edited function is stored once the transformation is accepted.

* Update (5/1/2016).  In transformation mode, you can use pinching and "reverse"-pinching motions to compress and widen the function.  Thank you to Eried of HPMOC Forums.  


*  Also thanks to a reader (no name was given) that you can also press the (Form) softkey during Transformation mode to change the form of the function.  (Refer to the comments below)


The UNION Function



The UNION function (Toolbox, Lists) of two or more numbers/lists returns a list of all numbers listed without duplicates.


The DIFFERENCE Function now accepts multiple lists



The DIFFERENCE function (Toolbox, Lists) returns all elements that are present in one and only one list.

Help Screen Text can now be Copied



You can now copy and paste the help text.  The entire help text for that page is selected.  For the moment there is no way of selecting only parts of the help text.

CHOOSE is now available in the Spreadsheet App






The CHOOSE command is available in the Spreadsheet App.   The syntax is:

=CHOOSE(cell where to store the index number, “title”, range of data)

In the example (see the picture listed) above, if have in Cell B2:

=CHOOSE(B6, “Tier Number”, D2:D4)

The index number is designated to B6 based on selection and the number corresponding to the index number in the range is entered on cell B2.


New Gradian Angle Mode



When the HP Prime is in Gradian angle mode, the angle indicator will have a “g” on the top right corner of the screen.  Gradian mode sets the system variable HAngle = 2.
 Just a note, be careful when using ARG in Gradian mode when the real part is negative in Home mode.

Σ can now use local variables in Programs




CAS.int can now use local variables in Programs




Plot-Table Screen Copy to Graphic Objects




When in a Plot-Table View is in use, press [ Shift ], [ View ] (Copy).  You are presented with choose menu to select the graphic object (G1-G9).

In programming mode the display is Graphic Object 0 (G0).  Use BLIT to copy the temporary graphic object (G1-G9) to the display (G0).

Syntax:  BLIT(target graphic object [G#],  source graphic object [G#])

PIXON and PIXON_P allows for alpha blend



Syntax:  PIXON([G#], x, y, {color, alpha}), PIXON_P([G#], x, y, {color, alpha})

Alpha range from 0 (opaque) to 255 (transparent)

Creating an JPG Image







1.  Bring up your image you want to create as a .jpg file.  Copy it to a temporary graphic object G1-G9.  Please remember what App you are using it will be important.
* Plot Screen:  Press [ Shift ], [ View ] (Copy).
* Program:    Use the BLIT to store G0 (the screen) to another graphic object.  Make sure you store the image into a temp graph object G1 – G9.
2.  Back at home, press the (App) soft key, find the app you are working with, select 4. Modes, and select AFiles.
3. As your argument, type the string “filename.jpg”. Then use ≔ outside of the AFiles and type the graphic file you are using.  For example:  AFiles(“sineimpact.jpg”)≔G1 stores the image stored in G1 to the jpg file sineimpact.


4.  Opening the Connectivity Kit, you can see your file stored under the designated Application.  Note that if you want to use save the graphic object on a PC/Mac, you’ll have to use other means since there is currently no direct export function.  (Two ideas: Open the file and save it from the computer’s engine or if the graphic object was created by the emulator, open it and save it as a screen shot)



That is just some of the improvements and additions to Version 10077.  Download it, as all my programs for the HP Prime will use this firmware version until further notice.

Thank you,

Eddie


This blog is property of Edward Shore, 2016.
















Sunday, April 17, 2016

HP Prime: Gompertz Model

HP Prime:  Gompertz Model

The program GOMPERTZ fits the data {y_1, y_2, y_3, … , y_m } to the curve:

y = a*b^c^x

where x = {0, 1, 2, 3, 4, … , m-1}.  The program works best if the dimension (size) of the data set is divisible by 3.  GOMPERTZ sorts the values into ascending order before calculation.

The results returned is a 3 x 1 matrix of the parameters: a, b, and c.    

GOMPERTZ estimates a, b, and c and runs through one iteration to retrieve a better estimate, and may be modified by include additional iterations should the user desire. 

Process (in a nutshell):

1.  Let y = list of data to fit.  Sort y to list all elements in ascending order.

2.  Let m = size(y).  Divide y into three equal-sized sub-lists.   For each sub-list, take the natural logarithm of each element and add.  Hence:
n = m/3
s1 = Σ(ln y_k) for k=1 to n
s2 = Σ(ln y_k) for k=n+1 to 2n
s3 = Σ(ln y_k) for k=2n+1 to m

3.  Calculate the first estimate of a, b, and c:
c = ((s3 – s2)/(s2 –s1))^(1/n)
a = e^( 1/n * (s1 + (s2 – s1)/(1 – c^n))
b = e^( (s2 – s1)*(c – 1)/(1 – c^n)^2)

4.  Create the matrix v, where v = [[a],[b],[c]]. 

5.  Develop the matrix D and Y, where:

Each row of D consists of
[ b^c^I, b^c^I * a/b * c^I,  b^c^I * a/b * c^I * ln(b)* I]

And each row of Y consists of
[ y(I+1) – a*b^c^I ]

Where I = 0 to m-1

6.  Calculate v’ by setting v’ = (D^T*D)^-1 * D^T * Y. 

7.  Add v’ to v.  v1 = v + v’.  The matrix v1 is the new estimate.

The equation is estimated to be:  y ≈ a/100 * b^c^x   

HP Prime Program: GOMPERTZ

EXPORT GOMPERTZ(yl)
BEGIN
LOCAL y,m,n;
// 2nd STEP
y:=SORT(yl);
m:=SIZE(y);
n:=m/3;
LOCAL y1:=SUB(y,1,n);
LOCAL y2:=SUB(y,n+1,2*n);
LOCAL y3:=SUB(y,2*n+1,m);
LOCAL s1:=ΣLIST(LN(y1));
LOCAL s2:=ΣLIST(LN(y2));
LOCAL s3:=ΣLIST(LN(y3));
LOCAL c:=((s3-s2)/(s2-s1))^(1/n);
LOCAL b:=e^((s2-s1)*(c-1)/
(1-c^n)^2);
LOCAL a:=e^(1/n*(s1+(s2-s1)/
(1-c^n)));
LOCAL v:=[[a],[b],[c]];

// Making dmat,ymat
LOCAL dmat,ymat,I,k1,k2,k3,k4;
dmat:=[[0,0,0]];
ymat:=[[0]];
FOR I FROM 0 TO m-1 DO
k1:=b^c^I;
k2:=k1*a/b*c^I;
k3:=k2*LN(b)*I;
k4:=y(I+1)-a*(b^c^I);
dmat:=ADDROW(dmat,[k1,k2,k3],
I+1);
ymat:=ADDROW(ymat,[k4],I+1);
END;
dmat:=DELROW(dmat,I+1);
ymat:=DELROW(ymat,I+1);

// new param
LOCAL vt:=(TRN(dmat)*dmat)*
TRN(dmat)*ymat;
LOCAL v1:=v+vt;
RETURN v1;

END;


Example

Data: {58, 66, 72.5, 78, 82, 85}

Result:

[[ 94.2216370902 ] , [ 0.615221033606 ] , [ 0.732101473203 ]]

We can infer that curve is estimated to be:

y ≈ 94.2216370902 * 0.615221033606^0.732101473203^x


Source

ReliaWiki.  “Gompertz Models”  http://reliawiki.org/index.php/Gompertz_Models   Retrieved April 12, 2016



This blog is property of Edward Shore, 2016

Area Under the Curve Using Parametric Curves: Casio Classpad fx-CP400 and HP Prime (CAS)

Area Under the Curve Using Parametric Curves:   Casio Classpad fx-CP400 and HP Prime (CAS)

The CAS (computer algebra system) function paramint calculates the area under the curve of a function defined as the parametric curve (x(t), y(t)).  The integral is  ∫ y(t) * x’(t) dt .


Casio Classpad fx-CP400:  paramint




It would the most efficient way is use the Define command on the home screen (like the screen shot above). 

Define paramint(xt,yt,t0,t1) = ∫ (yt * diff(xt,t) dt, t = t0 to t = t1)


HP Prime:  paramint  (CAS Program)




The program paramint is going to be defined as CAS function.  When first creating paramint, check the CAS box before pressing the soft key (OK).  Also pay attention to the letters being typed while using the ALPHA key.  In the program editor, letters are defaulted to uppercase while CAS variables are lowercase.  Finally, commands called from the Toolbox in Program editing mode will have a “CAS.” suffix.  Erase the suffices. 


#cas
paramint(xt,yt,t0,t1):=
BEGIN
LOCAL n;
n:=int(yt*diff(xt,t),t,t0,t1);

return n;
END;
#end

Examples

Example 1:  x(t) = 2t^3 + 1, y(t) = t^2, t0 = 0, t1 = 1
Result:  6/5

Example 2:  x(t) = sin t, y(t) = 3 cos t, t0 = 0, t1 = π
Result: 3/2*π ≈ 4.71238898039


This blog is property of Edward Shore, 2016

Wednesday, April 13, 2016

HP Prime, Casio Classpad: Bessell Functions of the 1st Kind

Bessel Function of the First Kind

The program BESS1 calculates the Bessel function of the First Kind. With the HP Prime and Casio Classpad, and any calculators that can process integrals (and the processor is fast enough), we can use the definition:

J_n(x) = 1/π * ∫ (cos(n*t – x*sin(t)) dt for t= 0 to t = π

This is the solution to the differential equation:

x^2*y’’ + x*y’ + (x^2 – n^2)*y = 0, where y is a function of x.

There are many other variations and approximations to calculate J_n(x) if the integral function is not available on your calculator. 

More information on the Bessel function is found here:

Wolfram

Wikipedia



Casio Classpad (fx-CP400):  The Function BESS1




As the screen above shows, I used a Define statement in the Main Mode:

Define bess1(n,x) = 1/π ∫ (cos(n*t – x*sin(t)) dt, from t = 0 to t = π)

Note:  Make sure that the calculator is in Radians mode before calculating.

HP Prime:  BESS1

EXPORT BESS1(n,t)
BEGIN
// Bessel 1st Kind
LOCAL b;
// Integrate
b:=(1/π)*CAS.int(COS(n*X-t*SIN(X)),X,0,π);
// Approximate
b:=approx(b);
RETURN b;

END;

Note: the integration and approximation are two separate steps.  They need to be in order for this program to work correctly.

Examples

bess1(1,2) ≈ 0.576724807756
bess1(0,6.3) ≈ 0.223812006132
bess1(2,4) ≈ 0.364128145852


This blog is property of Edward Shore, 2016.

Monday, April 11, 2016

Five Years (April 16, 2016)

Five Years

April 16, 2016 will be my blog's fifth birthday.  As they always say, how fast time flies.  My first entry in 2011 was me saying "Hello" and that was it. Two days later on April 18, 2011 was my first "real" post covering the HP-10BII.  The link to that post is here: 
http://edspi31415.blogspot.com/2011/04/hp-10bii-first-look.html

One of my most popular posts came soon after, the review of the TI-36X Pro, posted on April 27, 2011:
http://edspi31415.blogspot.com/2011/04/ti-36-pro-review.html

Since then there were programming and math tutorials, programs covering calculator and calculator apps covering a variety of topics, and the occasional reviews.  

I am super grateful to all of you and thank you for the comments and compliments. This is one way I share my love of mathematics with the world, and you help me allow to continue to do so.  

Here's to another five years,

Eddie

Wednesday, April 6, 2016

Simple Right Triangle Solver: Casio Classpad, TI-84 Plus

Simple Right Triangle Solver:  Casio Classpad, TI-84 Plus



Variables: 
x = length of the base (run)
y = length of the height (rise)
d = length of the diagonal
θ = angle (opposite of side y)

Casio Classpad (fx-CP400):  TRIANGLE

‘Setup

‘Set Decimal answers
SetDecimal

‘Set Degrees
SetDegree

‘Local \\ I use the x and y from the keyboard in combined variable names
Local sx,sy,sd,sθ \\ set up strings to join
Local ch,x,y,d,θ
Local st1,st2,st3,st4,st
ClrText
“x= “ ⇒ sx
“y= “ ⇒ sy
“d= “ ⇒ sd
“θ= “ ⇒ sθ

‘Menu \\ set up output screen text
Print “Triangle Solver”, ColorBlue  \\ color only applies for fx-CP400
Print “ “  \\ to create a blank line
Print “Known Variables”, ColorBlue
Print “θ is opposite of y”
Print “1. x, y”
Print “2. x, d”
Print “3. y, d”
Print “4. θ, x”
Print “5. θ, y”
Print “6. θ, d”
Input ch, “1. x, y 2. x, d  3. y, d 4. θ, x 5. θ, y 6. θ, d”,”Known Variables”

‘Choice 1
If ch=1
Then
Input x, “x=”
Input y, “y=”
√(x^2 + y^2)⇒d
tan^-1(y/x)⇒θ
ExpToStr d,st1  \\ expr to string
ExpToStr θ,st2
StrJoin sd,st1,st3  \\ join strings
StrJoin sθ,st2,st4
IfEnd

‘Choice 2
If ch=2
Then
Input x, “x=”
Input d, “d=”
√(d^2 – x^2)⇒y
tan^-1(y/x)⇒θ
ExpToStr y,st1 
ExpToStr θ,st2
StrJoin sy,st1,st3 
StrJoin sθ,st2,st4
IfEnd

‘Choice 3
If ch=3
Then
Input y, “y=”
Input d, “d=”
√(d^2 – y^2)⇒x
tan^-1(y/x)⇒θ
ExpToStr x,st1 
ExpToStr θ,st2
StrJoin sx,st1,st3 
StrJoin sθ,st2,st4
IfEnd

‘Choice 4
If ch=4
Then
Input θ, “θ=”
Input x, “x=”
x/cos(θ)⇒d
x*tan(θ)⇒y
ExpToStr d,st1 
ExpToStr y,st2
StrJoin sd,st1,st3 
StrJoin sy,st2,st4
IfEnd

‘Choice 5
If ch=5
Then
Input θ, “θ=”
Input y, “y=”
y/sin(θ)⇒d
y/tan(θ)⇒x
ExpToStr d,st1 
ExpToStr x,st2
StrJoin sd,st1,st3 
StrJoin sx,st2,st4
IfEnd

‘Choice 6
If ch=6
Then
Input θ, “θ=”
Input d, “d=”
d*cos(θ)⇒x
d*sin(θ)⇒y
ExpToStr x,st1 
ExpToStr y,st2
StrJoin sx,st1,st3 
StrJoin sy,st2,st4
IfEnd

‘Ending
StrJoin st3,”; “,st
StrJoin st,st4,st
Message st,”Results:”
SetStandard

TI-84 Plus (TI-84 Plus CE):  TRIANGLE

Degree
Menu("2 KNOWN VAR","X,Y",1,"X,D",2,"Y,D",3,"θ,X",4,"θ,Y",5,"θ,D",6)
Lbl 1
Prompt X,Y
√(X²+Y²)→D
tan^-1(Y/X)→θ
Disp "D=",D
Disp "θ=",θ
Stop
Lbl 2
Prompt X,D
√(D²-X²)→Y
tan^-1(Y/X)→θ
Disp "Y=",Y
Disp "θ=",θ
Stop
Lbl 3
Prompt Y,D
√(D²-Y²)→X
tan^-1(Y/X)→θ
Disp "X=",X
Disp "θ=",θ
Stop
Lbl 4
Prompt θ,X
X/cos(θ)→D
X*tan(θ)→Y
Disp "D=",D
Disp "Y=",Y
Stop
Lbl 5
Prompt θ,Y
Y/sin(θ)→D
Y/tan(θ)→X
Disp "D=",D
Disp "X=",X
Stop
Lbl 6
Prompt D,θ
D*cos(θ)→X
D*sin(θ)→Y
Disp "X=",X
Disp "Y=",Y
Stop

Examples:

Case 1:  x = 3.6, y = 4.8; results d = 6, θ ≈ 53.13010°

Case 2: x = 5, d = 10; result y ≈ 8.66025, θ = 60°

Case 3: y = 4, d = 10; result x ≈ 9.16515, θ ≈ 23.57818°

Case 4: θ = 30°, x = 8; result d ≈ 9.23760, y ≈ 4.61880

Case 5: θ = 42°, y = 6; result d ≈ 8.96686, x ≈ 6.66368

Case 6: θ = 37.6°, d = 8.88; result x ≈ 7.03553, y ≈ 5.41809

This blog is property of Edward Shore, 2016




Sunday, April 3, 2016

Casio Classpad fx-CP400: Defining Functions

Casio Classpad fx-CP400:  Defining Functions

Using the Define command with the Classpad

A lot of formulas can be created using the Define command on the Casio Classpad.  For this blog I am using the fx-CP400.  My preference is to use the Main application, and call the Define command from the Action>Command submenu.  The expressions are stored as Functions.  If you want to transfer functions (and programs) from the fx-CP400 to a computer drive, export them to the Save-F folder first and then connect the Classpad to the computer.


Fibonacci Numbers

fibon(n) = approx((1+√5)^n – (1-√5)^n)/(2^n * √5)

The approx command is used in order to force a simplified numerical answer. 



Error Function

erf(z) = 2/√π * ∫ (e^-x^2 dx from 0 to z)

I think numerical integrals return approximate answers no matter what, please correct me if I am wrong.



Digital Root:  Counting all digits of a number, repeating the process until you get a single digit (0-9)

dr(n) = 1 + mod(n-1, 9)

I could only find the mod function in the catalog.  Unlike most Casio calculators, the Classpad’s mod function accepts negative numbers and non-integers.



Area of a Regular Polygon

aregpoly(n,s) = (n*s^2) / (4 * tan(180°/n))

The degree symbol (°) is needed to allow proper calculation regardless of angular mode.  The degree symbol is found in the Trig soft menu.



Great Circle: Distance between two places in kilometers

Note:

*  In order for the function to work properly, the Degree mode must be selected.

*  You can enter degrees in terms of degrees, minutes, seconds by choosing the DMS template.  This template is in the Math1 soft keyboard and is represented by three boxes (□ □ □) next to toDMS.  You can also call the template by pressing Action/Interactive, Transformation, DMS, dms.   The dms command’s syntax is  dms(degrees, minutes, seconds) and transforms the input into degree decimals.

Example:
Los Angeles,  N: 34°13’, E: -118°15’;   Tokyo,  N: 35°41’22.22”, E: 139°42’30.12”
Distance ≈ 8,803.002688 km

Formula (for km):
Distance ≈ cosˉ¹ (sin N1 sin N2 + cos N1 cos N2 cos (E1 – E2)) * 6371 * π / 180

If you want US miles, replace 6371 with 3959.



This blog is property of Edward Shore, 2016.


Next Week... and Plans for October 2017

I'm so excited, can't want for next week's HHC 2017 calculator conference in Nashville!  It is my annual calculator conference ...