UP | HOME

Classpad II Stuff

Author: Mitch Richling
Updated: 2024-03-04 13:37:09
Generated: 2024-03-04 17:49:49

Copyright © 2024 Mitch Richling. All rights reserved.

Table of Contents

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 even
    • evenp: 1 if even, 0 if odd
  • Interpreting decimal integers as binary and vice versa
    • bitI: dec interpreted as bin
    • bitO: bin interpreted as dec
  • Bit Shifting
    • bitSR: Shift right 1 bit
    • bitSRn: Shift right n bits
    • bitSL: Shift left 1 bit
    • bitSLn: Shift left n bits
  • Bit Counting
    • intLog2: int of base 2 log
    • bitSIZE: bits required
    • bitCNT: Number of set bits
    • bitCLZ: Number of left zeros
  • Binary Bitwise logical operations on fixed sized integers
    • bitANDn: N bit, bitwise and
    • bitXORn: N bit, bitwise xor
    • bitORn: N bit, bitwise or
  • Binary Bitwise logical operations
    • bitAND: bitwise and
    • bitXOR: bitwise xor
    • bitOR: 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 bits
    • bitLISTn: Reverse list N bits
    • bitULIST: 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 equation
  • augRREF: Augment to matrices together and RREF
  • invLeft: Left inverse
  • invRight: Right inverse
  • LU2P: Return the value of \(P\) given \(M\), \(L\), & \(U\)
  • cPolyS: Characteristic polynomial via symbolic derivative
  • cPolyN: 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 roots
  • rt2plym: like rt2ply but monic
  • slvPly: solve poly numerically
  • compMtrx: 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 Stats
    • repMesMI: Meas Interval

2.8. Trig Functions (mjrLib/mjrTrig)

  • csc: cosecant
  • sec: secant
  • cot: cotangent
  • havers: 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 force
    • u_kgf_lb: kg force to US pounds
    • u_N_lb: Newtons to US pounds
    • u_lb_N: US Pounds to newtons
  • Units (temp)
    • u_F_C: Degrees Fahrenheit to Celsius
    • u_C_F: Degrees Celsius to Fahrenheit
    • u_K_C: Degrees Kelvin to Celsius
    • u_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 inches
    • u_mi_km: International miles to kilometers
    • u_km_mi: kilometers to international miles

3. Programs (mjrProg/)

  • jacobian: Compute the Jacobin matrix of an expression
  • mkDmat: Make a diagonal matrix from a list, matrix, or vector of elements
  • mkMat: Make a matrix from an index expression
  • newtonC: 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 variable
  • FunCrt2D: Find the critical points of an expression in 2 variables
  • CubicInterp: Cubic Interpolation between two points
  • LinearInterp: Linear Interpolation between two points
  • SolveTri: 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 equation
  • CurrentDiv: Current Divider
  • VoltageDiv: Voltage Divider