Tutorial

If you haven't yet read the "What the heck?" introduction, then please do so before proceeding.

Example 1

Imagine you are an American tourist flying to Europe. Aboard an airplane, you are reading a tourist guide about the country of your destination. In it, you learn of the local average temperatures at this time of the year: 11 degrees Celsius at night, 13 in the morning, 25 at noon, and 18 in the evening. You are scratching your head: how much is it in degrees Fahrenheit? Darn, there is no access to the Internet on this plane. Fortunately, you have your iPhone with this nice app installed. And, before your flight, you were smart enough to program in this conversion formula:

F = (9/5) * C + 32

Here is how you did it: First, you decided that Calculator's variable "x" will represent temperature in degrees Celsius, then you hit the following sequence of keys (EN = Enter):

9 EN 5 / x * 32 +

so that the display looked like this:

(9/5)*x+32

Next, you did hit the "Save" button, which led you to the description page:

In the text view below edit description for (9/5)*x+32

But that was then. Now, back on the airplane, you hit the "Load" button, which opens the list of your saved formulas:

Table of formulas image

You hit the row "f3" to load your C to F converter into Calculator, then you start the Calculator's RUN mode by touching the "Run" button. This opens an inviting text area into which you type the first Celsius temperature, 11, confirmed by the "Enter" button:

Enter variable values using the keypad x=11 Result=51.8

So, 11 degrees C is equivalent to 51.8 degrees F; good. You hit the "Clear" button to prepare the RUN mode for a new entry: 13 C is 55.4 F. You repeat this with the remaining numbers always using "Clear" to refresh and confirming with "Enter": 25 C is 77 F, 18 C is 64.4 F. First hit of the "C" button ends the RUN mode, while second hit clears the formula.

Ahhh. You sit back relaxed and reflect: "If I used any other calculator, I would have to type the entire formula for each new temperature. I am so lucky to have this app!"

;)

Example 2

Imagine you and your wife (or husband) are buying a new home. The theme of the day is: "How much will be the monthly mortgage payments?". Fortunately, you have your trusty iPhone with this nice app installed. A week ago you were reading Wikipedia pages about mortgages, interest rates, etc., and stumbled upon the following formula:

P =

u*v/1200

—————————————————

1 − e(-12*w*ln(1+v/1200))

    • u = Principal amount of loan
    • v = Annual percentage rate in %
    • w = Term in years
    • P = Monthly payment

To program this formula, you entered the following sequence:

u EN v * 1200 / 1 EN 12 +/- EN w * 1 EN v EN 1200 / + 2nd ln * 2nd e^x - /

Afterwards, you did hit "Save" and typed in an appropriate description for future reference:

In the text view below edit description for f2 = u*v/1200/(1-e^((-w)*12*ln(1+v/1200)))

Back in the present, you hit "Load" and get the list of your saved formulas, as displayed in the previous Example. Touching row "f2" loads the formula into Calculator; hitting "Run" turns on the RUN mode. You type an offer from the first mortgage company:

    • u = 250000 (nice house!)
    • v = 3.1 (annual rate in %)
    • w = 30 (number of years)
Enter variable values using the keypad u=250000 v=3.1 w=30 Result=1067.54099726173

Wait, you want to e-mail this result (and others) to your wife (or husband). You hit the "Copy" button to save the first run into the iPhone's clipboard, then "Clear" to prepare for the next input. And the next bank offers this (you notice that variable values from the previous run are remembered):

    • u = 250000
    • v = 3.25
    • w = 25

Then you "Copy" this second result and enter the third offer, also followed by "Copy":

    • u = 250000
    • v = 3.25
    • w = 20

Next, you switch to iPhone's e-mail, start a new letter, paste the table, and are ready to play a superhero in the eyes of your significant other:

Honey, I've figured out these monthly payments in just 2 minutes: u*v/1200/(1-e^((-12)*w*ln(1+v/1200))) u v w Result 250000 3.1 30 1067.54 250000 3.25 25 1218.29 250000 3.25 20 1417.98

You are almost ready to do other things, when curiosity takes over: "Interesting. What if the interest rate stayed the same at 3.1% and only the period changed from 20 to 30 years? How would the payments look like?" Well, that's what the graphing feature is for. You go back to Calculator, hit the "C" button once to exit the RUN mode - the formula still stays on the screen. You hit the "Graph" button which opens GRAPH mode asking you about input parameters:

Enter range for the horizontal axis Min=20 Max=30 Enter zero point u=250000 v=3.1 w=0 Enter directional vector du=

Most certainly, you remember from reading the "Graph Operations" section that:

    • "Min" and "Max" are just the beginning and end values for the horizontal axis (abscissa) - in this case it will run from 20 to 30 years.
    • "Zero point" let's you set the values of fixed variables ("u" and "v" in this case) and the initial values of changing variables (number of years, "w", in this case).

It is the next three inputs - the "directional vector" - that let you specify which variables are fixed and which variables are supposed to change in plotting the graph. You enter "0" for "du" and "dv" because these should stay fixed at 250000 and 3.1, respectively, and "1" for "dw" because "w" should change along the abscissa:

Enter range for the horizontal axis Min=20 Max=30 Enter zero point u=250000 v=3.1 w=0 Enter directional vector du=0 dv=0 dw=1

The end result is a nice graph of slightly curved dependence between monthly payments and mortgage period when the principal and annual rate stay fixed:

Well, you probably expected such a result: the shorter the mortgage period, the greater the monthly payments. But as a thinking individual you know that monthly payments are not the most important consideration here. There is a much better question to be answered: what will the total money spend out of your pocket over the entire lifetime of the loan? Well, that's easy: just multiply monthly payment by the loan period in months, which is 12w. You hit the "Back" button and see that the original formula is still being displayed. It's quite easy to modify it with the following sequence:

w * 12 *

to get the desired result:

(u*v/1200/(1-e^((-12)*w*ln(1+v/1200))))*w*12

You hit the "Graph" again and notice to your delight that all the previous are remembered, and just step through them with repeated "Enter" button presses. The new graph appears... Aha! That's quite a different story! Tapping the screen once brings up the Tracer point and you move it all the way to the left reading the approximate total expenditure for 20 year loan (335770), then move all the way to the right to realize that for 30 year loan you would pay over 50000 more (384314). So... Even though monthly payments are lowest at 30 years, the difference in overall price is huge... No wonder banks incentivize longer mortgages with lower rates!

You double-tap the screen to hide the Tracer and hit the "Copy" button. "Time to play a real superhero", you think as you paste the graph picture into a new e-mail to your wife (or husband).

Example 3

Imagine you are a student of chemistry interested in acid dissociation in water. Of particular interest to you are acids with two dissociable protons:

H2A ⇔ H+ + HA- ⇔ 2H+ + A2-

How well these two protons stay attached to this acid? Working hard and dutifully, you derived this complex formula for the fraction protonated F (average number of protons over the population of acid molecules as a function of pH):

F =

2*10(pKa1 + pKa2 − 2*pH) + 10(pKa1 − pH)

——————————————————————————————

10(pKa1 + pKa2 − 2*pH) + 10(pKa1 − pH) + 1

Wow, good job. pKa1 and pKa2 are the dissociation constants for the acid with one (HA-) and two (H2A) protons, respectively. How does the plot of F(pH) looks like, huh? Even this complicated thing can be coded into the Calculator. You make these substitutions: u = pKa1, v = pKa2, x = pH:

F =

2*10(u + v − 2*x) + 10(u − x)

—————————————————————

10(u + v − 2*x) + 10(u − x) + 1

Coding it is an easy breeze:

2 EN u EN v + 2 EN x * - 10^x * u EN x - 10^x + u EN v + 2 EN x * - 10^x u EN x - 10^x + 1 + /

You smile at the result:

(2*10^(u+v-2*x)+10^(u-x))/(10^(u+v-2*x)+10^(u-x)+1)

and hit the "Save" button:

(2*10^(u+v-2*x)+10^(u-x))/(10^(u+v-2*x)+10^(u-x)+1)

They say "Curiosity killed a cat", but it also invented a bulb, a car, an airplane, and all the other wonderful things we take for granted. Now curiosity makes you tremble with anticipation: how does my function look like? For an acid with pKa1=7.5 and pKa2=4.88? Time for graphing within the standard 0-14 pH scale, while u and v are kept fixed:

Enter range for the horizontal axis Min=0 Max=14 Enter zero point u=7.5 v=4.88 x=0 Enter directional vector du=
Enter range for the horizontal axis Min=0 Max=14 Enter zero point u=7.5 v=4.88 x=0 Enter directional vector du=0 dv=0 dx=1

And here it is!

So, at pH<3 the acid has 2 protons, at pH>10 it has zero and the interesting things happen in between. You zoom in on that region of pH by placing two fingers along the horizontal axis and spreading them out (and trying until it works). You pan the graph with two fingers until the interesting pH region is centered:

At which pH the acid has one proton? You tap once to wake up the Tracer and move it until the ordinate is approximately 1 - it's about 6.19 (Ahem, what is the average of pKa1 and pKa2?). How many protons, on average, are attached at pH=7? About 0.77. Double tap dismisses the Tracer. You place two fingers diagonally and pinch to zoom out the whole graph, then pan with two fingers again to center, then position two fingers along the vertical axis and spread to zoom in on the F values (definitely, lifting fingers off the screen between these gestures helps):

Now you are interested in the acid behavior at the fixed pH=7. Above, you have just learned that with the given pKa1 and pKa2 there are about 0.77 protons bound at this pH. What if the pKa1 and pKa2 were different? Say, they varied from their present values by ±5, simultaneously? You can see it by fixing x and letting u and v change at the same rate. Here is how:

Enter range for the horizontal axis Min=-5 Max=5 Enter zero point u=7.5 v=4.88 x=7 Enter directional vector du=1 dv=1 dx=0
Enter range for the horizontal axis Min=-5 Max=5 Enter zero point u=7.5 v=4.88 x=7 Enter directional vector du=1 dv=1 dx=0

What if pKa1 changed twice as fast as pKa2? You can see the effect by properly setting the directional vector:

Enter range for the horizontal axis Min=-5 Max=5 Enter zero point u=7.5 v=4.88 x=7 Enter directional vector du=1 dv=0.5 dx=0

What if pKa1 and pKa2 changed in opposite directions (drifted apart) at the same rate? This time the directional vector components should have opposite signs:

Enter range for the horizontal axis Min=0 Max=5 Enter zero point u=7.5 v=4.88 x=7 Enter directional vector du=1 dv=-1 dx=0
Enter range for the horizontal axis Min=0 Max=5 Enter zero point u=7.5 v=4.88 x=7 Enter directional vector du=1 dv=-1 dx=0

Ahem, this graph's vertical axis needs better scaling. You hit the "Set" button and change the minimum Y to 0.75:

X_min=0 X_max=5 Y_min=0.75 Y_max=1

It's much better now. Well, definitely you are getting the hang of it. :)