Introducing Compell REPL
Compell is a newborn high-level technical computing language that can be used to solve computational problems. It natively supports multiple data entities, e.g., numbers, arrays, and matrices, and has various high-level functions. Compell can be used to do simple calculations (e.g., Addition, Subtraction, Multiplication, Division, etc.) as well as more complex computations (e.g., Matrix Inverses, Eigenvalues & Eigenvectors, Singular Value Decomposition, etc.).
Consider the following mathematical expression:
$$ 14.4 + \sin(3.3) + \ln(10) $$It could be computed in Compell by typing the following command.
Consider a more complex expression,
$$ 12 \times e^{-0.7\times 10 \times 2.2} \times \sin\left(10\times 2.2 \times\sqrt{1-0.7^2} - 20\right) $$Using Compell, it could be easily expressed as follows.
We can also work with arrays. Consider finding the cosine of four degree measurements: 0°, 45°, 90°, and 135°. This can be calculated as follows.
What if we would like to find the dot product of two vectors. We can simply do this using the dot
function,
A more concise way to do this is to use the dot product operator •
, coded as **
,
Matrices is also an important data entity that we can handle in Compell. Consider the following square matrix
$$ \begin{bmatrix} 3.3 & 1 & 5 \\ 10 & -5 & 12.2\\ 4.4 & 10 & -8 \end{bmatrix} $$This matrix can be coded into Compell as follows
Row elements are separated by commas, whereas columns are separated by semicolons. We can calculate the determinant of the last matrix using the det
function,
This is how simple it is to define a matrix and find its determinant in Compell.