Getting started
Basic calculations
Symja can be used to calculate basic stuff:
To submit a command to Symja, press Shift+Return in the Web interface or Return in the console interface. The result will be printed in a new line below your query.
Symja understands all basic arithmetic operators and applies the usual operator precedence. Use parentheses when needed:
The multiplication can be omitted:
But function f(x)
notation isn’t interpreted as f*(x)
Powers expressions like 34 can be entered using ^:
Integer divisions yield rational numbers like 46 :
To convert the result to a floating point number, apply the function N
:
For integer number bases other than 10
the ^^
operator can be used. Here’s an example for a hexadecimal number:
The number can be converted back to hexadecimal form with the BaseForm
function:
Symbols with upper and lower case characters
Functions are applied using an identifier and parentheses (
and )
.
In general an identifier is a user-defined or built-in name for a variable, function or constant.
Only the identifiers which consists of only one character are case sensitive. For all other identifiers the input parser doesn’t distinguish between lower and upper case characters.
For example: the upper-case identifiers D, E, I, N,
are different from the identifiers d, e, i, n
, whereas the functions like Factorial, Integrate can be entered as factorial(100)
or integrate(sin(x),x)
.
If you type SIN(x)
or sin(x)
, Symja assumes you always mean the same built-in Sin function.
Symja provides many common mathematical functions and constants.
For example Log calculates the natural logarithm for base E. Log2 and Log10 are variants for logarithm to the bases 2
and 10
.
When entering floating point numbers in your query, Symja will perform a numerical evaluation and present a numerical result, pretty much like if you had applied N.
Complex numbers
Of course, Symja has complex numbers and uses the equation:
√−1=I
In Symja the imaginary unit is represented by the uppercase letter I:
Abs calculates absolute values for complex numbers:
Symja can operate with pretty huge numbers:
(! denotes the factorial function.) The precision of numerical evaluation can be set:
Division by zero is forbidden and prints the message Power: Infinite expression 1/0 encountered.
Other expressions involving Infinity
are evaluated:
In contrast to combinatorial belief, {0}^{0}
is undefined and prints the message Power: Indeterminate expression 0^0 encountered.
:
The result of the previous query to Symja can be accessed by %:
In the console available functions can be determined with the ?
operator
Documentation can be displayed by asking for information for the function name.
Tutorial
The following sections are introductions to the basic principles of the Symja language. A few examples and functions are presented. Only their most common usages are listed; for a full description of their possible arguments, options, etc., see their entry in the “function reference” of built-in symbols.
- Symbols and assignments
- Comparisons and Boolean logic
- Strings
- Lists
- The structure of things
- Functions and patterns
- Control statements
- Scoping
- Plotting graphs and functions
- Curve sketching
- Linear algebra
- Semantic import and Datasets