Classpad II Stuff
Author: | Mitch Richling |
Updated: | 2024-03-05 10:57:05 |
Generated: | 2024-03-05 10:57:05 |
Copyright © 2024 Mitch Richling. All rights reserved.
Table of Contents
- 1. Introduction
- 2. Library Functions
- 2.1. CAS Stuff (
mjrLib/mjrCAS
) - 2.2. Physical Constants (
mjrLib/mjrConstants
) - 2.3. Integer Stuff (
mjrLib/mjrIntegers
) - 2.4. Linear Algebra (
mjrLib/mjrLinearAlg
) - 2.5. Misc Math (
mjrLib/mjrMiscMath
) - 2.6. Polynomial Stuff (
mjrLib/mjrPolynomial
) - 2.7. Repeated Measurement (
mjrLib/mjrRepMeas
) - 2.8. Trig Functions (
mjrLib/mjrTrig
) - 2.9. Units Functions (
mjrLib/mjrUnits
)
- 2.1. CAS Stuff (
- 3. Programs (
mjrProg/
) - 4. Computational eActivities (
mjrComp/
) - 5. Formulas & Equations eActivities (
mjrEqn/
) - 6. Shift Key Assignments
1. Introduction
Just some stuff I've written for the Casio Classpad II calculator.
All of the programs mentioned here may be found on github: https://github.com/richmit/classpad2
2. Library Functions
Functions intended to be placed in the Library
folder. The functions are contained inside eActivities so that one may pick and choose which functions they
wish to have defined – simply open the function strip, and evaluate the lines with the functions desired.
2.1. CAS Stuff (mjrLib/mjrCAS
)
Just a couple simple algebraic manipulation short cuts.
tbmxs
: Multiply top & bottom of a fraction by a factor. The top & bottom are then separately expanded and simplified twice.xxs
: Expand, Expand, Simplify
2.2. Physical Constants (mjrLib/mjrConstants
)
All physical constants functions take the number of significant digits requested. A \(0\) means to return all available digits. All of these are from the 2018
NIST standard values. Note many constants are defined in Casio's Physium
application – I just like to have these available in the keyboard function
catalog because I use them quite frequently.
Note: These all start with c_
so they show up clumped together in the keyboard function catalog.
c_c0
: Speed of light (299792458)c_g
: Standard acceleration of gravity (9.80665)c_G
: Newtonian constant of gravitation (6.67430e-11)c_atm
: Standard atmospheric pressure (101325)c_avogadro
: Avogadro constant (6.02214076e23)
2.3. Integer Stuff (mjrLib/mjrIntegers
)
Most of these functions accept & return non-negative integers. The idea is to be able to perform bit manipulation operations on regular integers. We can
provide binary-like input and output from these functions with the bitI
and bitO
functions. It's no HP-16C, but it will work in a pinch.
- General Integer Stuff
oddp
: 1 if odd, 0 if evenevenp
: 1 if even, 0 if odd
- Interpreting decimal integers as binary and vice versa
bitI
: dec interpreted as binbitO
: bin interpreted as dec
- Bit Shifting
bitSR
: Shift right 1 bitbitSRn
: Shift right n bitsbitSL
: Shift left 1 bitbitSLn
: Shift left n bits
- Bit Counting
intLog2
: int of base 2 logbitSIZE
: bits requiredbitCNT
: Number of set bitsbitCLZ
: Number of left zeros
- Binary Bitwise logical operations on fixed sized integers
bitANDn
: N bit, bitwise andbitXORn
: N bit, bitwise xorbitORn
: N bit, bitwise or
- Binary Bitwise logical operations
bitAND
: bitwise andbitXOR
: bitwise xorbitOR
: bitwise or
- Bitwise logical negation (this function only exists in a fixed sized form)
bitNOTn
: N bit, bitwise not
- Lists of Bits (utility functions used behind the scenes)
bitLIST
: Reverse list of bitsbitLISTn
: Reverse list N bitsbitULIST
: Bit list to number
2.4. Linear Algebra (mjrLib/mjrLinearAlg
)
diagR
: Diagonal for matrix (Matrix need not be square)dprod
: Product of diagonal (Matrix need not be square)dsum
: Diagonal Sum or trace (Matrix need not be square)slvSys
: Solve matrix equationaugRREF
: Augment to matrices together and RREFinvLeft
: Left inverseinvRight
: Right inverseLU2P
: Return the value of \(P\) given \(M\), \(L\), & \(U\)cPolyS
: Characteristic polynomial via symbolic derivativecPolyN
: Characteristic polynomial via polynomial interpolation
2.5. Misc Math (mjrLib/mjrMiscMath
)
pt2ln
: eq of line given 2 points (points provided as row vectors)pt2ray
: eq of ray given 2 points (points provided as row vectors)
2.6. Polynomial Stuff (mjrLib/mjrPolynomial
)
rt2ply
: poly with given rootsrt2plym
: like rt2ply but monicslvPly
: solve poly numericallycompMtrx
: Companion matrix
2.7. Repeated Measurement (mjrLib/mjrRepMeas
)
I have a much more sophsticated solution for the HP-42S calculator: https://richmit.github.io/hp42/meas.html
- Mean & Standard Deviation
repMesNS
: Meas Stats (μ & σ)repMesNI
: Meas Interval (μ±σ)
- Median & Interquartile Range
repMesMS
: Meas StatsrepMesMI
: Meas Interval
2.8. Trig Functions (mjrLib/mjrTrig
)
csc
: cosecantsec
: secantcot
: cotangenthavers
: haversine: \(\frac{1-\cos(x)}{2}\)cis
: Cosine-I-Sine: \(\cos(x)+i\cdot\sin(x)\)
2.9. Units Functions (mjrLib/mjrUnits
)
Note: These all start with u_
so they show up clumped together in
the keyboard function catalog.
- Units (volume)
u_gal_L
: US Gallons to liters (A US gallon is about 0.83267 Imperial gallon)u_L_gal
: liters to US Gallons
- Units (force)
u_lb_kgf
: US Pounds to kg forceu_kgf_lb
: kg force to US poundsu_N_lb
: Newtons to US poundsu_lb_N
: US Pounds to newtons
- Units (temp)
u_F_C
: Degrees Fahrenheit to Celsiusu_C_F
: Degrees Celsius to Fahrenheitu_K_C
: Degrees Kelvin to Celsiusu_C_K
: Degrees Celsius to Kelvin
- Units (length)
u_in_cm
: International inches to centimeters (2.54 inches to the centimeter)u_cm_in
: Centimeters to international inchesu_mi_km
: International miles to kilometersu_km_mi
: kilometers to international miles
3. Programs (mjrProg/
)
jacobian
: Compute the Jacobin matrix of an expressionmkDmat
: Make a diagonal matrix from a list, matrix, or vector of elementsmkMat
: Make a matrix from an index expressionnewtonC
: Solve complex equations with Newton's method
4. Computational eActivities (mjrComp/
)
These are eActivities I saved off because they contain a general computational pattern I can reuse.
FunCrt1D
: Find the critical points of an expression in 1 variableFunCrt2D
: Find the critical points of an expression in 2 variablesCubicInterp
: Cubic Interpolation between two pointsLinearInterp
: Linear Interpolation between two pointsSolveTri
: Solve triangles. I add cases as I encounter them, and so far I have ASA, SSS, SAS, & AAS.DiodeModel
: Compute SPICE model parameters from bench measurements
5. Formulas & Equations eActivities (mjrEqn/
)
These eActivities provide a reference & computational environments for various formulas & equations.
Diode
: Shockley Diode equationCurrentDiv
: Current DividerVoltageDiv
: Voltage Divider
6. Shift Key Assignments
approx = |
cut \(x\) |
paste \(y\) |
undo \(z\) |
\(\sqrt{\square}\) ^ |
\(\frac{\square}{\square}\) \(\div\) |
[] ( |
\(7\) |
\(8\) |
\(9\) |
\(\times\) |
{} ) |
\(e^\square\) \(4\) |
\(\ln\) \(5\) |
\(\log_\square(\square)\) \(6\) |
\(-\) |
\(\vert\) , |
\(\sin\) \(1\) |
\(\cos\) \(2\) |
\(\tan\) \(3\) |
\(\circ\) \(+\) |
\(\Rightarrow\) (-) |
\(\pi\) \(0\) |
\(i\) . |
\(\angle(\) EXP |
ans EXE |