
SigmaCalculator
Advanced scientific and expression calculator.
Available in Google Play.



Features:
Standard functions (exp, log, ln, sin, cos, tan, factorial, random, ...), Builtin constants, Integrated keypad (Numeric and Alphabetic),
Angle unit in radian or degree, Calculation history, Userdefined variables, Function graphing,
Equation solving, Complex numbers, Script programming, etc.
SigmaCalculator is available in english and french, depending on your device settings.
Changelog:
Version 3.2
Main Module:
User interface update for tablets and other large screen devices.
New logic and integer arithmetic module supporting binary, decimal, octal and hexadecimal bases.
Script Module:
New options added including the possibility to set the output area height.
New integer functions: factorial, GCD, LCM, Combinations, Permutations.
Script engine: the current directory is now automatically added to the Lua path.
New examples added: module in Lua 5.2.


Version 3.0
User interface modifications, Syntax highlighting, Plotting of data saved in ASCII file, Exporting plot to JPEG image, New plot settings (font size, line/symbole size, ...)
Scripting module: new options added, syntax highlighting, file explorer integrated, complete implementation of io.read without limitations, script engine updated to the latest stable release, support for Intel processor based Android mobiles.
Possibility to install to SD card
Version 2.4.1
New: Unit conversion module: Length, Area, Volume, Mass, Temperature, etc.
Display the list of the most used universal constants.
Scripting module: new: descriptive statistics functions added.
Version 2.4
Scripting module: maintenance release with uniformization of SigmaScript Windows, Linux and Android releases: script can be developed/run on any of these operating systems.
SigmaScript for Windows and Linux available on Logimath website (www.logimath.com)
Version 2.3.4
Scripting module:
New: input (io.read) function partially implemented.
lmath library improved.
User interface improvement with CPU usage optimized.
Calculator: import/export application data (variables list, statistics, history, ...) to the SD card.
Version 2.3
Scripting module:
New: Android functions added (droid namespace)
interactive mode: set to use the Android functions and interact with user. The background mode can be used for long calculations, without user interaction.
Editor: display lines number, highlight the current line and the line where a Lua error occurred, etc.
New: Math functions added (lmath namespace), including and extending the Lua math functions.
Calculator: All data (expression, variables, statistics list, graph options, application state, etc.) are now permanently saved, and is automatically restored when SigmaCalculator restart.
Calculator: AutoComplete feature added.
Version 2.2
New: Scripting module using the Lua programming language.
Calculator: Complex number: Argand diagram added (plot of complex numbers as vectors); Interface improvement.
Calculator: Statistics module: Possibility to set the graph parameters (line/symbol).
Interface improvement.
Version 2.0
Calculator: Complex number module for doing basic operations with complex numbers.
Calculator: Statistics module: Possibility to add an element with a frequency.
Version 1.3
The program parameters (variables list, expression history, angle unit, plot settings, etc.) are permanently saved.
Version 1.1
Calculator: Statistics module that calculates the descriptive parameters of a list of values.
User Interface: Main and Graph screens improvements.
Version 1.0
Initial release.
Tags:
Calculator, SigmaCalculator, Logimath, Calculator for Android, Scientific Calculator,
Math Calculator, Expression Calculator, Equation Solver, Function Graph, ...
Help:
SigmaCalculator supports the most common and useful mathematical functions.
It’s easy to use: to evaluate a mathematical expression,
simply type it in the input box, using operators (+  * / ^),
parenthesis and mathematical functions and press Calculate or the EXE button.
You can use the SigmaCalculator keypad to enter numbers, operators, functions and define variables.
You can set variables (with any nonreserved name); use fundamental constants; solve equations;
plot functions; statistics; etc.
Examples:
Define variable: a=3
Define variable: b=3
Calculate: a*b/(1+a^2)
Calculate: Sin(2*π/3)
Operators:
+ add
 subtract
* multiply
/ divide
// modulo (example 5//2 gives 1)
% percentage (example 50%4 gives 2) a long press on the ^ button insert %
! factorial (example 4! gives 24)
^ power (example 7^2 gives 49)
** power (example 7**2 gives 49)
Functions:
Exp(x) exponential
Ln(x) natural logarithm
Log(x) decimal logarithm
Log2(x) base2 logarithm
Sin(x) sine
Cos(x) cosine
Tan(x) tangent
Asin(x) arc sine
Acos(x) arc cosine
Atan(x) arc tangent
Sinh(x) hyperbolic sine
Cosh(x) hyperbolic cosine
Tanh(x) hyperbolic tangent
Abs(x) absolute value
Sqrt(x) square root
Ceil(x) ceiling, the smallest integer not less than x
Floor(x) integer part of x
Rand() random number between 0 and 1
Sign(x) sign of x (1 if x < 0, +1 if x > 0 and 0 if x = 0)
Erf(x) error function
Fact(x) factorial of x
Constants:
Pi π
e Natural logarithm base (2.71828...)
Universal constants in international units (SI)
q Electron charge (C)
me Electron mass (kg)
mp Proton mass (kg)
kB Boltzmann constant (J/K)
h Planck constant (Js)
c Speed of Light in vacuum (m/s)
ε0 Electric constant (F/m)
μ0 Magnetic constant (N/A²)
NA Avogadro constant (1/mol)
G Constant of gravitation (m³/kg/s²)
Ri Rydberg constant (1/m)
F Faraday constant (C/m)
R Molar gas constant(J/mol/K)
Commands:
help show help
tol=fval set the tolerance (precision) to fval (tol is used in the equation solving algorithm)
iter=ival set the number of iterations to ival (iter is also used in the equation solving algorithm)
Guide:
Buttons: a long click on the DEL button clears the input; With the left and right arrows, you can move the cursor in the input, and a long click
on the left arrow has the same effect than clicking the DEL button, and a long click on the right arrow inserts space. In landscape mode (when rotating your phone),
additional buttons will be available giving you the possibility to navigate in the calculation history (curved arrows), clear the input, etc.
If you perform a longpress on a the input area, a floating list
of menu items appears with the most common functions and constants.
With this menu, you can also (i) display the calculation history, recall and edit a previous expression
by clicking on the correspond item ; (ii) display the variables list dialog and insert a variable in your expression.
Note that the calculation history and the userdefined variables are permanently saved and can be reused after restarting SigmaCalculator.
To switch the angle unit between Radian and Degree, click the Deg/Rad button.
To navigate in the history calculation, long click the right or left parenthesis button.
By pressing the ABC button (or f(x) button), you can switch between the SigmaCalculator Alphabetic Keypad and Functions Keypad;
A press on an alphabetic button inserts the first letter and a long press inserts the second letter.
To define a variable, type the name, click the = button (available if the SigmaCalculator Keypad is set to Alphabetic),
type the variable value and then press Calculate or EXE. Note that the variable names are not case sensitive.
You can insert or delete variable by selecting menu/Variables.
If you press the Android menu, you can view the function graph; view the defined variables or the calculation history;
switch between the Android soft keyboard and SigmaCalculator keypad; and show this help.
You can solve nonlinear equation f(x)=0: type your f(x) expression and click the Solve button.
If necessary, you will be prompted to define the solution interval.
You can also define this interval [a b] by manually setting a and b variables, or within the
interval dialog shown after a long press on the Solve button. The solution accuracy depends on this interval.
Example:
Type x^2  x  1
Click Solve
You can graph a function y = f(x). To do so, type your f(x) expression, and click Plot.
The graph window will then appear.
Example:
Type x^2  x  1
Click Plot
Note that the f(x) function can contain userdefined variables or builtin constants.
Example:
v*x^2  w*x  1
Where v and w are already defined and are taken as parameters.
With the menu, you can add or remove curve, set the graph scale, etc.
In the Scale dialog, you can set the x and yrange or automatically scale the graph (by clicking the AutoScale button).
If you check the XRange button in the Scale dialog, the curves data will be recalculated in the new XRange.
In the Settings dialog, you can:
(i) Set the number of points or the XStep (if the step button is checked, the number of points will be
calculated based on the step).
(ii) Plot curves with symbols if the Symbol button is checked.
If you click the graph, the corresponding (x,y) coordinates will be displayed on the top of the graph.
On the graph topright corner, the legend is displayed. If you long press one item in this legend,
you can activate the corresponding curve. If you activate a curve, you can display the (x,y) coordinates for this curve, by clicking the graph.
Descriptive Statistics:
The statistics module calculates the descriptive parameters of a list of values:
Number of values (N), Minimum (Min), Maximum (Max), Sum (Σx), Mean (μ), Median (Med),
Variance (σ²), Standard Deviation (σ), Coefficient of Variation (CV), Root Mean Square (RMS),
Skewness (Skw) and Kurtosis excess (Kur).
Formulas:
Mean:
Variance:
Skewness:
Kurtosis:
To evaluate the statistics parameters, firstly enter your list of values: type each value and store it by pressing the Add button.
When ready, click one of the statistics button (N, Min, Max, Σx, μ, ...) to calculate and view the corresponding parameter.
To view the list, select menu/List button. With the appeared dialog you can modify the values in the list.
You can graphically view you data, by clicking the Scatter button. In this scatter plot, two lines indicate respectively the mean and the median.
Complex numbers:
Select menu/Complex to activate the Complex numbers module. With this module, you can do basic operations with complex numbers such as add, subtract, multiply, divide, calculate the square root, the absolute value (modulus), phase, sine, cosine, tangent, etc.
You can enter two complex numbers (real and imaginary part) and click the button corresponding to the operation you want to perform.
The calculation result is then displayed. You can copy the result to the first complex number by clicking Res.→z button (useful if you perform some repetitive calculations).
To calculate the absolute value (modulus) of z, click Abs(z) button.
To calculate the conjugate of z, click Conj(z) button.
To swap the two complex numbers values, simply click Swap button.
You can switch between the cartesian (z = x + iy) and the the polar form (z = r exp(iφ)), by clicking the Cart./Pol. button.
To convert z from polar to cartesian (if in polar form) or from cartesian to polar (if in cartesian form), click z→xy or z→rφ button.
To enter the complex number, you can use the numeric (phone) keyboard or the alphanuneric keyboad: select menu/Keyboard to switch between.
You can enter any formula supported by SigmaCalculator in the input: for example : pi/2 or 3*7/9 ... You can evaluate immediately the expression: long press the input and select the Evaluate menu.
You can view the the complex numbers in the complex plane (Argand diagram) by selecting menu/Diagram. The Argand diagram, including the two complex numbers and the operation result, is then shown.
Rem: In the Argand diagram, a complex number x + iy is the vector from the origin to the point (x,y).
NB: the first complex number is labelled z.
the second complex number is labelled z₂.
the operation result is labelledz₃.
NB: φ is always in radian in the Complex numbers module.
Scripting:
SigmaCalculator includes SigmaScript, a development environment for the Lua scripting language for Android, with builtin Lua scripting engine.
Features : Builtin Lua scripting engine, included Lua samples and code snippets, output area, save/open to/from SD card, ...
The main goal of SigmaScript is to provide an editor and small development environment for Lua on Android, particularly suitable for mathematical calculations.
To run SigmaScript, select menu/Script.
With the toolbar, you can run, open or save script from or to the SD card.
You can perform the same actions with the menu.
SigmaScript includes some code samples and snippets (menu/Samples ; menu/Snippets or the Snippets button in the toolbar; or a long press on the editor area).
With code snippets, you can insert some pieces of code (for, switch, if , function, ...) in your script.
If you want to change the font size, long press on the editor and select Font+ or Font.
You can create a new script or save the current script to another location, by long pressing on the editor and select New or Save As...
If you want to automatically run a script on startup (AutoRun), long press on the editor, select your script and click the AutoRun button.
If you select None in the list, the AutoRun feature will be disabled.
You can enable or disable the soft keyboard by selecting menu/Keyboard.
You can print text on the output area by using the Lua standard print function (use this function, not the io.write function).
To clear the output area, use the cls function or long press and select Clear.
Example:
Type the following script in the editor...
 Lua first script
cls()
a = math.cos(math.pi/4)
print(a)
... and select menu/Run (or long press on the editor and select Run).
The run time (script execution time in millisecond) can be printed out. To enable or disable this feature,
long press on the output area and select Print (or Don't print) execution time.
NB: With SigmaScript, the math functions are mapped to global functions (e.g. : user can use sin or math.sin). The given example can then be rewritten as follows:
 Lua first script
cls()
a = cos(pi/4)
print(a)
NB : Lua gives the neperian logarithm the name log and the decimal logarithm is named log10, as in C language. SigmaCalculator uses ln for neperian logarithm and log for decimal logarithm.
Extended Math functions:
Special math functions are added to SigmaScript (lmath namespace), including and extending the Lua math functions.
Summary of lmath functions and constants:
Functions:
lmath.exp2(x) 2^x
lmath.logb(x) exponent of x
lmath.cbrt(x) cubic root
lmath.hypot(x,y) sqrt(x²+y²)
lmath.erf(x) error function
lmath.erfc(x) complementary error function
lmath.lgamma(x) ln(gamma(x))
lmath.tgamma(x) gamma(x)
lmath.trunc(x) nearest integer
lmath.round(x) nearest integer, rounding
lmath.isinf(x) number is infinite ?
lmath.isnan(x) not a number ?
lmath.isnormal(x) number is normal ?
lmath.asinh(x)
lmath.acosh(x)
lmath.atanh(x)
lmath.gauss(x,b,c) G(x) = exp((t  b)² / 2c²)
lmath.lorentz(x,b,c) L(x) = ((1/pi)*c / ((x  b)² + c²))
Constants:
Universal constants in international units (SI)
lmath.q Electron charge (in C)
lmath.me Electron mass (kg)
lmath.kb Boltzmann constant (J/K)
lmath.h Planck constant (Js)
lmath.c Speed of Light in vacuum (m/s)
lmath.na Avogadro constant (1/mole)
Statistics:
The stats namespace includes functions to calculate the descriptive parameters of a list of values:
Minimum (stats.min(t)), Maximum (stats.max(t)), Sum (stats.sum(t)), Mean (stats.mean(t)), Median (stats.median(t)),
Variance (stats.var(t)), Standard Deviation (stats.dev(t)), Coefficient of Variation (stats.var(t)), Root Mean Square (stats.rms(t)),
Skewness (stats.skew(t)) and Kurtosis excess (stats.kurt(t)).
The formulas used can be found in the Logimath website: here.
All the stats functions take a lua table as argument, with 2048 maximum number of elements.
Example:
 Stats
cls()
t = {1,1,2,3,4,4,5}
m = stats.mean(t)
print(m)
Android specific functions:
Some Android functions are added to SigmaScript (droid namespace):
droid.log(msg) write message to the Android logging system
droid.toast(msg) show a quick pop up notification message
droid.alert(ttl, msg) show an alert dialog box, with title and message
droid.disp(ttl, msg) disp text, with title, in a scrollable dialog (useful for relatively long text)
droid.cpuinfo() get the CPU information
droid.meminfo() get the memory information
droid.memusage() get the the application memory usage
In the future SigmaScript releases, more Android specific functions will be added.
Example 1:
 Droid
ttl = "Droid Test"
msg = "Hello world!"
droid.alert(ttl, msg)
Example 2:
 Droid
cpui = droid.cpuinfo()
droid.disp("CPU Info", cpui)
Execution mode:
SigmaScript has two execution modes:
Interactive mode : set to use the Android functions and interact with user. Suitable when you need to interact with user during the script execution.
Background mode : set to perform long calculations, without user interaction. Suitable for math and algorithms development.
The switching between between the two modes is automatically done by SigmaScript.
You can also stop the running script, if in background mode : long press the 'Run' button and select 'Stop script'.
Editor options:
The SigmaScript editor can display lines number and highlight the current line and the line where a Lua error occurred, ...
To enable or disable editor features, select menu/Settings.
SigmaScript data (current script, application state, ...) are permanently saved, and automatically restored when SigmaScript restart.
To delete these data and reset SigmaScript, select menu/Settings/Reset.
NB: The Lua io file functions are available in SigmaScript (open, read, write, close and son on.). Example:
 IO script
cls()
local f = io.open("/mnt/sdcard/SigmaScript/test.txt", "r")
local t = f:read("*all")
f:close()
Example:
 IO read
cls()
io.write(" Enter your name: ")
name = io.read("*a")
io.write(" Name: ", name)
To learn the Lua programming language, you can visit the Lua official website : http://www.lua.org
Copyright:
Copyright© 20112013 Dr. Sidi HAMADY
http://www.logimath.com
sidi@logimath.com
Dr. Sidi HAMADY expressly disclaims any warranty for SigmaCalculator.
SigmaCalculator is provided 'As Is' without any express or implied warranty of any kind, including but not limited to any warranties of merchantability, noninfringement, or fitness of a particular purpose.
SigmaCalculator is protected by copyright laws and international copyright treaties,
as well as other intellectual property laws and treaties.

