Showing posts with label solve. Show all posts
Showing posts with label solve. Show all posts

Wednesday, May 3, 2023

Announcement: HP 15C Collector's Edition

 Announcement:  HP 15C Collector's Edition



The HP 15C Returns



Hewlett Packard and Moravia is bringing back the HP 15C Calculator with the HP 15C Collector's Edition, which is set to be delivered starting the summer of 2023.  


The HP 15C is a RPN (Reverse Polish Notation) programming scientific calculator, first released in in 1982 and has the following features:  


*  Matrices:  Store up to 5 matrices.  Operations include determinant, inverse, norm, and transpose.  

*  Complex Numbers:  The set of complex numbers includes powers, logarithms, and trigonometry.

*  Numerical integration

*  Solve:  Finding the roots of functions

*  Standard Scientific functions:  polar/rectangular conversions, trigonometry, powers, roots, logarithms, linear regression, fraction and integer parts, hyperbolic functions

*  Programming:  Keystroke with labels, comparison tests


The HP 15C Collector's Edition has the following improvements from the original and Limited Edition of the HP 15C:


*  There are now 99 memory registers, up from 67

*  There is now a memory capacity of 672 steps, up from 448

*  The new processor promises a faster speed 

*  The Collector's Edition comes with a printed manual, which can be downloaded from Calculator Store's website here:  https://www.thecalculatorstore.com/epages/eb9376.sf/en_US/?ObjectPath=/Shops/eb9376/Products/%22HP-15c%20%23INT%22


From browsing the PDF file of the manual, the manual looks nice and it's detailed. 


For details, credit, and discussion, click on Klass' original post is on the Museum of HP Calculators (MoHPC) here:  https://www.hpmuseum.org/forum/thread-19886.html



Pre-Orders


The HP 15C Collector's Edition is set to be delivered starting at the end of June 2023.   At this moment, Moravia Consulting, a licensee for HP Calculators, has two stores offering pre-sales:


Eduwinkel:  (Netherlands) (Price:  129,95 Euros as of 5/3/2023*)


https://www.eduwinkel.nl/hp-15c-collectors-edition-calculator.html


The Calculator Store:  (Spain) (Price: 129,99 Euros as of 5/3/2023*)


English:  

https://www.thecalculatorstore.com/epages/eb9376.sf/en_US/?ObjectPath=Categories


Spanish:  

https://www.thecalculatorstore.com/epages/eb9376.sf/es_ES/?ObjectPath=Categories


* Prices do not include delivery charges but does include value added tax (VAT).  Depending where the customer is from VAT may be subtracted from the price.  


Source:


Kuperus, Klaas.   "NEW: HP 15C Collectors Edition"  MoHPC (Museum of HP Calculators)   May 2, 2023.  https://www.hpmuseum.org/forum/thread-19886.html



I have pre-ordered a HP 15C Collector's Edition and can't wait to work with it.  



Disclaimer:  No compensation has been received for this post.  



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, March 12, 2023

Casio fx-CG50: Logistic Equation - Solving For Parameters From Two Data Points

Casio fx-CG50:  Logistic Equation - Solving For Parameters From Two Data Points



The Challenge



It can be a challenge, especially without a statistics software package or method like the maximum likelihood estimate, to fit data (x, p), to the curve:


p(x) = 1 / ( 1 + α * x^β ) = ( 1 + α * x^β )^-1



What happens if we just have two data points (x1, p1) and (x2, p2).  Then finding α and β turns into simpler task.   Either we find a quick estimate to extend to other data points or if we just have two data points, exact solutions.




Finding α and β



With the points (x1, p1) and (x2, p2), the system to solve is:


1 / ( 1 + α * x1^β ) = p1

1 / ( 1 + α * x2^β ) = p2


1 + α * x1^β = 1/p1

1 + α * x2^β = 1/p2


α * x1^β = 1/p1 - 1

α * x2^β = 1/p2 - 1 


Assuming that α ≠ 0, divide both equations to get:


x1^β / x2^β = (1/p1 - 1) / (1/p2 - 1)


Solve for β:


(x1/x2)^β = (1/p1 - 1) / (1/p2 - 1)


ln [ (x1/x2)^β  ] = ln [ (1/p1 - 1) / (1/p2 - 1) ]


β * ln [ (x1/x2) ] = ln [ (1/p1 - 1) / (1/p2 - 1) ]


β = ln [ (1/p1 - 1) / (1/p2 - 1) ] / ln [ (x1/x2) ] 


Then we can get α:  


α = (1/p1 - 1) / (x1^β) = (1/p2 - 1) / (x2^β) 




Casio fx-CG50 Program:  BETPARAM

(276 bytes)


The characters α and β are found in the CHAR sub menu (outside of the PRGM menu).  If you have a monochrome calculator or just don't want color, ignore the color commands.


The program then graphs the resulting equation.   The variables Y1 and Y2 (with the bold Y) represent functions of X.  

 


Red "P(X)=1÷(1+αX^β)"

"SOLVE FOR α, β"◢

Rad

"POINT 1"

"X1"?→Y

"P1"?→Q

"POINT 2"

"X2"?→Z

"Y2"?→R

ln ((Q^-1 -1)÷(R^1 - 1))

Ans÷ln (Y÷Z)→B

(Q^-1 - 1)÷(Y^B)→A

ClrText

Blue Locate 1,3,"EST. PARAMETERS"

Locate 1,4,"α="

Locate 5,4,A

Locate 1,5,"β="

Locate 5,5,B

"1÷(1+A×X^B)"→Y1

""→Y2

SetG-Color Green,1

DrawGraph

ZoomAuto



Examples


Example 1:

(x1, p1) = (0.5, 0.76)

(x2, p2) = (1.5, 0.70)





Example 2:

(x1, p1) = (3/2, 5/8)

(x2, p2) = (2/3, 3/8)






Source:


Sumpter, David.  The Ten Equations That Rule the World: And How You Can use Them Too.  Flatiron Books: New York.  2021.  ISBN 978-1-250-24696-7



Eddie



All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, April 9, 2022

Casio fx-9750GIIIl (and fx-CG 50): Ways to Solve Equations

An expert calculator user will be able to use the tools that the calculators has to offer.  Sometimes, the solutions may be found without the need of programming.


The calculator covered today is the Casio fx-9750GIII, which is named the Casio fx-9860GIII in countries outside of the United States.  I am very confident that the solving tools are available to most recent of Casio's graphing models, including the GII series, the first Prizm, and the current color graphing calculator fx-CG 50.


Solve vs SolveN


The functions Solve and SolveN are offered in the Run-Mat mode as well as a programming commands.  


Solve works with equations involving solving for X:


Solve( f(x) = g(x), guess for X)


If g(x) is omitted, then Solve uses f(x) = 0.  Numeric solutions are returned.



SolveN allows us to solve for any variable A-Z and Θ.   Instead of an initial guess, we can provide a lower and upper bound.  SolveN returns a list of solutions within the bound.  If the lower and upper bound are omitted, then the bounds are -9.999999999E99 and 9.999999999E99.


SolveN( left = right, variable, lower bound, upper bound)


If there is no right side given, then SolveN uses left = 0.   When possible, SolveN returns exact solutions:  fractions, square roots, and multiples of π.





Neither Solve or SolveN can return complex numbered answers.  





The Equation Mode


The Equation Mode allows for three type of solvers:


F1:  Simultaneous

F2:  Polynomial

F3:  Solver


On the fx-9750GIII, access the equation mode by pressing MENU, A.   The location of the Equation mode varies depending on the calculator.  


Simultaneous


Linear equations up to 6 x 6 systems can be solved.   Entries can be either real or complex, regardless of the Set Up.  The matrix is set up like this:


[   columns of coefficients (left)   |  (right) ]


For example:

a*x1 + b*x2 = s

c*x1 + d*x2 = t


shows:

1 2 3

1 [ a b s ]

2 [ c d t  ]


The current coefficients are stored in the variable matrix Sim Coef (S∙Cof), while the current solutions can be stored in the variable Sim Result (S∙Rlt).  These are read-only variables. Both variables can be found in the [VARS],[ F6 ] ( > ), [ F3 ] (EQUA) menu. 







Polynomial


The Casio graphing calculators can solve up to 6-degree polynomials.  Depending on the Set Up, the solutions can be restricted to real numbers or return complex numbered solutions.   However, none of the of coefficients in the polynomial to be solved can be complex numbers.


The current coefficients is stored in the variable matrix Poly Coef (P∙Cof), while the current solutions can be stored in the variable Poly Result (P∙Rlt).  These are read-only variables.   Both variables can be found in the [VARS],[ F6 ] ( > ), [ F3 ] (EQUA) menu. 







Solver


The solver will allow any equations with variables A-Z and Θ.  What is nice about this mode is that all the variables will be listed and you can select one variable to solve for.   Repeated scenarios can be explored without the need to recall the SolveN function.  






Those are some of the solving tools of the Casio graphing calculators.  Hopefully you find them useful.  


If there is an interest, I can explore ways to solve applications without the need for programming.


Eddie 


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Friday, April 19, 2019

TI-74: Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74:  Five Stencil Derivative, Vertical Height on a Hill, Solving Cubic Equations

TI-74 Program: Five Stencil Derivative

This program estimates the numerical derivative of f(x) at x0 by the formula:

f'(x0) ≈ ( -f(x0+2h) + 8*f(x0+h) - 8*f(x0-h) + f(x0-2h) )/(12h)

Source:  "Five Stencil Method"  Wikipedia.  Page last edited November 8, 2018.  https://en.wikipedia.org/wiki/Five-point_stencil  Retrieved April 14, 2019

Note:  comments (after !) are for notes, and do not need to be typed. 


500 PRINT "F(X) IS ON LINE 550.": PAUSE 1: RAD  ! RAD sets radians mode
502 INPU T "X: ";A
504 INPUT "H: ";H
506 D=0: X=A+2*H: GOSUB 550
508 D=-F: X =A+H: GOSUB 550
510 D=8*F+D: X=A-H: GOSUB 550
512 D=D-8*F: X=A-2*H: GOSUB 550
514 D=(D+F)/(12*H)
516 PRINT "DF/DX =";D: PAUSE 
518 END
550 F=5.2^X  ! Insert F(X) here
552 END

Examples:

550  F=5.2^X
x0 = 1.2, h = 0.001, Result:  11.92160564

550 F=EXP(X)*SIN(X)
x0 = PI/3, h = PI/24, Result: 3.892851849

TI-74 Program:  Vertical Height on a Hill

Variables:
H = height of the observer
L = horizontal length
V = vertical angle (entered in degrees-minutes-seconds, DD.MMSSSS)
G = ground slope (entered in degrees-minutes-seconds, DD.MMSSSS)

If G>0, the hill is at an elevation.  If G<), the hill is at an depression.

T = total height = vertical difference + observer's height
T = L * (tan V - tan G) + H

Since there is no DMS to decimal conversion function in TI-74's basic, a conversion is necessary. The following is sample code where A is DMS format needed to be converted:

T = ABS(A)
D = INT(T)
M = INT((T-D)*100)
S = ((T-D)*100-M)*100
A = (D+M/60+S/3600)*SGN(A)

The program code is shown below:

600 INPUT "LENGTH: ";L
602 INPUT "OBSERVER'S HEIGHT: ";H   ! ' is SHIFT + SPACE

604 DEG: PRINT "ANGELS IN DD.MMSSSS": PAUSE 1.5
606 INPUT "VERTICAL ANGLE: ";V: A=ABS(V)
608 D=INT(A): M=INT((A-D)*100): S=((A-D)*100-M)*100
612  V=(D+M/60+S/3600)*SGN(V)

614 INPUT "GROUND SLOPE: ";G: A=ABS(G)
616 D=INT(A): M=INT((A-D)*100): S=((A-D)*100-M)*100
618 G=(D+M/60+S/3600)*SGN(G)

620 T=L*(TAN(V)-TAN(G))+H
622 PRINT "TOTAL HEIGHT =";T: PAUSE
624 END

Examples:

Input:  L: 10 m, V: 30°14'33", G: 10°30'00", H = 1.7780 m
Result:  T = 5.754638129 m

Input:  L: 10 m, V: 30°14'33", G: -10°30'00", H = 1.7780 m
Result:  T = 9.461464028 m

Source: 

F.A. Shepherd "Engineering Surveying: Problems and Solutions" 2nd Edition  Edward Arnold Publishers Ltd.  London, UK  1983 ISBN 0-7131-3478-X

TI-74 Program:  Solving Cubic Equations

This program solves the cubic equation:

A*X^3 + B*X^2 + C*X + D = 0

This program uses Newton's method to get the first root, then divides the polynomial by (x - root).  Finally the quadratic formula is used to find the other two roots.  This program assumes the coefficients A, B, C, and D are real.  An initial guess of 1 is used (can be changed, see line 710).

700 PRINT "A*X^3+B*X^2+C*X+D=0, REAL COEFS.": PAUSE 1.5
702 INPUT "A: ";A
704 INPUT "B: ";B
706 INPUT "C: ";C
708 INPUT "D: ";D

710 X=1
712 XN=X-(A*X^3+B*X^2+C*X+D)/(3*A*X^2+2*B*X+C)
714 IF ABS(XN-N)<1e-9 718="" font="" then="">
716 X=XN: GOTO 712

718 X1=XN
720 PRINT "X1 =";X1: PAUSE
722 J=-(A*X1+B)
724 K=(A*X1+B)^2-4*A*(A*X1^2+B*X1+C)
726 IF K<0 750="" font="" then="">
728 X2=(J+SQR(K))/(2*A): X3=(J-SQR(K))/(2*A)
730 PRINT "X2 =";X2: PAUSE
732 PRINT "X3 =";X3: PAUSE
734 END

750 XR=J/(2*A): XI=SQR(ABS(K))/(2*A)
752 PRINT XR;"+- ";XI;"I": PAUSE
754 END

Example:
A: 1, B: 1, C: -9, D: -9
Roots: -3, 3, 1
Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Saturday, May 12, 2018

HP Prime: Solving Projectile Motion with the Solve App



HP Prime:  Solving Projectile Motion with the Solve App

This blog entry is a demonstration using the Solve App to solve a variety of problems regarding projectile motion. 

Getting Started

Go to the Solver App by pressing [Apps] and selecting the Solve application.  If need be, clear all the equations by pressing [Shift] [ Esc ] and selecting (OK) at the Clear All Expressions prompt.

Enter the following equations:

E1:  X = V*COS(θ)*T
E2:  Y = V*SIN(θ)*T – 0.5*G*T^2


Variables:

X = distance in the x direction
Y = distance in the y direction
Θ = angle the projectile is shot
V = initial velocity
T = number of seconds
G = Earth’s gravitation constant:  9.80665 m/s^2, 32.174 ft/s^2

Right now, we are assuming that there is no acceleration in the X direction, the projectile starts at point (0,0), and there is no air resistance.

Finally, put the calculator in Degrees mode, which the angle indicator will display ∠°.

Example 1:  Determining Distance and Time it takes for the Projectile to complete

Given the following data:

θ = 40°
G = 9.80665 m/s^2
V = 35 m/s
Y = 0

Select X and T to solve.  Pressing (Solve) will give the following results:

X = 0 and T = 0.  Well, that went well.  We have an obvious answer.  What we are looking for is the distance traveled after the projectile has been shot.  Fortunately, the HP Solve app allows us to provide initial guesses. 

Let’s put an initial guess of T = 100 and press (Solve) again.  We now get the following results:

X = 123.017492971
T = 4.58822662969

The projectile will travel approximately 123 m in the x direction and it will take slightly after four and half seconds before impact.



Example 2:  Determining initial velocity (V) and angle (θ)

Given the following data:

X = 125.15 m
Y = 3.10896 m
T = 5 s
G = 9.80665 m/s^2 (SI units are used)

The projectile landed on a hill 125.15 m away with an elevation 3.10896 m (10.2 ft) higher than the starting point. 

You can clear the data variables with [Shift] [Esc].  Since you are solving for V and θ this time, make sure only those variables are checked.

Select θ, give it an initial value of 0, and press (Solve). 

The results are:

θ = 45.1238194711
V = 35.474510698




Example 3:  Hitting a Moving Target

Find the required initial velocity (V) to land a projectile on a wagon moving at rate of 7.33 ft/s.  The wagon is 5.5 ft high.  The wagon is 20 ft away when the projectile is shot.  Assume the projectile is shot at 30°. 
  
The first step is to modify equation E1.  Since the X distance contains a moving object, adjust the left side to 20 + 10*T.   20 for the initial distance plus 10*T for the moving wagon. 

The equations will be set as such:

E1:   20+10*T = V*COS(θ)*T
E2:   Y = V*SIN(θ)*T – 0.5*G*T^2

Next enter the following variables:

θ = 30
Y = 5.5 (height of the wagon)
G = 32.174 (we are using US units)

Note that there only five variables this time.  Select V and T to solve for.  We want T selected because we don’t know what T is. 

Select T and enter 1 as an initial guess (actually, we really want a small positive number should do it, as long as T is not zero).  . 

We get a solution of:

T = 0.818269246898
V = 39.7700027103

This means we should fire the projectile at about 39.77 ft/s and it will land on the wagon. 




Example 4:  The Maximum Height of a Projectile

What is the maximum height of a projectile found for a projectile shot at 36° at 54 ft/s?  How far (horizontal distance) does the projectile would have traveled to get that point?

For this problem, we are going to use three equations but they will be solved separately.  Set the equations as such:

E1:  X = V*COS(θ)*T
E2:  Y = V*SIN(θ)*T – 0.5*G*T^2
E3:  0 = V*SIN(θ) – G*T

The projectile reaches its height when the rate of the change in the y direction is 0.  In calculus terms, when Y’(T) = 0 where Y’(T) = dY/dT = V*SIN(θ) – G*T.

On the Symb screen, select only E3.  Press [Num] and enter the variables:

V = 54
θ = 36
G = 32.174 (ft/s^2)

Solve for T.  The result is: T = 0.76305137487.

It takes the projectile about 0.7630 seconds for the projectile to reach its height.

The next step is press [Symb] and select the equations E1 and E2.  Now press [Num], select X and Y to solve for and press (Solve). 

The solution is:

X = 43.0981662447
Y = 15.6563253279

The distance is about 43.0982 ft and the height is 15.6563 ft.




Eddie


All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Monday, January 2, 2012

Setting up Equations for Integration/Solve - HP 15C

Setting up equations for the integration and solve functions for the HP 15C. Since the release of the HP 15C Limited Edition, the processing speed has increased.

The most important thing to remember is that the equation starts with "x" on the x-register of the stack.

With integration, "x" is the variable to be integrated.

With the solve function, "x" is the variable to be solved for.

Depending on the equation, in general, you will need to duplicate "x" with [ENTER] as many times as "x" appears in the equation. Algebraic manipulation of the equation can be helpful. A technique known as Horner's Method can be used for polynomials. It also helps to handle the innermost expressions first, working outside.

I often straw a stack diagram:

ST X, ST Y, ST Z, ST T

Several things to remember:

Most two-argument functions (arithmetic, power, combination, permutation, etc):

ST T retains what was in ST T
ST Z copies the contents of ST T
ST Y the contents of ST Z moves here
ST X result of the function

Pressing ENTER, recalling from a memory register, or entering π

ST T the contents of ST Z moves here
ST Z the contents of ST Y moves here
ST Y the contents of ST X moves here
ST X the number just entered or recalled


Horner's Method

Let the polynomial p(x) = a_n * x^n + a_n-1 * x^(n-1) + ... + a1 * x + a0

Applying Horner's Method to p(x):

( ... (a_n * x + a_n-1) * x + a_n-2) * x + a_n-3) ... + a1 ) * x + a0

Functions

Integration: [ f ] [ x ] label

Solve: [ f ] [ ÷ ] label


This blog provides examples of integration, but ideas can be taken from the examples for use in solving equations.


Examples are in the format of:

b
∫ f(x) dx
a

All results shown here are rounded to 4 decimal places (FIX 4).

Example 1:

5
∫ x^2 * cos x dx
1




KEY ST X ST Y ST Z ST T
LBL 1 x - - -
ENTER x x - -
COS cos(x) x - -
x<>y x cos(x) - -
x^2 x^2 cos(x) - -
× f(x) - - -


Result: -19.4578


Example 2:

π
∫ x sin((π * x)/4) dx
0



KEY ST X ST Y ST Z ST T
LBL 2 x - - -
ENTER x x - -
π π x x -
× π*x x - -
4 4 π*x x -
÷ (π*x)/4 x - -
SIN sin(π*x/4) x - -
× f(x) - - -
RTN


Result: 4.1369


Example 3

3.5
∫ x / (x^2 + 3x - 4 ) dx =
3

3.5
∫ x / ((x + 3) *x - 4) dx
3



KEY ST X ST Y ST Z ST T
LBL 5 x - - -
ENTER x x - -
ENTER x x x -
3 3 x x x
+ x+3 x x x
× x(x+3) x x x
4 4 x(x+3) x x
- x(x+3)-4 x x x
1/x 1/... x x x
× f(x) x x x
RTN


Result: 0.0998


Example 4:

3
∫ √(x^3 - 2x + 1)/x dx
1



Let ø = √(x^3 -2x+1)


KEY ST X ST Y ST Z ST T
LBL 3 x - - -
ENTER x x - -
ENTER x x x -
3 3 x x x
y^x x^3 x x x
x<>y x x^3 x x
2 2 x x^3 x
× 2x x^3 x x
- x^3-2x x x x
1 1 x^3-2x x x
+ x^3-2x+1 x x x
√ ø x x x
x<>y x ø x x
÷ f(x) x x x
RTN


Result: 2.0912

Here are a few more examples of integrals. Try and draw the stack diagram for each step.

Example 5:

8.5
∫ x * √(x^2 - 3*x - 4) dx =
4.5

8.5
∫ x * √((x - 3) * x - 4) dx
4.5



LBL 6
ENTER
ENTER
3
-
×
4
-
√
×
RTN


Result: 117.2455

Example 6:
π/4
∫ x * (( sin(x-2) )/(cos x)) dx
0



LBL 7
ENTER
ENTER
2
-
SIN
x<>y
COS
÷
×
RTN


Result: -0.3578


I hope you find this blog helpful. Until next time, Eddie



This blog is property of Edward Shore. © 2012

HP 67 Collection: October 2026

HP 67 Collection: Oct ober 2026 All examples are done in FIX 4. (DSP 4) Earth's Gravity at a Specific Latitude The true ea...