Post Reply 
(42S, Free42, DM42) Functions: dates, taylor, series, derivatives, units, constants..
02-02-2021, 10:45 PM (This post was last modified: 02-03-2021 11:29 AM by ferni123.)
Post: #1
(42S, Free42, DM42) Functions: dates, taylor, series, derivatives, units, constants..
I have published in Gitlab a collection of functions organised by topics in: https://gitlab.com/fmartinp/programs42

These functions are an exercise to explore the capabilities of Free42. Notice that the code uses functionalities available in Free42 v2.5.24.

The main idea of this collection is to make use of the CUSTOM menu as much as possible in the same way that it can be done in HP48G. The summary of the functions are (the details of input/output of each function is embedded in the source code):

MAIN program
Main menu of the Application suite. It can always be called using XEQ 99

MATH program
Menu for some math functions. So far, the purpose of this function is to
create a CUSTOM menu with the top row shifted funcions.
The menu adds a the LGyX function to compute base-y logarithm.

HYP program
Menu to hype trigonometric functions.

DATES program
Collection of date related functions accessible through a CUSTOM menu.
List of functions:

DDAYS (Free42 builtin function): Compute number of days between 2 dates
DATE+ Free42 builtin function): Compute the addition of a date and number of days
D→DOY: Convert a date into the day of the year
DOY→D: Convert a day of the year into a date
D→YWD: Convert a date into a year, ISO week and day of the week
YWD→D: Convert a year, ISO week and day of the week in a date
UTIME: Compute current UNIX time (based on Thomas Okken's program: https://thomasokken.com/free42/42progs/unixtime.txt)
T→U: Convert a date into UNIX time (based on Thomas Okken's program: https://thomasokken.com/free42/42progs/unixtime.txt)
U→T: Convert a UNIX time into a date (based on Thomas Okken's program: https://thomasokken.com/free42/42progs/unixtime.txt)
GTIME: Compute current GPS time
T→G: Convert a date into GPS time (GPS week and seconds of the week)
G→T: Conver GPS time (GPS week and seconds of the week) into a date
SDATE: Compute current ESA Solar Orbiter mission planning cycle
D→STP: Convert a date into a ESA Solar Orbiter mission planning cycle
STP→D: Convert a ESA Solar Orbiter mission planning cycle into a date

Note: The convention of days of the week is 1-Monday, 2-Tuesday, 3-Wednesday, 4-Thursday, 5-Friday, 6-Saturday, 0-Sunday

CALC program

Collection of calculus related functions accessible through a CUSTOM menu.
List of functions:
DERIV: Compute the derivative of order-X of a MVAR function
TAYLR: Compute the taylor expansion coefficient of order-X of a MVAR function
SUM1: Compute the sum of a serie specified by MVAR function
SUMN: Compute the sum of a serie specified by MVAR function (defining the step)
DERIN: Compute the derivative of order-X with accuracy-Y of a MVAR function

UNIT converter program
Collection of unit conversion functions accessible through a CUSTOM menu.
List of functions and units:

LENG: meter, inch, yard, mile, nautic mile
AREA: square meter, square foot, acre, hectometer, square kilometer, square mile
MASS: kilogram, dram, onze, pound, stone, carat
VOL: liter, fluid onze, gill, pint, quart, gallon
SPEED: m/s, km/h, mph, knot, ft/s, in/s
TEMP: Celsius, Kelvin and Farenheit degrees
Time: second, minute, hour, day, sideral day, week
ENGY: Joule, Calorie, Watt per hour, eV
PWER: Watt, Electrical (E), Mechanical (I) and Metric (M) horsepower
Usage:
Select the unit applicable for the X-register and afterwards select the conversion unit.
If no new X-register is introduced with the keyboard, the current value in X-register
as it has already assigned a unit, it can be converted to a new unit just pressing the
unit name in the soft menu

CPX program
Menu to some complex functions. So far, the purpose of this function is to
create a CUSTOM menu with some commons complex funcions.
The program adds the following functions:

CONJ: Computes the conjugate of a complex number
R<>P: Swaps between rectangular and polar modes

CONSTANT Library program
Constant Libray implemented through a programmable menu.

DEBUG program
Menu for some debugging functions following Thomas Okken recommendation at:
https://thomasokken.com/free42/
Find all posts by this user
Quote this message in a reply
03-11-2021, 07:39 AM
Post: #2
RE: (42S, Free42, DM42) Functions: dates, taylor, series, derivatives, units, constants..
Thank you for this application suite!

In the Unit Converter Program there is a small mistake.

In LBL "Time" it should be

...
86400
"d"
XEQ C
...

instead of
...
24
"d"
XEQ C
...

Cheers!
Find all posts by this user
Quote this message in a reply
04-05-2021, 11:04 PM
Post: #3
RE: (42S, Free42, DM42) Functions: dates, taylor, series, derivatives, units, constants..
Thank you for the bug notification. Apologies for the late reply, I have not looked in this section for a while.

Fortunately, another person also reported me about the issue and it has been already fixed in gitlab a few days ago.

I hope you find useful the tools. For any suggestion, do not hesitate to let me know.

Regards.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)