Free Science Fiction Stories

Free stories from the depths of my imagination

SophistimaCalc Manual

Lite version vs paid version

Update: the Lite version is no longer available for download from 4 November 2009

The Lite version has one limitation.  It will only process a maximum of 10 commands at a time in the input window.  The rest will be ignored and a message “Maximum number of commands reached” will be displayed.  The paid version does not have this limitation and therefore allows more lengthy algorithms.  Also, the free version is not as up to date as the paid version so the paid version has more new features.

Basic Operation

Input/output

The great thing about SophistimaCalc is that it allows you to enter all of your calculations prior to executing them so that you can carefully plan your calculation or write complex algorithms.

On launching SophistimaCalc, you will be presented with the following layout:

SophistimaCalc

Key:

1 – input screen

2- output screen

3- keypad

4- about button

SophistimaCalc consists of two screens and a layout of buttons. The first screen is for calculations that you input. There are two methods of input to make it as easy for you as possible.  You can use the onscreen buttons as you would with a simple calculator:

Keypad input

Keypad input

The above shows the result of inputting ‘2 + 2′ on the keypad.  There is no output yet.  SophistimaCalc will process all calculations entered into the input screen after the “Enter” button is pressed, as follows:

Pressing "Enter"

Pressing "Enter"

The above shows the result in the output window on pressing “Enter”.

However, SophistimaCalc also lets you enter calculations using the iphone’s/ipod’s built in soft keyboard.  This is for your convenience, but more importantly, it gives you access to all of SophistimaCalc’s advanced features, such as the use of commands (see below). In iphone OS 3.0 (yet to be released by Apple), it will also give you access to copy, cut and paste.

To activate the keyboard, all you have to do is touch anywhere on the input screen and the keyboard will appear.  Press the “Done” button when you are finished.

Using the keyboard

Using the keyboard

If the input exceeds the length of input window, you are able to scroll through the window by dragging inside the window:

Scroll the input window

Scroll the input window

The output window can also be scrolled in the same manner.  Easily edit any calculations in the input window that you have already made.  However, no edits can be made in the output window.

From version 1.4, SophistimaCalc has short cuts to save typing.  You can access the short cuts by using the ’shift’ key:

sophistimacalc update

File operations

SophistimaCalc allows you to save the contents of the input window into a file, load the contents of a file into the input window and email the contents of the input window to any email address.  These features mean that your calculations can always be saved for later review and revision or if they contain reusable formulas or algorithms.  The email feature allows others to review your calculations quickly and easily (eg your teacher or boss can review them for errors or if you are stuck).

Due to licence restrictions, you are not able to import other people’s calculations into your iphone/ipod’s SophistimaCalc.

To save, simply press the “Save” button.

Press the "save" or "load" buttons

Press the "save" or "load" buttons

A new window appears for you to enter the file name.

Type in file name and press "Return"

Type in file name and press "Return"

Type the file name and press “return” on the soft keyboard.  If you’ve changed your mind, just press the button in top left hand corner to return to the main screen and nothing will be saved.

To load the contents of a file, delete or email a file, press “Load/Email”.  The load screen will then appear with a list of files that SophistimaCalc has previously saved.  Press a file to highlight it and then press the “Action” button.

Highlight and press "Action"

Highlight and press "Action"

This brings up the following menu:

Select from menu

Select from menu

Press “Delete” to permanently delete the file.  “Load File” loads the contents of the file into the input window and takes you back to the main screen.  “Email file” launches the email program and exits from SophistimaCalc (so make sure you’ve saved any unsaved calculations before doing this).  Once in the email program you will see be able to scroll down to see the contents of the input window.  You then need to change the email address to a valid address and send the email – add a message or a different subject if you like.

Clearing the input and output windows

The design of SophistimaCalc allows for maximum flexibility.  Accordingly, you clear each of the input and output windows individually.  It is also possible to use a command to clear the output window during a calculation (more on this later).

Clear buttons

Clear buttons

“Cb” will automatically clear the output window. However, this may not be desirable for the input window in case you haven’t saved your calculations and you press “Ct” by accident.  Accordingly, on pressing “Ct” the following message will appear allowing you to change your mind:

Clear top message

Clear top message

Stopping a calculation

One of the many advanced features of SophistimaCalc is the ‘Repeat’ command, which is discussed in detail under ‘Commands’ below.  If you use this command you may desire or need to stop a calculation whilst it is being processed.  This is what the “Stop” button is for.  When you press “Stop”, you will see the following:

After "Stop" is pressed

After "Stop" is pressed

Also note that you are not able to save or load/email whilst a calculation is being processed.  Pressing the “Save” and “Load” buttons will bring up the following message:

Load while run

This is to ensure that calculations are not interrupted by accidental presses of these buttons.

Supported calculations

SophistimaCalc supports a wide range of operations:
+, -, *, /, ^ (power), ! (factorial), %, log(x), ln(x), sqrt(x), sqr(x), sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), sinh(x), cosh(x), tanh(x), rnd(x) (random number), abs (x) (absolute value), int(x) (integer)

To allow maximum space between keys on the keypad, some operations are only available using the iphone’s or ipod’s soft keyboard.

The operators that are words (eg rnd, abs etc) are not case sensitive.

Order of precedence

SophistimaCalc is not your ordinary calculator.  It doesn’t just process calculations in the order you enter them.  Instead, it has an advanced feature that processes calculations using the correct order of precedence.

For example, if you type (and then press enter):

4-2*3

The output will be:

-2

and not:

6

This is because the correct order of precedence in the calculation is to perform the multiplication first.  SophistimaCalc respects this proper order of precedence.

Memories

There are 100 separate memories in SophistimaCalc that you can set and manipulate.

Setting memory

Each memory is set with the ‘mem’ command (not case sensitive) using a name (not more than 7 characters) of your choosing.  For example, in the input window, type:

mem time=10
mem dist=20
mem speed=dist/time
speed

The output will be:

2

You will see later that there are even more advanced ways in which to set memories.  For example, you may want to set memories during the course of the calculation instead of having to manually set them in the input window each time.  A more flexible approach is to use the ‘ask’ command or ‘key’ operator (see below under ‘Input’).

You must not use keywords for operators (such as int, rnd, abs etc) for setting memories.  Doing so throws an error message.

Manipulating memory

It is easy to manipulate memories that have already been set by using the ‘mem’ command.  For example:

mem incr=0

mem incr=incr+1

mem incr=incr

Clearing memory

To clear individual memories, just set them to zero.  For example:

mem a=0

Note, this will not remove ‘a’ from the list of memories.  To reset all memories (so that ‘a’ is no longer taking up a memory slot), just type:

clrmem

It is not case sensitive.

From version 1.2, memories are kept on exiting the program back to your home screen so you may want to use clrmem when starting a new project.

Commands

Conditional calculation

You may want some calculations to processed only if a condition is satisfied.  To do this, use the ‘cond’ command (none of the commands are case sensitive).

The syntax for ‘cond’ is

cond <number of commands/calculations> <boolean expression> <command/calculation list>

This is best illustrated by example:

mem x=rnd(10)

cond 2 x>5

x

text “x is greater than 5″

The memory ‘x’ is set as a random number between 0 and 10.  Let’s break up the ‘cond’ command into its constituent parts:

‘cond’ – this is the command

‘2′ – the 2 next commands/calculations will only be processed if the condition, x is greater than 5, is satisfied (you can specify as many commands/calculations as you want processed

‘x>5′ – the is the condition for processing the next 2 commands/calculations

If ‘x’ is not greater than 5 then the 2 further commands/calculations will not execute.  Thus if ‘x’ is not greater then 5, there will be no output.  If ‘x’ is greater than 5 then the output will be:

5

x is greater than 5

The condition, or “boolean expression” uses the symbols:

>, <, =, <> (not equal), >=, <=

Also, you can use two or more boolean expressons with ‘&’ (AND) and ‘@’ (OR).  For example:

cond 5 x>=5 & x<=7

cond 5 x<5 @ x>8

Repeat

SophistimaCalc gives you the flexibility to repeat any number of commands/calculations based on a condition.  The syntax for ‘repeat’ is rhe same as for ‘cond’.  For example, you may want to solve the equation ‘ax + b=c’ using sample values for ‘a’, ‘b’ and ‘c’.  Using ‘repeat’ you can do this as follows:

mem a=2 mem b=5 mem c=50

repeat 4 a<10 & b<20 & c<200

solve a[x]+b=c

mem a=a+1

mem b=b+1

mem c=c+1

The four commands below the ‘repeat’ command are processed whilst the condition is still satisfied.

Solving equations

SophistimaCalc can solve linear equations for you.  All you need to do is enter ’solve’ in the followng manner:

solve  <expression>[x] +/- <expression>=<expression>

SophistimaCalc will then solve for x.

For example:

solve 2[x]+1=9

Another example:
mem a=50
mem b=60
solve a[x]+b=100

The <expression> can be as complex as you like (and can be a memory or algorithm):

solve pi*a[x]+sin(5)=6!

Input

During the course of your calculations, you may want to test various combinations of input without having to restart the calculation.  This is achieved with either the command ‘ask’ or the ‘key’ operator.

The “ask” command is simply:

ask “<words/letters>”,[memory]

The memory does not have to be previously set.  For example:

ask “Please enter variable: a”,a

A more useful example:

Ask “a? “,a
Solve a[x]+10=50

On pressing “enter”, you will see the following screen:

askEnter a number on the soft keyboard and press “okay”.  The equation will then be solved.

The key operator allows you to capture input from one key on the built in keypad without an input box and without having to trigger the iphone’s or ipod’s keyboard.  It needs to be used in conjunction with the ‘repeat’ command.  It is best to use the key operator to capture keys 1-10.  For example:

mem k=0

repeat 1 key=0

k=key

text “key is “+k

Labelling

SophistimaCalc deals with various complex calculations and algorithms.  During the course of your calculation, you may want to add a label so you can follow the logic of the calculation.  SophistimaCalc lets you do this with the ‘text’ command.

For example:
mem a=5
mem b=1
text “now calculating…”
mem c=a+b
text “a is “+a
text “b is “+b
text “a+b equals: “+c

Clearing the output screen

The output screen can be cleared at any time with the command ‘clrscrn’.

Examples

Calculate your tax

Assume that the tax on income in a particular country is:

0-$5,000: nil

$5,001 – $10,000: 20%

Greater than $10,000: 30%

You could use SophistimaCalc to manually calculate the tax each time. Alternatively, you could use SophisitimaCalc’s powerful commands to automate the process and then save the file as your own tax calculator.  An example of automating this process is as follows:

ask “Your income?”,income
cond 1 income<=5000
mem tax=0
cond 1 income>5000 & income<=10000
mem tax=20%*(income-5000)
cond 1 income>10000
mem tax=1000+30%*(income-10000)
Text “Tax on income of “+income+” is “+tax

The first line could always have been ‘mem income=5600″ and then you could edit the first line each time you wanted to calculate tax on another value.  However, the ‘ask’ command automates this process even further for your convenience.  You don’t need a separate tax calculator.  Also, whenever the rates change just edit the file and you’re good to go.

Calculate tips

Forget about a separate tip calculator.  Try this:

tip1

tip2

Ask “amount of bill”,bill
Ask “Percent to tip?”,p
Ask “Enter 1 to split bill”,a
Cond 1 a=1
Ask “Number of persons?”,pp
Mem tip=p%*bill
Mem total=bill+tip
Text “Tip is “+tip+” and total is “+total
Cond 2 a=1
mem pp=total/pp
Text “Amount per person is “+pp
Clrmem

Just save this file (for example, as “tip”) and load it every time you want to calculate a tip.

Financial calculator

This example deals with deposits and interes (a single deposit for a certain number of years and an annual deposit for a certain number of years).  It illustrates how the ‘key’ operator works  – here it is used to make a selection of the kind of deposit (annual or once-off).

financial 1

Financial 2

Clrmem
mem k=0
Text “Press 1 or 2″
text “1-single deposit, 2- annual deposit”
Repeat 1 k<>1 & k<>2
mem k=key
Ask “Deposit?”,d
Ask “Interest rate?”,r
Mem r=r%
Ask “Years?”,n
Mem final1=(1+r)^n
Cond 1 k=1
Mem final=final1*d
Cond 4 k=2
Mem A=final1-1
Mem B=1+r
mem c=d*b*a
Mem final=c/r
Text “Final amount is “+final

The formulas have been split deliberately so order of precedence works.  Capitals are used in some places but it doesn’t matter because commands are not case sensitive.

The examples works as follows:

Clrmem   – clears all the memories to avoid errors from previous input

Repeat 1 k<>1 & k<>2 mem k=key  – repeats the key operator until either a ‘1′ or a ‘2′ is pressed from the keypad (k is previously initialised to ‘0′)

The ask commands then request input of the basic variables for the calculation.

Cond 1 k=1 Mem final=final1*d - If ‘1′ was pressed initially then then one conditional command is processed.

Cond 4 k=2 - If ‘2′ was pressed intially then four conditional commands are processed.

Finally, the answer is shown in the output screen.

You can extend this example to calculate totals based on monthly or daily deposits and even daily compounding of interest.  If you have an initial selection (such as single and annual deposits in this case) then a single file can contain a number of formulas and you can effectively have a complete financial calculator.

A bit of fun

If you need a break from your calculations, try a simple guessing game:

guess

Text “Guess number between 0 and 10″
mem num=rnd(10)
Mem guess=-1
Repeat 1 guess<0 @ guess>10
Ask “Your guess?”,guess
Cond 1 guess=num
Text “Right”
Cond 2 guess<>num
Text “Wrong”
Text “My number was “+num

Or test your reflexes:

IMG_0025

Clrmem
Mem num=rnd(10)
Cond 1 num>5
mem go=7
cond 1 num<=5
mem go=9
text “press “+go
mem k=0
Mem c=0
repeat 2 c<10000
mem c=c+1
mem k=key
Cond 1 k<>go
Text “Not quick enough”
Cond 1 k=go
Text “You are quick enough “

32 Comments »

  1. [...] SophistimaCalc Manual [...]

    Pingback by Sophistima what? (coming soon) « Free Science Fiction Stories | May 22, 2009 | Reply

  2. [...] SophistimaCalc Manual [...]

    Pingback by SophistimaCalc: It’s alive « Free Science Fiction Stories | June 2, 2009 | Reply

  3. [...] SophistimaCalc Manual [...]

    Pingback by SophistimaCalc programmable calculator updated « Free Science Fiction Stories | June 16, 2009 | Reply

  4. The ( ” ) text format on this page does not facilate “copy/paste” function on iPhone for the calculator

    Comment by Ronnie | July 4, 2009 | Reply

    • Good point Ronnie. I’ll look into this. In the meantime, a workaround is to format the text correctly in an email(eg from your main computer) to yourself. Go to the email program on your iphone and select/copy then launch Sophistimacalc and paste.

      Comment by freescifistories | July 5, 2009 | Reply

  5. How can I raise the natural log base (e) to a power? That is, where is the exp key?

    Comment by John | October 2, 2009 | Reply

    • John, I hope this answers your question. The program has two commands: log(x) and ln(x). Log is base ten and ln is base e. There is no exp key but you could use the power key ^. So:

      ln(x)^y

      Is this what you were after?

      Comment by freescifistories | October 3, 2009 | Reply

  6. No. I want e^x.

    Also, I noticed that mem e = 2.731 (for example) does not remain in memory from one program invocation to the next. That is, the items placed in memory are lost when the program closes.

    Comment by John | October 3, 2009 | Reply

    • Okay, I understand. This is great feedback John. You’re the first person to actually point out bugs/additions. Do you have the full or light version?

      Comment by freescifistories | October 3, 2009 | Reply

      • Full (paid) version.

        Comment by John | October 4, 2009

      • John, is there anything else you’d like to see? What do you think about the program generally? Improvements?

        Comment by freescifistories | October 4, 2009

      • John, I’ve submitted a new version to apple that fixes the issues you’ve identified.

        Comment by freescifistories | October 12, 2009

  7. How about adding a shift key or second keyboard screen with all of the programming commands accessible via a single key stroke? This would save a lot of typing!

    Comment by Richard | October 17, 2009 | Reply

    • Good point Richard. I’ll see what I can do.

      Comment by freescifistories | October 18, 2009 | Reply

    • Richard, your feature request is in a new version just sent to apple for approval.

      Comment by freescifistories | October 23, 2009 | Reply

  8. [...] SophistimaCalc Manual [...]

    Pingback by Update to Sophistimacalc programmable calculator for ipod/iphone « Free Science Fiction Stories | October 22, 2009 | Reply

  9. Great idea for a program but it doesn’t seem to give me the correct answer if I enter 10^(44/10). That comes out to 10000 on the calculator and it should come out to 25118.8643 and some change.

    Comment by Don | October 30, 2009 | Reply

    • Sorry Don, I’ve run through the calculation and spotted the bug. It’ll be fixed in the next version – at the moment I’m focusing on the paid version for updates (a previous update is still with Apple – it takes them about 2 weeks to approve).

      Comment by freescifistories | October 31, 2009 | Reply

  10. Thanks very much. Nice idea for an app. Keeps me from having to make my own. :)

    Comment by Don | October 31, 2009 | Reply

    • No problem Don. Let me know if you think of any new features I should add. The update with Apple is 1.3 and the bug fix will be in 1.4.

      Comment by freescifistories | October 31, 2009 | Reply

  11. I think it would be great that numeric keyboard (instead of general one) appears when doing an input (known that numbers are supposed to be entered).

    TIA,

    Comment by Ramon | November 5, 2009 | Reply

    • Good one Ramon. I’ll see what I can do in v1.5 – v1.4 is already with Apple for review. This feature probably needs iphone os 3.0 as a minimum.

      Comment by freescifistories | November 6, 2009 | Reply

  12. Hi:

    Just purchased your Sophistima Calc for my Iphone 3GS and like what I see so far. Question and possible request though: Does the software include, or will you consider including, a command that will allow me to specify that I will “call” or load a saved program and immediately run that program. IE, based upon variables collected via the ask command, I solve a formula, as part of a branching chain, I may want to call a different saved program to use the calculated result just obtained and use that calculated result in newly called program to calculate a different value.

    I hope I have not confused you by that.

    Thanks

    Jim

    Comment by Jim | November 14, 2009 | Reply

    • That’s a good idea Jim and I understand what you mean. I’ll see what I can do.

      Comment by freescifistories | November 15, 2009 | Reply

      • Jim, just a clarification. I gather you would want to run the called program without actually having it replace the existing program in the input window. Is this what you had in mind?

        Comment by freescifistories | November 15, 2009

  13. HI and thanks for your reply.

    Yes but perhaps also to allow me to further ask if I want to run that same particular called program once again or to run a different saved program…. all from the initial program.

    Thank you for your consideration of such an addition to what appears to be a great calculator.

    Thanks again,

    Jim

    Comment by Jim | November 15, 2009 | Reply

    • I understand. I’ll think of how best to do this.

      Comment by freescifistories | November 15, 2009 | Reply

  14. Hi, Jim here again:

    If you can provide the earlier requests, would I be pushing things a bit too hard if I were to also request the ability to define and control an array, probably only two dimensional with ability to control the index under program control?

    Thanks once again for your consideration,

    Jim

    Comment by Jim | November 15, 2009 | Reply

    • Not pushing things at all Jim. It’s great to get feedback. Just so you know, Apple takes about two weeks to review changes once they are ready so it’ll be a few weeks until the extra features are available.

      Comment by freescifistories | November 15, 2009 | Reply

  15. I do understand about the Apple review process. More importantly, I fully appreciate your willingness to consider my requests.

    Thank you in advance for all your efforts.

    Jim

    Comment by Jim | November 15, 2009 | Reply

  16. Sorry to bother you once again but I here is something to consider on my initial request to call a stored program. once the primary program calls a stored program and calculates its results, if the calculated result of the called program is then assigned to a memory variable, the called program could be dismissed and removed from active memory. The initial program would remain active as well as those calculated results and the primary program would have the ability to call other stored programs that might need to use those newly calculated results. So, we keep a small initial program in memory to call and then dismiss called programs. Would that work?

    Just as thought.

    Thanks again,

    Jim

    Comment by Jim | November 15, 2009 | Reply

    • Thanks Jim. That’s what I had in mind. I’ll have to experiment a little.

      Comment by freescifistories | November 15, 2009 | Reply


Leave a comment