i41CX+ CAS Tutorial

 

This tutorial assumes that you aren't familiar with the HP-41.  If you're familiar with the HP-41 then you can breeze through the non-CAS specific steps ;-).  Note that this will look far more complicated than it is in practice because it is designed to demonstrate some of the other capabilities of i41CX+ rather than just how to run CAS.

 

First of all, let's set up your i41CX+ environment to ensure that the results on your device match those in this tutorial.

 

Configure i41CX+ Settings

 

1.    Open the app’s Settings (accessible on the back view of the calculator on iPhone/iPod touch devices and also from the menu bar on iPad devices).

2.    Scroll down to the "Text Editor and CAS" settings group.

3.    Set "{ } Handling" right above the settings group (the last item in the "Calculator settings group) to "Use { }".

4.    Set "Keyboard Configuration" to "Numerical <=> System <=> Macro".

5.    Set "Default Keyboard" to "System".

6.    Set "Lowercase" to ON.

7.    Set "Create Fancy Output" to OFF.

8.    Set "Overwrite Plots" to ON.

9.    Set "Auto Show Plots" to ON.

 

Configure i41CX+ to use the system keyboard for alphanumeric entry

 

1.    Tap the "overlay clip" button that is located between the USER and PRGM key and with the "i41CX+" logo on it.

2.    Select the “A” that looks like the system keyboard’s “A” key for “ALPHA Entry”.  This will enable the use of the system keyboard for alphanumeric entry which will probably be more convenient than using the calculator keypad.  Tap the "Done" button or the overlay clip button again to dismiss the configuration panel.

 

Load the I41CX-MATH module (CAS is a function in the I41CX-MATH module)

 

1.  Access the back view of the calculator on iPhone/iPod touch devices.  Tap the top of the screen on iPad devices to reveal the menu bar.

2.  Tap one of the four module ports at the top.

3.  Point the picker to the "I41CX-MATH" item and tap the "Select" button to load it.

4.  Tap the "Done" button to dismiss the picker or tap outside of the picker on iPad devices.

5.  Tap the "U-Turn" button between the module ports to return to the front of the calculator on iPhone/iPod touch devices.

 

Run a simple interactive CAS session

 

1.    Tap [ALPHA].  This will show the Alpha register.  Note that the system keyboard will automatically pop up for alphanumeric entry.

2.    Type the following without the quotes: "CASIN,," (lowercase on the system keyboard gets automatically mapped to upper case in the calculator so there is no need to use CAPS lock or the shift key on the system keyboard).  We are specifying a CAS input file called CASIN, no output file, and interactive mode.

3.    Tap [ALPHA] to exit from the Alpha register screen.

4.    Tap the following key sequence: [XEQ] [ALPHA] CAS [ALPHA].  This will open the "I41CXED" full-screen text editor with the specified file (CASIN, in this case) for editing with CAS running in interactive mode (notice the "CAS Ready" indicator near the top left).

5.    Tap anywhere inside the empty text area to reveal the system keyboard.

6.    Type the following and tap the return key after the ";".

   

         df(x^x,x);

 

As you can see, this calculated the derivative of the function "x^x" with respect to "x".

 

The important thing to note is that while running interactively, tapping return sends the text of the current line up until the character before you pressed return to the CAS engine. In effect, the text view thus behaves like a command line terminal window.

 

If you wish to create a new line without sending a command to CAS, do the following. Perform a swipe left gesture to reveal the macro keyboard and tap the "New Line" button that has been pre-programmed with the special "\r" macro that will insert a new line "silently" without invoking CAS execution.

 

Now, type the following and again tap the return key after the ";".

 

plot(sin(x), title="sin(x)", output="Sine Plot");

 

To return to the CAS "terminal", tap the button at the top left of the navigation bar.

 

7.    Tap "Done" to save the file and terminate the interactive CAS session.

 

An alternative way to run an interactive CAS session is to use the special #CAS# macro as follows.

 

Starting an interactive CAS session within I41CXED

 

1.    Enter "CASIN2" into the Alpha register.

2.    Tap the following key sequence: [XEQ] [ALPHA] I41CXED [ALPHA].  This will now open CASIN2 with the full-screen text editor.  Note that CAS is not running (there is no "CAS Ready/Busy" status at the top left).

3.    Tap the text area to reveal the keyboard.

4.    Now, type the same CAS commands that you did earlier:

 

          df(x^x,x);

         plot(sin(x), title="sin(x)", output="Sine Plot");

 

5.    Swipe left to reveal the macro keyboard.

6.    Tap the "CAS" button.  This will initiate an interactive CAS session.  Notice the CAS indicator at the top left.  Once it shows "CAS Ready", you are in an interactive CAS session just like the one initiated earlier using the CAS function.  You could now either place the cursor to the right of the semicolon of either of the two commands that you typed and tap return to execute them but I'll show you how you can also process the entire contents of the file.

7.    Tap the "CAS" button again.  Tapping the CAS button while a CAS session is active, sends the entire contents of the file to the CAS engine.  After a second or so, you will see the results appended to the end of the file.

8.    Tap "Done" to save the file and terminate the interactive CAS session.

 

In addition to these interactive modes, it is possible to run CAS in batch mode.

 

Run CAS In Batch Mode

 

1.    Tap [ALPHA].

2.    Type the following without the quotes: "CASIN3,CASOUT".  We will now specifying a CAS input file called CASIN3 and an output file called CASOUT.

3.    Tap [ALPHA] to exit from the Alpha register screen.

4.    Use I41CXED to enter CAS commands in CASIN3.

 

Tap the following key sequence: [XEQ] [ALPHA] CAS [ALPHA].  This will run the CAS function. Recall that the Alpha register contains "CASIN3,CASOUT" so CAS will use CASIN3 as the input file and generate its output in CASOUT.  You'll see a "flying goose" animation indicating that CAS is executing.

 

View the CAS output

 

1.    Tap [ALPHA] and type "CASOUT" without the quotes to specify the CAS output file.

2.    Execute I41CXED ([XEQ] [ALPHA] I41CXED [ALPHA]) to view the output.

3.    You will see "x^x * (log(x)+1)" as expected.

4.    Tap the "Plots" button to reveal the plot picker.  There should be an item called "Sine Plot" just like before.

5.    Tap the "View" button to view the plot.

6.    Tap "Done" to exit from I41CXED.

 

Now, because i41CX+ is a programmable calculator, the above process can be simplified by making use of key assignments and a simple RPN program that automates the process of editing the CAS input, running CAS, and viewing the CAS output.  This tutorial will show you how to do that next.  This should give you a tiny glimpse of the power and versatility of the HP-41 (and hence i41CX+).

 

First of all, let's assign the I41CXED function to the Sigma+ key (the key right below ON): [SHIFT] [XEQ] [ALPHA] I41CXED [ALPHA] [Sigma+].  Hereafter, whenever you press the [Sigma+] key in USER mode (toggled via the [USER] key), the calculator will execute I41CXED.  This will save you a lot of keystrokes.  The Sigma+ function can still be used when USER mode is off.  If you want to de-assign a previously assigned function, just assign an "empty function" to the key: [SHIFT] [XEQ] [ALPHA] [ALPHA] [Sigma+] in this example.

 

We will now show you how to import the DOCAS program which automates all of the above steps of running CAS in batch mode.  The DOCAS program is included in the i41CX+ "Usage & Examples" table on the back view of the calculator and it is also available at the below URL.

 

http://alsoftiphone.com/i41CXplus/faq/#CAS5.

 

We suggest that you take a look at the listing in the FAQ entry as it is commented.  Don't worry, it's not long.  It's only 11 program steps.  To import the DOCAS program into the calculator memory, please use one of the following methods.

 

Import it from the "Usage & Examples" table

 

1.    Navigate to the "Usage & Examples" table on the back view of the calculator (see the following URL for how to navigate to it: http://alsoftiphone.com/i41CXplus/faq/#G8).

2.    Tap the "magnifying glass" icon on the upper left of the "Usage & Examples" table, type DOCAS and then tap "Search".

3.    Double tap the DOCAS cell and tap "Copy".

4.    Tap the "magnifying glass" icon to dismiss the table search view.

5.    Tap the "Load Data" button and make sure the right wheel is pointing to the top item (PROG with white letters; the one with blue letters at the bottom is to load programs into extended memory) and the left wheel is pointing to the "Import from clipboard..." item.

6.    Tap the "Select" button, enter DOCAS, and tap "Save".

7.    Now the left wheel should be pointing at the DOCAS file that you just saved on the device's flash memory.

8.    Tap "Select" to load it into the calculator's memory.

 

Import it from the i41CX+ FAQ's CAS6 entry

 

1.    Open http://alsoftiphone.com/i41CXplus/faq/#CAS6 on your device's mobile Safari.

2.    Tap the "import into i41CX+" icon at the bottom of the entry.  This will launch i41CX+ and you will be prompted whether to import the program, so accept.

3.    Access the back view of the calculator.

4.    Tap the "Load Data" button, and make sure the right wheel is pointing to the top item (PROG) and scroll the right wheel to the DOCAS program that you just imported.

5.    Tap "Select" to load it into the calculator's memory.

 

Import it using iTunes File Sharing

 

1.    Create a text file with the DOCAS program listing and make sure to name the file with a .TXT extension.

2.    Add the file to the i41CX+ base directory in iTunes.

3.    Sync your device.

4.    Launch i41CX+ and access the back view of the calculator.

5.    Tap the "Load Data" button, and make sure the right wheel is pointing to the top item (PROG) and scroll the right wheel to the DOCAS program that you just imported.

6.    Tap "Select" to load it into the calculator's memory.

 

Once you've loaded the DOCAS program into the calculator's memory, you can run it with the key sequence [XEQ] [ALPHA] DOCAS [ALPHA].  Go ahead and try it now.  Programs like DOCAS can also be assigned to USER mode keys in exactly the same way as built-in functions as shown earlier.  One configuration that seems to work well for many users is to assign I41CXED to Sigma+ and assign DOCAS to Sigma- (i.e. [SHIFT] [XEQ] [ALPHA] DOCAS [ALPHA] [SHIFT] [Sigma+]).  This allows you to view files with one tap and run DOCAS with two taps.

 

If you're not familiar with the HP-41CX, we recommend that you read the HP-41CX User Manual.  i41CX+ is based on the HP-41CX.  Therefore, it is crucial to understand how it works and operates in order to make full use of i41CX+.  For example, tapping [ALPHA] to view/edit the Alpha register, using [XEQ] to execute functions not listed on the keyboard (and hence execute I41CXED and CAS), using modules, etc. are basic HP-41CX operations that are described in detail with many examples in the HP-41CX User Manual.  You'll find links to the HP-41CX manual at the following URL.

 

http://alsoftiphone.com/i41CXplus/faq/#G2

 

The HP-41CX manual is ~400 pages long so we certainly wouldn't recommend to read it all at once unless you are ready for a nap but it would be a good idea to browse through it and at least go through Sections 1-5 in detail. To use the virtual thermal printer, please see the HP82143 printer manual.  You'll find links to the printer manual in the same FAQ item.

 

You might also want to check out the i41CX+ Mini-Manual which, among other things, includes links to the documentation for REDUCE (the i41CX+ CAS engine is based on it) and many CAS/i41CXED tips and tricks at the below URL:

 

http://alsoftiphone.com/i41CXplus/i41CXplus_MiniManual.pdf

 

To find out more details about CAS, please see the REDUCE user's manual at the below URL.

 

http://reduce-algebra.com/docs/reduce.pdf

 

There are some CAS examples for various areas/disciplines at the below URL.

 

http://alsoftiphone.com/i41CXplus/faq/SampleCASFiles/

 

Last but not least, you will find documentation for the vast majority of REDUCE packages that are included in i41CX+ at the following URL.

 

http://reduce-algebra.com/documentation.htm

 

We hope this tutorial helps.  Please send us an email if any of this is unclear or if you have any questions.