Sunteți pe pagina 1din 51

EureKalc 3

User manual

version 3.0

An environment for numeric and symbolic calculation,


dedicated to solving small problems in
physics, mathematics, engineering...
EureKalc 3

Warning
You have to use EureKalc 3 at your own risks. The author does not
guarantee that this software is well-functioning and he declines any
responsibility for the possible consequences of a disfunction. If the
correctness of your calculations is of crucial importance, if it could
put in danger the life or the well-being of persons, then I recommend
not to use EureKalc 3.

License
EureKalc 3 is a free and open-source software. You may use it,
distribute it and change the source code at the following conditions :
- the distribution of EureKalc 3, or a modified version of EureKalc 3,
or any software including EureKalc 3 must also be free and open-
source. Nevertheless, it is allowed to include a link to the
EureKalc 3 download page in a commercial software.
- the distribution of EureKalc 3 or of software derived from
EureKalc 3 must always include a link to the original website of
EureKalc 3 : http://web.me.com/nicohirtt/EureKalc/
- the author of the original version of EureKalc 3 must be warned of
any distribution of a modified version of EureKalc 3. This can be
done by sending an e-mail to nicohirtt@me.com
- this license must be included in any distribution of the present
version of EureKalc 3 or of a modified version.

Contribution
A message will appear randomly at startup, asking to contribute to
the development of EureKalc. If you send me a message (via the
appropriate contribution form or by e-mail) with some suggestion for
enhancement, some bug-report, if you help translating EureKalc in
another language or correct some errors in the English version... Il
will send you an e-mail with a code to deactivate that annoying
message.

Nico Hirtt

To contact me :
nicohirtt@me.com

User manual for EureKalc 3" 2


EureKalc 3

Contents

1. Presentation!..............................................................................................................5

1.1. Why did I create EureKalc 3 ?".........................................................................................5

1.2. What can you do with EureKalc 3 ?"................................................................................5

1.3. A few examples"..............................................................................................................6

2. Basics!.....................................................................................................................10

2.1. Expressions"..................................................................................................................10

2.2. Documents and pages"..................................................................................................11

2.3. Blocks of expressions"...................................................................................................11

2.4. Activation, selection and contextual menus"..................................................................12

3. Calculating with EureKalc 3!..................................................................................14

3.1. Variable and function names".........................................................................................14

3.2. Operators and common predefined functions"...............................................................15

3.3. Numbers".......................................................................................................................15

3.4. Units".............................................................................................................................16

3.5. Lists of numbers : sequences and vectors"....................................................................17

3.6. Functions and operators applied on lists"......................................................................19

3.7. Constants"......................................................................................................................21

3.8. Managing and examining variables"..............................................................................22

3.9. Recalculate complete pages".........................................................................................22

4. Transform and manipulate expressions!..............................................................24

4.1. Editing expressions".......................................................................................................24

4.2. Copy, paste, delete and duplicate expressions"............................................................25

4.3. Transforming expressions with algebraic rules".............................................................25

4.4. Simplifications and automatic rules"..............................................................................28

4.5. Derivatives"....................................................................................................................28

4.6. Applying a function to both members of an equation"....................................................29

User manual for EureKalc 3" 3


EureKalc 3

4.7. «Replace with ...»".........................................................................................................29

4.8. «Calculate again»".........................................................................................................30

5. Presentation and lay-out of your pages!..............................................................31

5.1. Lay-out blocks and their properties"...............................................................................31

5.2. Creating, deleting and modifying blocks".......................................................................33

5.3. Moving expressions"......................................................................................................33

5.4. Fine positioning of expressions"....................................................................................33

5.5. Adding connectors to expressions"................................................................................34

5.6. Show or hide the numeric result of an expression"........................................................35

5.7. Adding text to a page"....................................................................................................35

5.8. Adding an image in a page"...........................................................................................37

5.9. Printing and exporting to PDF".......................................................................................37

5.10.Exporting to LaTex (still under development)"...............................................................38

6. More on lists, tables and graphics!.......................................................................40

6.1. Tables"............................................................................................................................40

6.2. Plotting graphs"..............................................................................................................42

6.3. Importing data"...............................................................................................................43

6.4. Managing data sets"......................................................................................................44

7. Advanced functions!...............................................................................................46

7.1. Preferences"..................................................................................................................46

7.2. Adding or changing physical units of EureKalc 3"..........................................................46

7.3. For audacious users only : adding or changing algebraic rules"...................................48

7.4. Translate EureKalc in another language".......................................................................51

User manual for EureKalc 3" 4


EureKalc 3

1. Presentation

This manual was translated from French. If you find some errors in the English version, please tell
me.

1.1. Why did I create EureKalc 3 ?

As a physics teacher in a higher secondary school in Belgium (15-19 years), I often have to
prepare and solve some small problems for my students. Previously, I used a sheet of paper and a
calculator. I had to look for some physical constants in a book. When the problem was solved I had
to copy it in a text editor, including formulas and the mathematical development with an equation
editor (like MathType) or, sometimes, I used LaTex. Sometimes, it was also necessary to copy the
resulting formulas or data in a spreadsheet to plot a graph. To complete this process it took much
time and I had to use many softwares.
I always wanted to have a single software to replace the calculator, the sheet of white paper, the
text editor, the spreadsheet and the equation-editor. As I never found this software, I decided to
create EureKalc.
Version 1 was a simple command-line calculator. Version 2 included a data-base of physical
constants and some graphing capabilities; it allowed the use of variables and user-defined
functions.
And now we have version 3, completely rewritten. It includes the visualization of mathematical
expressions in a classic algebraic notation, calculation on physical quantities (numbers with units)
and many tools for symbolic calculation (transforming equations, computing the derivative of a
function, etc...).

1.2. What can you do with EureKalc 3 ?

• Calculate on numbers or lists of numbers (sequences and vectors)


• Calculate on physical quantities (numbers with physical units)
• Present results in the form of tables and graphs
• Define variables and functions and use them in your calculations
• Use and administer a set of physical constants
• Write easily equations in a normal algebraic notation
• Transform equations using a vast set of algebraic rules
• Calculate derivatives of functions
• Present your work in a neat and structured lay-out
• Export your pages as PDF
• Export equations or complete pages to LaTex
• Export the results of your calculations (to use in Excel for instance)

User manual for EureKalc 3" 5


EureKalc 3

1.3. A few examples

Better than long explanations, some examples of pages produced with EureKalc 3 will give you an
idea of the potentialities of this software (all this examples have been exported to PDF and the
pasted in this manual)

Example Nr 1 : a very simple problem of uniform linear motion

How much time does it take to travel 8 meters on board of a car


running at 120 km per hour ?

v = 120 [km/h]
!x = 8 [m]

!x !x
v = " !t = ! 240 [ms]
!t v

In this example, you should notice the following points :

• You use EureKalc 3 as an interactive text editor, which memorizes, calculates, and transforms
the data that you type. In this example, a small presentation text has been typed before the
actual calculations. The speed has been defined by typing simply : v=120km/h (the square
brackets around the units are automatically added by EureKalc 3).

• EureKalc 3 manages automatically unit conversions. In this example, a distance in meters is


divided by a speed in km/h. The result is presented here in milliseconds, but we can simply click
on the time-unit [ms], while holding the <ctrl> key pressed, to get a contextual menu that lets us
change this in any other time-unit.

• On the last line, only the formula for the speed has been typed on the keyboard (as follow :
“v=∆x/∆t ”). Then, to get the time ∆t, we asked EureKalc 3 to transform the formula (by <ctrl>
clicking on .

User manual for EureKalc 3" 6


EureKalc 3

Example Nr 2 : speed of a satellite orbiting around the Earth

Using the laws ofdynamics of circular motion and the newtonian theory of
gravitation, calculate the orbital speed of a satellite turning around the earth at an
altitude of 1200 km.

Data :

Mass of the earth : Mt ! 5.974 .10+24 [kg]


Radius of the earth Rt ! 6.371 .10+06 [m]

Altitude of the satellite : h = 1200 [km]

Calculations :
Mt . m
Force of gravity: Fg = G .
r2
2
Centripetal force : m.v
Fc =
r

m . v2 Mt . m G . Mt G . Mt
Fc = Fg " = G. " v2 = =
r r2 r Rt + h

G . Mt
" v = ! 7256.8 [m/s]
Rt + h

In this example, we may notice the following points :

• The mass and the radius of the Earth, as well as the G-constant have not been typed by the
user : those constants are already memorized in the EureKalc 3 database (of course, you may
edit and modify this database, following your own needs). For instance, on the first line after the
word «Data :», we just type “ M_t ” + <Enter>.

• As you see, variable names may contain subscripts. They are types as : M_t, R_t, F_g, F_c...

• The two force equations have been typed on the keyboard. For instance, the gravitational force
has been typed as : F_g=G*(M_t*m)/r^2

• After typing “ F_c=F_g ”, all the rest of the mathematical development has been done without
using the keyboard, via the algebraic transformation tools of EureKalc 3, which can be accessed
via the mouse and contextual menuʼs.

User manual for EureKalc 3" 7


EureKalc 3

Example Nr 3 : relativistic energy of a proton in function of itʼs speed

Calculate the relativistic energy of a proton in function of it's speed

mp . c 2
mp ! 1.673 .10-27 [kg] v = 0 : c : 0.050 . c E =
v2
1 -
c2

v E E
[m/s] [MeV] 3500 MeV

0.000e+00 938.3
1.499e+07 939.4
2.998e+07 943.0
4.497e+07 949.0
5.996e+07 957.6
7.495e+07 969.0
8.994e+07 983.6
1.049e+08 1001.6
1.199e+08 1023.7
1.349e+08 1050.7
1.499e+08 1083.4
1.649e+08 1123.5
1.799e+08 1172.8
1.949e+08 1234.7
0 MeV v
2.099e+08 1313.8
0.00e+00 m/s 3.00e+08 m/s
2.248e+08 1418.5
2.398e+08 1563.8
2.548e+08 1781.1
2.698e+08 2152.5
2.848e+08 3004.9
2.998e+08 INF

In this example, notice that...

• The mass of a proton and the speed of light c are known by EureKalc 3
• The second expression on line 2 defines variable "v" as a sequence of values going from 0 to c,
by increments of 0.05 x c.
• The relativistic formula for energy has been typed on the keyboard, in a very simple way, as you
would in Excel : E=(m_p*c^2)/sqrt(1-v^2/c^2). EureKalc 3 transforms this in a neat equation.
• This formula is automatically calculated for all values in the sequence v and the resulting
sequence of values is stored in the variable E.
• The sequences v and E are presented in a table (by typing “ table(v,E) ” ) and a graph (by typing
“ plot(v,E) ” ). Those sequences may also be exported in a tab-delimited file to be used in other
applications.

User manual for EureKalc 3" 8


EureKalc 3

Example Nr 4 : kinetic energy of an harmonic oscillator

A mechanical harmonic oscillator has a mass of 23 grams. The frequency of the


oscillation is 12Hz and it's amplitude is 3 cm. Calculate and show on a graph the
evolution of the kinetic energy of that oscillator.

Data : m = 23 [g]
x0 = 3 [cm]
f = 12 [Hz]
" ! = 2 . ! . f ! 75.40 [Hz]

Equation of the movement : x = x0 . sin ( ! . t )

dx d
Speed : v = = ( x0 . sin ( ! . t ) ) = x0 . ! . cos ( ! . t )
dt dt

m . v2 m . x0 2 . ! 2
Energy function : Ek ( t ) = = . cos 2 ( ! . t )
2 2
t = 0 : 0.200 : 0.001 [s] "

Kinetic energy of the oscillator


E_k(t)
0.06 J

0.00 J t
0.00 s 0.20 s

Ek ( t ) ! ( 58.8 , 58.5 , 57.5 , 55.9 , ... , 25.4 , 29.8 , 34.2 , 38.5 ) [mJ]

Ek ( 0 [s] ) ! 58.84 [mJ] Ek ( 25 [ms] ) ! 5.62 [mJ]

• The development of the derivative function has been done with the tools for symbolic calculation
included in EureKalc 3.
• It is possible to use greek alphabet (π and ω) in the names of variables, functions or constants.
Itʼs very esay. For instance, to write symbol β, just type \b or \be or \beta...
• in this example, we defined a function E_k(t), which is used for plotting the graph (we typed
“ plot(t,E_k(t)) ” and calculating two values on the bottom lines.

User manual for EureKalc 3" 9


EureKalc 3

2. Basics

2.1. Expressions

A EureKalc 3 page is nothing more than a set of expressions. Working with EureKalc 3 means
essentially typing expressions on the keyboard, each of them followed by, <Return>, <Tab> or
<Enter> (or <escape>). Each expression is deciphered, eventually calculated and re-written in a
neat form. An expression may never contain spaces, excepted when itʼs simple text.

We have to distinguish several forms of expressions :

Simple expression Any calculation containing numbers, physical quantities, sequences,


operators, variables, functions... If the calculation produces a result
(if the variables and functions have been defined) that result is
written behind an arrow, after the expression. Simple expressions
let you use EureKalc 3 as a calculator.
For instance : sqrt(sin(π/4)) <Enter> produces :

Equation Two simple expressions separated by an “ = ” constitute an


equation. EureKalc 3 lets you memorize, copy and transform those
equations.
Example : p*V=N*k*T <Enter> is the equation of the Gas Law :

Variable definition When the first expression in an equation is a single variable, then
that equation is a variable definition. In that case, EureKalc 3 tries to
calculate the right-side expression and, if it succeeds, the result is
memorized in the variable. The right side algebraic expression itself
is also memorized as the symbolic definition of the variable : this
definition can then be used later in other expressions.
Example : a=2(cm/s)/0.3s <Enter> :

User manual for EureKalc 3" 10


EureKalc 3

Function definition A function definition is an equation whose first expression is a


function name followed by a list of variables between parentheses :
<name of the function> (<list of variables>). The function definition
is memorized and may then be used in other calculations.
Example : x(t)=2cm*sin(\w*t) <Enter> :

Commands The main commands are plot (to create a graph), table (to show
sequences of numbers) and use (import of datatables).

Text and image To show some simple text and images on a page

2.2. Documents and pages

In the present version, EureKalc 3 can only open one document at a time. But each document may
contain several pages. A little pop-up menu on the bottom left side of the window lets you switch
from one page to another, create new pages or erase pages. When you choose a page in this
menu, all expressions in that page are calculated again. The order of calculation is from left to right
and from to to bottom, block after block (see next point). To recalculate the current page you may
also choose "Recalculate page" in the "Calculus" menu or via it's shortcut : <cmd> G.
A EureKalc 3 document may be saved and opened using the classic “New”, “Save”, “Save as...”
and “Open” commands in the “File” menu. We suppose that you know how to use those functions.
When you save a document, all variables are also saved and the will be reloaded after you re-
open the document.

2.3. Blocks of expressions

Expressions are grouped in horizontal or vertical blocks. By default the pages are divided in
horizontal blocks of expressions, one block above another. With this default organization, the
following rules apply :
• When you press the <Tab> key after typing an expression, the insertion point moves to the
next position in the same block (at the right of the last entered expression).
• If you press the <Return> key, then a new block is created under the present block and the
insertion point is placed at the first position in that new block (for the user this looks simply as
a line feed).
• If you press <enter> (or <fn> + <return> on powerbooks without <enter> key, or <escape>)
you force the execution and calculation of the expression without moving the insertion point
You can visualize the borders of the blocks by clicking the little red rectangle on the bottom of
the window. Click again on that rectangle to hide the border. You may also use the following key-
combination : <ctrl>+<shift>

User manual for EureKalc 3" 11


EureKalc 3

A page with four horizontal blocks containing respectively 4, 1, 2 and 0 expressions.


The red lines are the borders of the blocks.

2.4. Activation, selection and contextual menus

When you move the mouse pointer over an operator, a function, a variable, a number or any
element of an expression, a blue activation frame appears around the concerned part of the
expression. For instance, if your mouse points the "+" of "a.(b+c)", then "b+c" is activated. This
activation frame disappears when you move the mouse pointer away.
When you click on an element of an expression, then a red selection frame appears around the
concerned part of the expression. This selection frame stays until you click on another place or
until you press the <escape> key.
Once an expression is selected, you may navigate to one of the nearest expressions using the
arrow keys. For instance, pressing the right arrow changes the selection to the nearest expression
on the right of the current selection. So you can navigate in your page without using the mouse.
When you do a <ctrl> + click on an element of an expression while it is activated, a contextual
menu appears. This menu lets you choose between many options which we will discuss later.

The contextual menu of the " v2 " expression above.

User manual for EureKalc 3" 12


EureKalc 3

On the bottom of the screen, in the grey zone, you see the word "ctrl". This is a button which lets
you deactivate or reactivate the use of the <ctrl> key for getting the contextual menus. This
may be useful when you have many successive transformations of expressions to do or if you can
not use both hands. Be ware : when you deactivate the need of using <ctrl> for contextual menus,
you have to use it for selection.

User manual for EureKalc 3" 13


EureKalc 3

3. Calculating with EureKalc 3

3.1. Variable and function names

Variable and function names may contain lower case or uppercase letters as well as digits. The
first character should always be a letter. Variable names are case-sensitive (variables "m" and "M"
are different)
When a variable name contains a "_" (underscore), the part of the name behind the "_" is written
as subscript. For instance, a variable typed as "X_ab" will show as Xab. When a variable name
ends with a number, this is automatically transformed in subscript. In other words, the variables
"a3" and "a_3" are identical and contain the same value.
A variable name may also be a greek letter, optionally followed with any subscript. Greek letters
are obtained by typing their name (or their abbreviated name) after a "\" (backslash :
<alt><shift> / ). For instance, to get the letter β you may type "\b" or "\beta" or "\be"... All those
result in the same variable. There are some special cases : "\w" gives ω, as well as "\omega" or
"\ome", etc. But "\o" or "\om" gives ο (omicron). "\f" is equivalent to "\phi". Greec letters may also
be lower or upper case : "\D" gives Δ, while "\d" gives δ. Be aware : the greek letter must be the
only character in the main part of the variable name . But a subscript is allowed : "gamma4" or
"\g4" (or "\g_4" ou "\gam4", etc...) are all accepted and equivalent to γ4. In the same way, is
"\gamma_x" a correct variable name for γx. But "a\gamma" or "x_\gamma" or "\gammax" will not
produce the expected result (in fact they will function as valid variable names, but they will not
show as you would expect).
In Mac-OSX, some greek letters can be directly entered with the keyboard, without changing the
font or the language : π (alt+p), µ (alp+m), ß (alt+b), ∆ (alt+maj+d), etc... Those characters are
treated by EureKalc 3 as normal letters : you may place them anywhere in a variable name. For
instance, a variable may be called "∆x". But be carefull : the variables named "\pi" and "π" (typed
as <alt> p ) are not identical.
Normally, variable names are shown in a times italic font. You may get a bold character by putting
the suffix "\b" after the variable name. This is useful because bold characters are often used in
physics to represent vectors. You may also represent vectorial variables with the classic arrow
above the variable name. To get this, put the suffix "\v" after the variable name. Attention :
variables "x", "x\b" and "x\v" are three different variables.
For instance, the expression " x\v=x1*e1\b+x2*e2\b+x3*e3\b " will give this result :

User manual for EureKalc 3" 14


EureKalc 3

3.2. Operators and common predefined functions

Mathematical expressions in EureKalc 3 may contain one equality sign ("="), brackets
(parentheses or square brackets are both accepted), numbers (with or without a physical unit),
variables, operators and functions :
The binary operators are :
+" sum
—" minus

*" product
/" division
//" division with priority above the product:
" 2*x//3*b is the same as (2*x)/(3*b)
^" power

Common functions :
" —! ! ! ! minus
! sqrt(x)"" " " square root
" sin(x) , cos(x) , tan(x)"" ordinary trigonometric functions
" asin(x) , acos(x) , atan(x)" inverse trigonometric functions
" exp(x), ln(x)" " " exponential function and natural logarithm
" Log(x)"" " " decimal logarithm
" log(a,x)" " " logarithm of "x" to the base "a"
" abs(x)" " " " absolute value

There are also statistical and vectorial functions and operators, as well as an operator for
derivation of functions. This will be discussed later.

3.3. Numbers

By default, decimal numbers are entered using the decimal point as separator. If you prefer to
use always the comma as decimal separator, you may choose this in the preferences (via the
"EureKalc" menu). You may also choose to use temporarily the comma, by clicking on the little
comma in the grey zone at the bottom of the window.
Numbers in scientific format are entered like in Excel. For instance, you type "2.4e-12" to get :
2.4.10-12
When you <ctrl> clic on any number, you get a contextual menu that lets you choose the format for
that number (integer, decimal, scientific) and the desired precision (number of decimals).

User manual for EureKalc 3" 15


EureKalc 3

Choosing the numerical format for a number

3.4. Units

One of the most interesting features of EureKalc 3 is to let you associate physical units to the
numbers in your calculations : so you work not more on abstract numbers, but on actual physical
quantities. When doing calculations EureKalc automatically transforms those units when
necessary. For example, if you divide an energy in "kJ" (kilojoules) by a distance in
"mm" (millimeters) you will get correctly a force in "N" (newton).
A great number of units are predefined in EureKalc 3. To list them all, choose "Units..." in the
"Calculus" menu. Later in this manual, we'll explain how to edit or add new units.
As long as you use one of the predefined units, you just have to type it just behind the number. For
instance, EureKalc will correctly understand these: "3cm", "2s", "2.5e4m/s", "15mJ", etc...
Thus, writing this : « (3m/5s)^2*2.3kg » (+ <Enter>) will give the following result :

3 [m] 2
. 2.3 [kg] ! 0.828 [J]
5 [s]

But if you have to use a compound unit (using several predefined units) then you must write the
units between brackets (square or not, has no importance). The elements of compound units are
connected with "." or "*" (products) or "/" (divisions). Each of them may be followed by an integer
power. For instance, an electric field of 0.03 Volt per square meter may be written as :
" 0.03(V/m2) or 0.03(V.m-2) or 30[mV/m2] ,etc...
When displayed by EureKalc, units appear always between square brackets.
The contextual menu of a unit suggests some other, equivalent units, among which you may
choose. This changes immediately the displayed value. You should remember that, internally,
EureKalc memorizes and calculates always with the International System of Units (SI). Changing
the units of data or results with contextual menu only changes the way they are displayed, not the
actual value.

User manual for EureKalc 3" 16


EureKalc 3

Some predefined energy-units

Temperature units have a special behavior. When you type a temperature in °C or °F, it is
converted to Kelvin for all internal calculations. In most situations, this is what you would expect
EureKalc to do. But sometimes it could be a little bit confusing. If you have a temperature of 12°C
and you multiply it by 2, you won't get 24°C, but...

Of course this is easy to understand once you transform those temperatures in Kelvin :

3.5. Lists of numbers : sequences and vectors

EureKalc 3 van execute calculations on lists of numbers. For instance sequences of numbers
(0,2,4,6...), or vectors, or measurements produced by some experimentation.
The first way to define a list of numbers is to enter them manually, separated by a comma (or a
semicolon, if you use commas as decimal separators).
Here are some commented examples :

User manual for EureKalc 3" 17


EureKalc 3

x=1,5,8,12 This expression puts the values 1, 5, 8 and 12 in the variable x. Then the
expression x^2 returns :

As you see EureKalc adds parentheses around lists, but it is not necessary
to type parentheses at input (although, it is allowed).

1,5,8,12m When one (an only one) value of a list is followed by some unit, then this unit
is applied to all members of the list :

1m,5,12s When several values of a list have a unit, then only those elements will be
given a unit. That means you could create lists of values with different units.

EureKalc 3 can also generate sequences of values. The syntax is the same as in many other
environments (MatLab er R for instance) and uses one or two colons " : ". Here are some
examples :

0:100 This returns the sequence of integer numbers from 0 to 100. When you ask
Eurekalc to show the elements of such a long sequence, only the first and the
last members of the sequence are actually displayed. Like this :

Il you really have to see all the values, you should use the "table" instruction
that will be discussed later.

0:100:5 This expression returns the sequence of numbers from 0 to 100 by steps of 5
(0, 5, 10, 15... until 100).

User manual for EureKalc 3" 18


EureKalc 3

0:100:20m If one of the arguments of a sequence definition is followed by a unit, then


this unit will apply to all elements of the sequence :

3.6. Functions and operators applied on lists

When the argument of a function is a list of numbers, then that function will be applied to all
elements of the list and the result is a list of the same length. For instance :

When a binary operator (+,-,*,/,^) is applied to lists, two different situations may occur :

• if both arguments are of the same length, then the operator is applied to all pairs of numbers
and the result is a list of the same length as the two arguments. For example :

• if one of the arguments is a list and the other is a scalar, then the operation is repeated by
associating the scalar with each element of the list. The result is a list of the same length. For
example :

• in all other cases, the result is... unpredictable !

There are also some specific operators, that only make sense with certain special types of lists.

User manual for EureKalc 3" 19


EureKalc 3

x**y Scalar product or dot product of two vectors.


This operator may only be used with vectors of the same length and if all
elements of each vector are of the same physical type (same unit). Notice that
you type a scalar product with a double asterisk, but EureKalc writes it with a
centered dot. Example : calculation of the mechanical work produced by a
force :

x***y Vectorial product of two vectors.


This operator may only be applied to 3-dimensional vectors. You have to type a
triple asterisk "***" to use this operator, but EureKalc replaces them with the
usual symbol "∧".

In this example, we calculate the force acting on a proton moving in a magnetic


field. Both the velocity of the particle as the magnetic field are 3D vectors. And
so is also the resulting force.

dim(x) Dimension of a list or dʼun vector (number of elements of the list)

min(x) Smallest member of a list

max(x) Greatest member of a list

sum(x) Sum of the elements of a list. For instance, to compute the sum of squares of
the 20 first integer numbers, you write : sum((0:20)^2), which gives this :

mean(x) Mean value of the elements of a list (this is equivalent to "sum(x)/dim(x)" )

stdev(x) Standard deviation of the elements of a list

norm(x) Norm of vector x = sqrt(sum(x*x)) = sqrt(x**x). For instance :

x(n) Returns the n-th value of the list x

User manual for EureKalc 3" 20


EureKalc 3

3.7. Constants

The most often used physical constants may be memorized in the "constants manager" that you
access by choosing "Constants..." in the "Data" menu. A window will open, with the list of available
constants, organized in four columns : symbol of the constant, value, unit, description.

When you click on the "Edit" button at the bottom of that window, you get an editable list where
you can change, add or delete constants. You may insert comment lines beginning with a "#". The
elements of a constant definition (symbol, value, unit, description) are separated by <tabs>.
Using constants in your calculations is very simple : when EureKalc encounters, in some
calculation, a variable that is not yet defined, he looks for it in the constants list. For example, the
symbol 'c' is the name of the speed of light in the constants list. So, you get :

2 . c ! 5.996 .10+08 [m/s]

But you could use as well the variable 'c' with a different value :

c = 5 ! 2 . c " 10 !

I recommend to use the constants only for fundamental physical constants and number you use
very often. In other cases, you are probably better off using "data sets", they will be explained later.

User manual for EureKalc 3" 21


EureKalc 3

3.8. Managing and examining variables

The «Context» menu gives you access to a "variable watcher". That is a window where you can
see all the variables defined in the present environment. Constants will only appear if they have
been used.
Lists are presented as "vector (dim=...)". To see the actual values of that list, just click on it.
You may not modify variables in the variable watcher, but you can delete them one by one by
selecting them and clicking on the "Delete" button.
You may also delete all variables by choosing the option "Delete all variables" in the "Calculus"
menu.

3.9. Recalculate complete pages

There are two different ways of recalculating a complete page : with or without erasing
previously all variables. When all variables are defined within the current page, the choice
between both methods has no importance. But there are some situations where you could prefer
not to reinitialize the variables.
Imagine for instance a Eurekalc page with calculations operating on imported data. If you would
like to re-execute the same calculation on a different set of data, you must begin with importing the
data and then recalculate the page without deleting the variables (otherwise you would loose your
imported data).
Another case would be some complicated calculation that must be executed again in an iterative
way (the result of the previous calculation being a data for the new one).
We will encounter other situations where the choice of deleting or not variables before
recalculation is of crucial importance, for instance when we will study the import of variables.
To recalculate a page with or without reinitialization of all variables, choose the appropriate
option in the "Calculus" menu.

User manual for EureKalc 3" 22


EureKalc 3

You'll notice that on of those options has a keyboard shortcut : <cmd> G. Which one, that depends
on the setting of the option "Keep variables when recalculating" (in the same menu).
This default option will also apply when you select a page in the small "pages" menu at the
bottom left corner of the window. If several pages must share the same variables, then it is
indispensable to check the option "Keep variables...". If several pages share the same variable
names, but with different contents then on the contrary you should uncheck that option.

User manual for EureKalc 3" 23


EureKalc 3

4. Transform and manipulate expressions

4.1. Editing expressions

To edit manually an expression or a part of an expression, use one of the following methods :
• Select the expression (or part of expression) by clicking on it and do one of the following :
ask "Edit" in the "Edit" menu, or press <cmd> E, or press <Enter>
• Choose "Edit" in the contextual menu
• Double-click on the main operator of the expression
Remember that you may deactivate the <ctrl> key for the third method with the little "ctrl" button
the bottom of the screen. But if you do so, you will have to use the <ctrl> key to select an
expression (see 2.4).
When begin editing a full expression, it is transformed back into the code you typed (or would have
typed) to enter it : divisions are written as "x/y", square roots as sqrt(x), powers as "x^y", etc. This
code is placed in an editable field at the place of the original expression in the page. In other
words, you edit the expression within the page. Press <Enter> or <Tab> or <Return> or <Escape>
when you are finished.
But if you ask to edit only a part of an expression, then the recoded expression is shown in a
separate edit window. This is very useful when you have to change something in a complicated
expression.

In the above example, the user double-clicked on the minus ("-") at the denominator under the
square root.
When you have finished editing, the whole expression is calculated again and displayed in a neat
way.

User manual for EureKalc 3" 24


EureKalc 3

4.2. Copy, paste, delete and duplicate expressions

You can copy an expression (or part of an expression) to the scrapbook by selecting it and
choosing "Copy" in the "Edit" menu (or typing <cmd> C). You can also copy via the contextual
menu of an expression.
You can paste a copied expression...
• as a new expression : click at the place where you want to paste and select "Paste" in the
"Edit" menu (or <cmd> V)
• to replace an existing expression or a part of an existing expression : select the
expression to replace by clicking on it, then paste as above.
• while you are entering or editing an expression you may paste the expression that's in the
scrapbook
• in another application than EureKalc 3 : the expression is pasted in the form you typed it.

A fast way to copy and paste an expression is to duplicate it. The duplicated expression is placed
at the next position in the current block (at the right or under the current expression, following the
settings of that block — see next chapter). Only full expressions can be duplicated, not partial
expressions. To duplicate an expression :
• Select it and choose "Duplicate" in the "Edit" menu (or <cmd> D)
• Choose «Duplicate» in the contextual menu of the expression
• Select the expression and click on the "=>" or the "=" button at the bottom of the window
(this will add an "=>" or "=" connector before the duplicated expression and, eventually,
hide the left part of an equation — see next chapter).
Two little buttons at the bottom of the page, marked as "=>" and "=", let you duplicate the selected
expression while adding a left connector. For more details, see the next chapter.

To delete an expression, select it and choose "Delete" in the "Edit" menu (or press the
"backspace" key) or choose "Delete" in it's contextual menu. You may only delete complete
expressions. To delete a part of an expression, you must edit it. Deleting a variable or function
definition does not delete that variable or that function : you may continue to use them unti you ask
to recalculate the page or to delete the variables.

4.3. Transforming expressions with algebraic rules

One of the most powerful functionalities of EureKalc 3 it to let you transform equations and
mathematical expressions using a vast collection of mathematical rules (at the end of this manual
you will discover how to make changes to those rules). Transformation rules are accessed via the
contextual menus of expressions. They are far too numerous to be discussed her one by one : you
will have to discover them while using EureKalc 3.

User manual for EureKalc 3" 25


EureKalc 3

Let us look at this example. The expression v2 has been activated in the equation of kinetic energy
(by placing the mouse pointer somewhere in the rectangle containing that expression, but not on
the 'v' and not on the '2'). With a <ctrl> click we get a contextual menu and choose "Isolate".
This automatically transforms the equation into the form "v2=..."

Let us take a quick look at the other transformation rules in the above contextual menu :
• «Divide by this factor» would have placed factor "v2" at the denominator of the left-side of the
equation.
• «This factor before» would have placed "v2" before the ʻmʼ (commutativity of the
multiplication). «This factor behind» is useless in this context because "v2" is already the last
factor in the multiplication.
• «This factor before the division» would have transformed the right member into a product of
"v2" times "m/2"
• «This factor at the denominator» would have placed "v2" at the denominator (as "v—2")
• «Change into product» would have transformed "v2" into "v.v"

User manual for EureKalc 3" 26


EureKalc 3

Of course, the rules that you can select via the contextual menu depend on the actual... context !
For instance, the contextual menu associated with the full equation above (pointer on the "=") is :

Those commands operate on the full equation. The first one exchanges both sides of the equation.
The others return the multiplicative inverse, the opposite, the square or the square root of both
sides of the equation.
By combining those rules, you can solve or simplify many equations encountered in small classical
physics problems. For more complex situations, you might prefer to use manual editing of
expressions. Or buy some high level (and expensive) professional software.
Nevertheless, you should not underestimate the power of EureKalc 3, especially once you are
trained in using it. To convince you, look at the next example, where I transformed the relativistic
formula of energy, using exclusively the algebraic transformation rules of EureKalc.

As an exercise, I recommend to try this by yourself. Type the first equation s follow :
E=m*c^2//sqrt(1-v^2/c^2) . Then duplicate it with the little "=>" button on the bottom of the
window and try to transform it step by step into the final result, using only the mouse and the <ctrl>
key
Note that EureKalc 3 does not solve equations automatically for you (excepted in some very
simple cases). You have to choose the steps, and EureKalc executes them for you. And remember

User manual for EureKalc 3" 27


EureKalc 3

that you may always edit expressions "manually". Sometimes this could be faster than using the
built-in rules.

4.4. Simplifications and automatic rules

Some algebraic rules are applied automatically. For instance, expressions like "x+0" or "y*0" will
automatically be transformed into "x" or "0". Those automatic rules are applied after each edition or
transformation of an expression.
There are also simplifying rules that are not applied automatically, because it's sometimes useful
to keep an expression, temporarily, in an unsimplified state. For instance, the rule that simplifies
common factors at the numerator and the denominator of a division is not applied automatically. In
the contextual menu, there is a command named "Try to simplify further" : this will execute all non-
automatic simplifying rules that apply.

4.5. Derivatives

The derivative of an expression <exp> for a variable <v> is typed as follow : deriv(<exp>,<v>)
EureKalc will then transform this into the Leibniz notation for derivatives, which is best suited for
using derivatives in physics problems.
For example, the derivative of the gravitational potential of a mass M, in function of the distance to
it's center, will be typed as : deriv(-G*M//r,r) , which gives this :

d G.M
-
dr r

The contextual menu of the derivation operator (in this case, the "d" at the numerator of "d/dr") will
propose relevant derivation-rules. Most of those rules are non-automatic simplifying rules.That
means you can apply them simply by asking "Try to simplify further" (see the previous point).
There is one special case : the rule "derivative of a constant = 0" is applied automatically on
constant numbers, but it is neither automatic nor semi-automatic for variables and expressions
containing operators. This is because EureKalc can not know if a variable is a constant or not, or if
a given expression contains only constants. This is an exception to the general rule that you can
not make any errors why applying mathematical rules in EureKalc. In this case, you have to know
what you are doing.
In the case of the above example, we calculated the derivative by applying three times "Try to
simplify further" and once "derivation of a constant is 0" (that was for the derivative of the "G*M"
product : we know that G is a constant and that M does not depend on r and may thus be treated
as a constant in this case). The result is the formula of the gravitational field of M at a distance r :

User manual for EureKalc 3" 28


EureKalc 3

d G.M G.M
- =
dr r r2

4.6. Applying a function to both members of an equation

The contextual menu of equations proposes an option called "Apply a function...". When you
choose this option, EureKalc will ask you for a function "f(x)". Type any expression containing "x"
and click the "ok" button.

That function will we applied to both sides of the equation. Look at the example above, and at the
result :

c
sin ( a + b ) = sin
d

4.7. «Replace with ...»

This is another powerful functionality of EureKalc 3. Look at the example. The first line is a variable
definition. This does not only memorize some numeric value in the E-variable ; also the expression
on the right side of the equation is associated with "E" : (m*v^2)/2

User manual for EureKalc 3" 29


EureKalc 3

Then, when the user makes a control-click on E elsewhere in the document, the contextual menu
proposes him to replace E with it's symbolic definition.

4.8. «Calculate again»

The command "Calculate again" (accessed via the contextual menu or via the "edit" menu, or with
<cmd> R) re-calculates the active expression. When should you do that ?
Look at the situation in this example :

If you would like to replace "E" by "(m*v^2)/2" in the second equation, it won't work, because the
last executed expression redefined "E" as "q*U". If you ask to "Calculate again" the first equation
you force the symbolic definition of "E" to become again "(m*v^2)/2".

User manual for EureKalc 3" 30


EureKalc 3

5. Presentation and lay-out of your pages

5.1. Lay-out blocks and their properties

Each EureKalc 3 page is divided in blocks of expressions. Blocks have several properties :
• alignment : horizontal (expressions are arranged horizontally) or vertical (expressions are
arranged veritcally : one above another).
• vertical position of expressions in the block : top, middle, bottom
• horizontal position of expressions in the block : left, middle, center
• justification (only in the case of vertical alignment) : left, right, centered, on the ʻ=ʼ sign
• Left and right borders : vertical line, bracket, accolade or nothing
When you <ctrl>-click anywhere in a block (but not on an expression), you get the contexutal
menu of that block, which lets you access all those properties.
To understand them, take a look at this example and it's explanation on the next page.

Problem 1 : circular motion

Data : r = 40 [cm] and v = 20 [m/s]

2.!.r
T = " 0.126 [s]
v
2.!.r 1
v = ! f = " 7.958 [Hz]
T T
v
! = " 50 [Hz]
r

Problem 2: gas law

Data : V0 = 20 [cm3]
S = 5 [cm2]
p0 = 1 [atm]
F = 1000 [N]

F
p1 = p0 + " 2.101 .10+06 [Pa]
S p0 . V0
! V1 = " 0.964 [cm3]
and p1
p1 . V1 = p0 . V0

V0 V1
L0 = " 0.04000 [m] and L1 = " 0.001929 [m]
S S
Finally, we get the position of the piston : ! L0 - L1 " 3.807 [cm]

User manual for EureKalc 3" 31


EureKalc 3

by clicking on the small red rectangle at the bottom of the page, you can show or hide the borders
of the blocks. her you can see the blocks of the previous example :

Horizontal Vertical block ,


block aligned left, with a left
opening accolade

Vertically
centered
Vertical
block, justified on
the equality sign,
positionned on the
left side

Positionned on
the right side

Left
justification

User manual for EureKalc 3" 32


EureKalc 3

5.2. Creating, deleting and modifying blocks

There are several ways to create a new block :


• The contextual menu of a block enables you to "Divide..." a block vertically or horizontally.
• Pressing the <Return> key in a horizontal block will divide that block horizontally at the
insertion point (or after the selected expression)
• Pressing the <Tab> key in a vertical block will divide that block vertically.
• Pressing <shift> & <Return> in a vertical block will divide that block horizontally (pressing
simply <Return> in a vertical block does not create a new block, but a new expression)
• Pressing <shift> & <Tab> in a horizontal block will divide that block vertically (pressing
simply <Tab> in a vertical block does not create a new block, but a new expression)
Expressions that are behind the dividing point (insertion point, selected expression, mousepointer)
will be moved to the new block.
To delete a block, choose "delete block", in it's contextual menu.
The width and height of blocks adjust automatically to the size of the expression they contain.
But when the borders of blocks (red lines) are visible, you may drag them with the mouse to
change the width or height of blocks.

5.3. Moving expressions

You can simply move an expression to another place (in the same block or in another block) by
dragging it with the mouse (you have to click on the "=" if it is an equation or on the main operator
or function otherwise).
You may also move the complete contents of a block (click on a empty place, between or
behind expressions) by dragging it to another block.
Do not forget that the order of appearance of expressions on a page can alter dramatically the
result of recalculations : expressions are always executed from left to right and from top to bottom,
and block after block.

5.4. Fine positioning of expressions

You can move expressions one pixel to the right, the left, the bottom or the top by selecting it and
then using the arrow keys with the shift-key pressed.

User manual for EureKalc 3" 33


EureKalc 3

5.5. Adding connectors to expressions

In some of the examples above, we have seen expressions preceded or followed by a connector,
for instance ʻ ʼ. Such connectors can be added in different ways :

• By typing ʻ=>ʼ or ʻ->ʼ or ʻ<=>ʼ or ʻ<->ʼ you get an expression that shows simply as an
independent connector : or → or or .

• You may also associate a connector to the left or to the right side of an expression, by
choosing "Connectors" in it's contextual menu. Those connectors remain associated with the
expressions even if you move or edit them.
• The contextual menu of a block lets you associate left connectors to all expressions in that
block, except the first one.
• At the bottom of the EureKalc window there are two little buttons ; « => » and « = ». They
duplicate the selected expression and associate a left connector (or they hide the left side
of the equation : see below).

In this first example, a left connector ʻ ʼ is associated to the second and third equation in line 3.

F = 25 [kN] m = 256 [t] !t = 35 [s]


F
v = a . !t et a = ! 0.098 [m/s2]
m

m . v2 m . ( a . !t ) 2 F 2 . !t 2
E = " E = " E = ! 1.495 .10+06 [J]
2 2 2.m

Instead of using connectors, we could have chosen to hide the left side of the equations (you get
that via the same "connectors" command in the contextual menu of an equation or with the "="
button at the bottom of the window) :

F = 25 [kN] m = 256 [t] !t = 35 [s]


F
v = a . !t et a = ! 0.098 [m/s2]
m
2 2 2 2
m.v m . ( a . !t ) F . !t
E = = = ! 1.495 .10+06 [J]
2 2 2.m

Last but not least, we could have done all this calculation without using the "E"-variable but putti
"=" connectors between the expressions. Notice the difference with the previous case :

User manual for EureKalc 3" 34


EureKalc 3

F = 25 [kN] m = 256 [t] !t = 35 [s]


F
v = a . !t et a = ! 0.098 [m/s2]
m

m . v2 m . ( a . !t ) 2 F 2 . !t 2
= = ! 1.495 .10+06 [J]
2 2 2.m

5.6. Show or hide the numeric result of an expression

In all three cases of the last example, we had to ask EureKalc 3 to hide the numeric result of the
second expression in line 3. That expression produces indeed a numeric result, since m, a and ∆t
are actually defined at the moment the expression is calculated (m and ∆t are defined in the first
line and a is calculated in line 2). This would normally result in displaying that numeric result
behind the expression. But here we wanted to show that result only at the end of the mathematical
development, thus after the last expression.
The automatic behavior of EureKalc is to show always the results of a simple expression (as long
as that result exists, thus if all variables are defined).
In the case of a variable definition, the result is only shown if it is a scalar or an 2 or 3-dimensional
vector. In other words, if the result is a list of more than 3 numbers, the result is not displayed.
You may change this behavior via the "Result..." option in the contextual menu of an expression.
You may also force (or forbid) the display of the result by adding a "=" (or "≠") sign at the end of
an expression when you type it or when you are editing it. For instance, typing "a=2+4≠" will put 6
into the variable a, but will not show that result.
(note : in the examples above, it was not necessary to prevent the first expression in line 3 to
display it's result, since v has no numeric value : "v" is defined in equation 1 of line 2 and it needs
"a" to be calculated; but "a" is only defined in the next expression)

5.7. Adding text to a page

There are two types of text-expressions in EureKalc 3 : a single line of text or a resizable textfield.
A line of text is used to display one or just a few words, that will be put on a single line; it's width is
automatically adjusted to the text it contains. To add a line of text, you may :
• type any text beginning with a "#" or a space (this first letter will be removed at display)
• type any text containing a few words (2 to 7 : this limit can be changed in the preferences)
A resizable textfield can resized by the user and may contains several lines of text. To add such a
resizable textfield :
• type any text beginning with "##" (this will not be displayed)
• Type any long text (containing more than 7 words)

User manual for EureKalc 3" 35


EureKalc 3

When you move the mouse pointer above a resizable textfield, a small black resizing square
becomes visible in the bottom right corner. You may drag this square to resize the textfield.
The contextual menu of a text-expression
• size : to choose the size of the characters in the text
• style : to choose the font style : bold, italic or normal
• border : put a border around a text, choose the color and line width

Note : in the present version, EureKalc does not allow you to change the font of texts. Text is
always displayed in "Times" and mathematical expressions are always in point 12. EureKalc 3 has
primarily been conceived as a calculation environment. If you need more advanced lay-out and
presentation functionalities, I suggest to use LaTex, which is specialized in the presentation of
scientific texts.
In this example (in French, sorry,) the titles and the word "Données" are lines of text. But the long
presentation text is a resizable textfield that we have adapted to the width of the page.

Problème de mécanique
Montagnes russes

Dans une des attractions de la foire du Midi à Bruxelles, un chariot est amené à une
hauteur de 30 mètres sur un rail. Sa vitesse est alors de 5 km/h. Ensuite le chariot est
lâché en roue libre (on suppose qu'il n'y a pas de frottement) et redescend jusqu'à
une hauteur de 10 mètres. Quelle est alors sa vitesse ?

Données : h1 = 30 [m]
h2 = 10 [m]
v1 = 5 [km/h]

Efinale = Einitiale

m . v2 2 m . v1 2
! + m . g . h2 = + m . g . h1
2 2

! v2 2 = v1 2 + g . h1 . 2 - g . h2 . 2

! v2 = v1 2 + g . h1 . 2 - g . h2 . 2 " 71.5 [km/h]

User manual for EureKalc 3" 36


EureKalc 3

5.8. Adding an image in a page

To add an image to a EureKalc page, just copy it from another software (for instance from your
web-browser) and paste it where you want. It works fine with most common formats : jpeg, pict, tiff,
pdf, png,... and perhaps others. Her is an example.

Dans la «!Grande boucle!»


ci-contre, le chariot atteint le
sommet de la boucle à une
vitesse de 15 m/s (54
km/h). A ce moment-là, les
passagers ont l’impression
de «!flotter en apesanteur!»
parce que la force centripète
qui est nécessaire pour les
faire tourner est exactement
égale à leur poids.
Calculez le rayon de cette
boucle.

Résolution :

Données : v = 15 [m/s]

m . v2
Equations : Fg = m . g et Fc =
r

m . v2 v2
Développement : Fg = Fc " m.g = " r = ! 22.944 [m]
r g

5.9. Printing and exporting to PDF

When the block-borders are visible (by clicking on the small red rectangle at the bottom of the
screen) and you resize the window to make it very big, you'll see two gray lines, a vertical and an
horizontal one : they show you the page-limits. Their position depends on the paper size, the
paper orientation and the print scale . To change those parameters choose "Page Setup..." in
the "File" menu. The default print scale is set to 85%.
Also in the "File" menu, you find the commands "Print..." and "Export to PDF". Many examples in
this manual (as above for instance) have been realized by exporting EureKalc pages to PDF
(others are simple screenshots).
A the present moment EureKalc can only print single pages. So don't write anything outside the
print margins if you intend to print your document. This will probably be fixed in a future version.

User manual for EureKalc 3" 37


EureKalc 3

5.10. Exporting to LaTex (still under development)

You can copy a single expression or a block of expressions to the LaTex editing environment. You
have just to select the corresponding command in the contextual menu of an expression or of a
block of expressions. The LaTex code is put in the clipboard and may then be pasted to your LaTex
editor. When you copy a block of expressions, the alignment of the expressions in LaTex will be
exactly as in EureKalc.
You can also export a complete EureKalc page as a «.tex» document, via the «File» menu. But
you have to be aware that, in the present version, the so produced LaTex document will not
respect completely the lay-out of complex EureKalc pages. As a matter of fact, blocks of
expressions will simply be placed one under another.1
Notice also that tables and graphs are not yet exportable in the present version.
Nevertheless, exporting to LaTex is already very useful for most needs. Look for instance at this
EureKalc page :

m = 5 [kg] E = 12 [kJ]
2
m.v
E = ! 1.200 .10+04 [J]
2
E.2
" v2 =
m
E.2
" v = ! 69.28 [m/s]
m

To create it, we had just to type this code :


m=5kg <tab> E=12J <return> E=m*v^2//2
The we duplicated twice the last expression and we applied two transformation rules.
The export to LaTex produces a «.tex» file containing this complicated code :
\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*} {m}={\mathrm{5} \; \mathrm{kg}} \qquad {E}=
{\mathrm{12} \; \mathrm{kJ}} \qquad \end{equation*}
\begin{eqnarray*}
{E}&=&{\displaystyle \frac{{m}\cdot{v^{\mathrm{2}}}}{\mathrm{2}}}
\longrightarrow \mathrm{1.200 x 10^{+04}} \; \mathrm{J} \\ \\
\Rightarrow \qquad {v^{\mathrm{2}}}&=&{\displaystyle \frac{{E}\cdot
{\mathrm{2}}}{m}} \\ \\ \Rightarrow \qquad {v}&=&{\sqrt
{\displaystyle \frac{{E}\cdot{\mathrm{2}}}{m}}} \longrightarrow
\mathrm{69.28} \; \mathrm{m/s}
\end{eqnarray*}
\end{document}

1To tell the truth, I have a problem. I was not able to find a way of placing tables within tables, without using the
«minipage» functionality wich needs to know the width of each block previously. If someone could help me...

User manual for EureKalc 3" 38


EureKalc 3

Once opened in LaTex and executed, that code produces the following pdf :

m = 5 kg E = 12 kJ

m · v2
E = ⇥ 1.200x10+04 J
2
E·2
⇤ v2 =
m
r
E·2
⇤ v = ⇥ 69.28 m/s
m

Not only is the graphic quality of the LaTex document very good, and very close to the original
EureKalc document, but you will have noticed the great simplicity of the EureKalc code compared
with the LaTex code. Thus EureKalc could be used as a front-end for editing equations in LaTex,
as long as you do not need other operators or functions than those provided by EureKalc.
Notice, at the third line of the LaTex code above, the inclusion of the «amsmath» package. This
package is often required for the LaTex code generated by EureKalc. When you export a complete
page, the corresponding «\usepackage» command is automatically included in the header of the
code. But when you copy only a single expression or a single block to LaTex, then the code placed
in the clipboard will only contain the actual equation (beginning with a «$» or «\begin{equation*} or
\begin{equationarray*} ) and no header, because I suppose that you are willing to paste that code
in an existing LaTex document. So, donʼt forget to add “ \usepackage{amsmath} ” in your header.
The «amsmath» package is included in most LaTex editions. otherwise, you may download it
here : http://www.ams.org/publications/authors/tex/amslatex
If you are not familiar with LaTex you access to a presentation and useful links here :
http://en.wikipedia.org/wiki/LaTeX

User manual for EureKalc 3" 39


EureKalc 3

6. More on lists, tables and graphics

A very useful functionality of EureKalc is to be able to calculate on lists of numbers. The basics of
creating lists and working with lists has already been exposed in chapter 3. Her we are going to
explain how to present lists of data in tables and graphics, how to import or export them to a file.

6.1. Tables

To display lists of numbers in a table, type :


table(<list1>, <list2>, <list3>...)
where <list1>, <list2>, etc... are any expressions that return a list of numbers. Normally, we
would suppose that those lists are of equal length, but this is not compulsory. The values are
displayed in a table, one column per list and one line per data in each list. Such a table can be
resized and, if necessary, it will display a vertical scrollbar to access all data.
In the next example the table has been obtained by typing : table(v,E_k,d)

Braking distance of a car, in function of it's speed

m = 1230 [kg] and µ = 0.8 and v = 0 : 130 : 10 [km/h]

Braking force : Fb = µ . m . g ! 9649.7 [N]

m . v2
Kinetic energy : Ek =
2

W Ek v2
Braking distance : W = Fb . d " d = = =
Fb Fb 2.µ.g

Result : v E_k d
[km/h] [kJ] [m]

0 0.0 0.00
10 4.7 0.49
20 19.0 1.97
30 42.7 4.43
40 75.9 7.87
50 118.6 12.29
60 170.8 17.70
70 232.5 24.10
80 303.7 31.47
90 384.4 39.83
100 474.5 49.18
110 574.2 59.50
120 683.3 70.81
130 802.0 83.11

User manual for EureKalc 3" 40


EureKalc 3

In the previous example, the size of the table has been adjusted to display all data. But that is not
always possible. When the number of data is too big, then the table will show a vertical scrollbar
when you move the mouse pointer over it.

When you click on the table to select it, a black resizing box appears in the bottom right corner.
You can drag this box to resize the table.

The contextual menus of tables propose some new commands that will let you :
• display a grid of vertical or horizontal lines
• show the border of the table (and choose it's color and thickness)
• choose the numeric type and precision for the numbers in each column (this applies to the
column where you <ctrlC>-click).
• choose the physical unit for displaying the numbers (<ctrl>-click on a unit) : this will
immediately recalculate the numbers displayed in the table.
• ask to export the table to a tab-delimited text file. Such a file can then be imported in another
software, like a spreadsheet.

User manual for EureKalc 3" 41


EureKalc 3

6.2. Plotting graphs

EureKalc_3 has some basic capabilities for plotting graphs with calculated date. Only line-graphs
and dot-graphs are available. For more elaborated graphs, we recommend to use specialized
software.
The syntax fort getting a graph is :
plot(<list x>,<list y1>, <list y2>, <list y3>...)
where <list x> is the list of abscissa values and <list y1>, <list y2>... are the
ordinate values. Each of those arguments may be any expression returning a list. But all of them
must have the same length.
This graph has been obtained by typing : plot(v,d1,d2)

Braking distance of a car, in function of it's speed

v = 0 : 140 : 5 [km/h] ! ( 0 , 5 , 10 , 15 , ... , 125 , 130 , 135 , 140 ) [km/h]

Friction coefficients : µ1 = 0.8 (dry weather) and µ2 = 0.6 (rainy weather)

m . v2
Braking force : Fb = µ . m . g Kinetic energy : Ek =
2

W Ek v2
Braking distance : W = Fb . d " d = = =
Fb Fb 2.µ.g

v2 v2
" d1 = and d2 =
2 . µ1 . g 2 . µ2 . g

Braking distance in function of speed


140 m
Rainy weather
Dry weather

0m v
0 km/h 140 km/h

User manual for EureKalc 3" 42


EureKalc 3

The contextual menu of each line (or of it's legend, or of it's label near the y-axis...) gives access to
the following commands :
• «Change the label...» changes the label displayed in the legend or near the axis
• «Line» lets you choose the type of line (none, full line, dotted lines)
• «Color...» lets you choose the color of the line and dots
• «Dots» lets you choose the type of dot (circle, square, triangle, etc... or none)
• «Filled or not» switches between filled dots or empty dots.
A <ctrl> - click on the abscissa-label lets you change that label
The contextual menus of the axis-scales lets you change those scales and choose the numeric
format.
The contextual menu of the central zone of the graph gives access to the following commands
• Enter or modify the title of the graph
• Choose the position of the legend (only if there is more than one list of data).
• Choose between drawing a grid (horizontal or vertical) or outer tags on the axis. You can
also choose the color of the grid.
• Export data to a file (identical to the "export" command of tables)
• Copy the graphic as an image (TIFF format) that can be pasted in EureKalc or in any other
application.
The same contextual menu, as well as the one you get when you <ctrl> click outside the central
zone of the graph, proposes also the classic commands of all EureKalc 3 expressions : border,
copy, delete, duplicate, calculate again, edit.

6.3. Importing data

EureKalc 3 can easily import data from a text file. This may be a simple list of data separated by
tabs, comma's, semi-colons, spaces or "returns". It might also be a table of data : lines separated
by "returns" and containing each the same number of data separated by another of the previous
characters. Attention : the comma may of course only be used as data separator if it is not used as
decimal separator.

The first way to import data is to use the "Import" instruction. Just type an expression like :
x=import
This expression (where x may be replaced by any variable) opens the dialog to select a file. If that
file contains a simple list of data, they are immediately stored in the variable x. If it is a table, then
another dialog will ask the number of the column to import in x. The instruction memorizes the file
path and, if necessary, the column number. Then it is displayed as follow :

User manual for EureKalc 3" 43


EureKalc 3

The advantage of this first method is that it memorizes the link between a variable and the
imported file. So a "Recalculate this page" will reload automatically the same data without showing
the dialogs.
Associating a physical unit to the data can be done indirectly. For instance, if you have a list of
time-measurements in milliseconds, you could import them as follow :
∆t=import*1ms

6.4. Managing data sets

The data sets manager is a window that lets you import data from a file or type them on the
keyboard, edit and save them as "data sets" that can be accessed at any moment. You open de
datasets manager by selecting "Manage data sets" in the "Data" menu.

To import data from a text file, click the "Import from text file..." button and select a file (see
previous point for information on file format). The contents of that file will be displayed in the
manager. So you can see the data before you actually memorize them in variables.
To edit, delete or add data manually, use the manager as a text editor. You may paste data
copied from a spreadsheet or any source. Columns are separated by <tabs>, lines by <Returns>.
So you can easily add or remove lines from the table.

User manual for EureKalc 3" 44


EureKalc 3

The two first lines of the table should indicate the variable names for the columns that will actually
be used and the corresponding units. If a column should not be used (imported in variables), then
leave the variable cell empty. If there is no unit, leave it also empty.
Cells containing text instead of numeric values are not imported. So you can use this for
comments.
Click on the "Use these data" button to confirm the actual import of data into the EureKalc
variables. Each variable will contain the list of numbers in the corresponding column.
Look at the checkbox labeled "Use column one as subscript" above the table. If this is checked,
the data are not stored as lists but as individual subscripted variables. The first column should
contain the subscripts.
Remember that variables are saved with your documents. So once you have imported variables in
EureKalc and saved your documents, all the variables are saved as well.

When some data have to be used several times, you can save them as a data set. To do so, click
on the "Save data" button and choose a name.
Once saved, a dataset may be opened again via the pull down menu (data re only loaded in the
table; to load them in the variables click on "confirm'). But you may also select it from the "Data"
menu, without even opening the dataset manager window : the data are immediately stored in the
corresponding variables, ready to use.
Finally, the command
use( <dataset name> )
may be included in any EureKalc document. It will load the corresponding data into memory each
time you re-open or re-calculate that page.

For instance, if you have to do some calculation on the movement or the gravity of some planet,
you would select the "planets" data set that comes with EureKalc. It gives you the diameters (D),
the masses (M), the perihelion (a), the aphelion (b), the mean distance to the sun (R) and the
revolution period (T) of all solar planets. Those variables are subscripted with the two first letters of
the planet name (with "te" = "terra" for the earth). Thus, if you need the mass of Venus, you have it
in variable " M_ve "
Another example data set comes with EureKalc : the "calorific capacity" of some products.
To delete (definitively !) a data set, select it an click on the "Delete" button.

User manual for EureKalc 3" 45


EureKalc 3

7. Advanced functions

7.1. Preferences

The preferences window gives access to the following options


Language : the present version of EureKalc 3 comes with French and English localization. Later in
this chapter we will discuss how to create new language files. When you open EureKalc for the first
time, the program will try to use the same language as your system language. Otherwise, English
will be the default. If you change this language in the preferences, this choice will immediately be
applied and memorized for the next time you open EureKalc.
Decimal comma : check this to use the comma as decimal separator in numbers. This choice will
be the default next time you start EureKalc (while the little "," at the bottom of the main screen is a
temporary choice).
Symbol for multiplication : you may choose what sign will be used for displaying products :
single dot (default), space, asterisk or a "big dot" (•) .
Default path for your files : when you save a document for the first time or when you "save as",
this path will be proposed. When you open EureKalc for the first time, the default path is the folder
where the EureKalc application itself is stored. Personally, I choose my desktop as default path.

7.2. Adding or changing physical units of EureKalc 3

The "Units..." command in the "Calculus" menu gives access to the units-manager window.

User manual for EureKalc 3" 46


EureKalc 3

The first field, at the top of the window, contains the list of fundamental units, used to define all
other units. These are, by default, the units of the SI (International System) : kg, m, s, A, K, mol, cd
(candela). I strongly recommend not to change them...
All units are listed in a table. When you click on a line, the unit is selected and it's characteristics
are displayed below, in fields where you can edit them.
The little arrows on the right side of the table let you move the selected unit upwards or
downwards. The order of units of a same type is important because it's in that order that the units
will appear in the contextual menu's. Each time you open the units-manager, units of a same type
will be grouped.
The "—" and "+" buttons let you add or delete a unit. When you create a new unit, you have to
specify :
• The symbol of the unit ("kN", for "kilo-newton" in the example above). Attention : units are
case-sensitive : mJ and MJ are different units !
• It's physical dimensions : a list of fundamental units, separated by spaces and eventually
followed by a number (their power). For instance, force units have dimension : kg m s-2
• The multiplier : that is the number by which the basic unit (the one you specified in
"dimensions") should be multiplied to get the unit you are defining. For instance, the
multiplier for, «kN», is 1000 (or 1e3). For «km/h», the multiplier is 0,277777777 (because
1km/h = 0,277777777 m/s)
• When the conversion of a unit can not be done by a simple multiplication, you have to
define it's conversion function. At this moment, the only units using a conversion
function are °C and °F, because you cannot convert Kelvin to °C or °F by a simple

User manual for EureKalc 3" 47


EureKalc 3

multiplication. The conversion function for °C is "x-273.15". The inverse function must also
be specified : "x+273.15".
The row of buttons at the bottom of the window let you create quickly common multiples of the
selected unit : centi, milli, micro... kilo, mega, giga...
Close the window when you are finished : this will confirm all changes.
Here is the complete list of units in EureKalc version 3.0

Mass mg, g, kg, t

Time, duration fs, ps, ns, µs, ms, s, min, h, d (jour), an (année)

Frequency, angular velocity Hz, kHz, MHz, GHz, THz

Angle rad, deg

Distance, length nm, µm, mm, cm, dm, m, km, al

Area mm2, cm2, dm2, m2, km2, a, ha, ca

Volume mm3, cm3, dm3, m3

Speed, velocity m/s, cm/s,km/h

Acceleration m/s2

Force N, kN

Pressure Pa, kPa, bar, mbar, atm

Energy, work mJ, J, kJ, MJ, GJ, eV, keV, MeV, GeV, TeV

Power mW, W, kW, MW, GW

Electric charge nC, µC, mC, C

Electric current A, mA

Electric potential, voltage mV, V, kV, MV

Electric field V/m, N/C

Resistance ohm

Capacitance µF, mF, F

Magnetic field, magnetic induction µT, mT, T, G

Magnetic flux µWb, mWb, Wb

Temperature K, °C, °F

Chemical amount of substance mol

Luminous intensity cd

7.3. For audacious users only : adding or changing algebraic rules

The algebra rules are the heart of the symbolic calculation of EureKalc 3. As a simple user, you
should not change them. Of course, you can try to experiment, but I strongly recommend to work
on a copy of EureKalc !

User manual for EureKalc 3" 48


EureKalc 3

To access the algebraic rules, ask "Rules of algebra" in the "Calculus" menu. A message will
remind you of the dangers ! Then you get a window with a large table of five columns and some
buttons.

Each line of the table is a rule (except white lines and lines beginning with a "#" : that are
comments). There are 3 types of rules, specified by the letter in the first column :
• Automatic rules. They are marked with an "A" in column one. Those rules are applied
automatically on every expression or part of expression, every time you input, edit or alter in
any way some expression. For instance, the rule that replaces "x*0" by "0" is an automatic
rule.
• Manual rules. They are marked with an "M" or (usually) they are not marked at all in column
one. Those rules are the one EureKalc proposes in the contextual menus of expressions and
will only be applied when the users asks so. For instance, the rule that transforms (a.x+b.x)
into (a+b).x is a manual rule.
• Simplifying rules. They are arked with an "S". Those rules may be applied manually (they
appear in the contextual menus) or automatically, when the user asks to "Try to simplify" an
expression. In that case, all simplifying rules that apply in the context will be executed. An
example is the transformation of x2.x into x3.
The second and the third column contain the general form of the expression before and after
applying the rule. Those expression must respect the following codes :
• a letter represents any expression. For instance ʻa+bʼ represents any sum of two terms.
• a letter preceded by a "%" represents any numeric value. For instance ʻa*%xʼ represents
any multiplication where the second factor is a number (not a variable).
• a letter preceded by a "&" represent "all other" terms or factors of a sum, product or vector.
For instance, ʻa*b+a*c+&dʼ represents a sum where at least two terms are products having a
common "a" factor ("a" may be anything); ʻ&dʼ represents all other terms of that sum
(perhaps &d can be empty).

User manual for EureKalc 3" 49


EureKalc 3

• the functions ʻaddition( )ʼ and ʻproduct( )ʼ let you write sums and multiplications as functions
instead of operators. This is necessary when the transformed expression contains the sum
or product of "all other" terms or factors. For instance, the very first automatic rule is the one
that transforms "&x+0" into "addition(&x)". It would not have been possible to write this rule
without using the "addition( )" function. Beware not to mix up "addition" with the "sum( )"
function that computes the sum of elements of a list.
The fourth column is the name of the rule. For automatic rules, this name has no importance. But
for the other rules this name will have to appear as an entry of the language files. The translation
will be used in the contextual menu. If the rule name is not found in the localization files, then the
name itself will be used in the menu. The same name may be used for several rules. See later in
this chapter, more information on language localization.
The fifth column ("cible", which means "target" in French) tells EureKalc where the user will have
to click for that rule to appear in the contextual menu of an expression. It a list of symbols
separated by spaces. The symbols may be "1", "0" or any variable appearing in the definition of the
expression to transform. To understand how this code works, the simplest way is to look at a
concrete example. Consider the following factorization rule :

# # t*&x+t*&y ## ➞# # t*(product(&x)+product(&y))
On the left we have a sum of two products, each containing a common "t" factor. On the right the
common factor is multiplied by the sum of the two remaining products). One could for instance
apply that rule in this circumstance :

# # sin(x)*x^2+3*x*sin(x) # # ➞# # sin(x)*(x^2+3*x)

Now, we would like this factorization rule to appear in the contextual menu if the user clicks on the
sum (the "+" sign) or if he clicks on the common factor ("sin(x)") but not when he clicks on any
other element of that expression. In this case, the target code in column 5 would be : " 1 0 t "

+ 1 (show the rule if the user clicks here)

* * 0 (don't show the rule if one clicks at this level)

t &x t &y t (show the rule if one clicks on ʻtʼ)

The first letter of the target-code concerns the highest level of the expression (the sum), the
second letter concerns the next level (the two products) and the third letter concerns the factors of
those products. A "1" means "show the rule in the menu", a zero means "don't show the rule" and a
variable name mean "show the rule only if the user clicked on that variable". An empty target-code
is the same as a "1" : the rule will be proposed if the user clicked at the highest level of the
expression.
In the last column you can add some supplementary conditions. The rule will only be applied (or
proposed) if all conditions are true. Each condition is written in the same form : a variable name
(used in the expression in column 2), a space, and a condition code. Several conditions are
separated by spaces.
Here are he allowed condition codes :
• negative : after a numeric value, means this value must be negative
• positive : after a numeric value, means this value must be positive
• even : after a numeric value, means this value must be even

User manual for EureKalc 3" 50


EureKalc 3

• uneven : after a numeric value, means this value must be uneven


• integer : after a numeric value, means this value must be integer
• evalreal : after a variable, means the correspondig expression must have a numeric result
• var : after a variable, means this should really be a variable, not any complicated expression.
The best way to understand the working of algebra rules in EureKalc is to take some time to look
and to understand some of the 200 build-in rules.

7.4. Translate EureKalc in another language

EureKalc 3.ß.01 comes with English and French localization. If you speak another language,
please help me to translate EureKalc ! It's easy. Just do the following :
1. Quit the application
2. In the Finder, do a «ctrl-clic» on the EureKalc icon and ask «Show the contents of the bundle»
3. In the new window, navigate to "Contents", then "MacOS", then "Data".
4. Find the file named "languages.txt". Open it with TextEdit and add a line with the language
code, a comma and the language name. If the language is one of the following : English,
French, German, Spanish, Italian, Portuguese, Chinese, Japanese, Korean, Dutch, you should
use this codes : en, fr, de, es, it, pt, zh, ja, ko, nl (that are the internal system codes used by
OSX : so EureKalc will recognize that system language on startup). For instance, if you create a
Dutch localization, you would add this line : "nl,Nederlands". Save and close the file.
5. Now find the files named «strings_XX.txt», where XX is a language code. Choose one of them
(the language you best understand), duplicate it and change it's name into «strings_YY.txt»,
where YY is the code of the new language.
6. Open the file «strings_YY.txt» you just created with TextEdit que vous venez de créer. Ignore
the lines beginning with "#" (or translate them if you like). In all other lines, translate the second
part of the line, after the "\" sign. Do not change anything before the "\" on each line and don't
erase the "\". Save and close.
7. Do the same with the «const_XX.txt» files : duplicate one, rename in «const_YY.txt» and
translate the fourth item in each line (each line contains four items separated by tabs). Don't
erase the tab !
8. When you are finished, please send me (nicohirtt@me.com) the two files (strings and const) so
I can include them in the EureKalc distribution.

User manual for EureKalc 3" 51

S-ar putea să vă placă și