Sample Walk-Through

To launch a kernel from Calc and connect to it all you need to do is write "=connect()" in a Calc spreadsheet cell.

A dialog box pops up that allows you to select if you want to connect to a kernel that was previously launched from the Mathematica front end (so that the two front ends can share the same kernel and thus exchange symbols and data) or if you want to launch a new kernel for Calc.
(For more information on the kernel sharing options in CalcLink with schematic diagrams visit Kernel Sharing Options.)

Linux (Fedora 10 with Gnome and Glider theme) Vista
CalcLink

CalcLink

If you choose "New Kernel" you will get a popup that allows you to specify the kernel you want to use. In most cases you will probably just want to accept the default location of the kernel file.

Linux (Fedora 10 with Gnome and Glider theme) Vista
CalcLink

CalcLink

If the path to the selected kernel is correct and the kernel is available you get a confirmation popup (you can actually do this multiple times, for as many Mathematica kernels as you have purchased). From this point on all windows will also use the Look-and-Feel specified in an optional config file (if any is specified and if different from the default. Here we use Nimbus.)

Linux (Fedora 10 with Gnome and Glider theme) Vista
CalcLink

CalcLink

You will also get a kernel and link control window that pops up.

CalcLink

All CalcLink functions are browsable from the function wizard in Calc (all functions beginning with "Eval" below are CalcLink functions).

CalcLink

Also all Mathematica symbols (functions, options, attributes) are browsable from CalcLink. You can just press the button "Show Symbols" on the control planel or type "=showsymbols()" in a Calc cell, and you will get a popup with all Mathematica symbols along with their values.

CalcLink

The filter text field lets you quickly find the Mathematica symbols you are looking for. As you type, the list of symbols is narrowed down to those that match the strings you have typed so far. This happens instantly and "live" in front of your eyes (even Mathematica doesn't have this feature).

The following shows all Mathematica symbols
that contain "NS".
This shows all Mathematica symbols
that contain "Pi".
CalcLink

CalcLink

This shows all hypergeometric functions
in Mathematica.
These are all Mathematica symbols
that contain "Contour".
CalcLink

CalcLink

The pattern matching uses standard Perl 5 pattern matching / regular expression syntax, so you can use "\" as an escape character.

CalcLink

CalcLink

This shows all Mathematica symbols that
end with "Plot".
This shows all Mathematica symbols that contain "Plot" but don't begin with "L".
CalcLink

CalcLink

The CalcLink function evalrange lets you pass a range definition to specify the data to be used as input. Selecting a range in the worksheet, Calc highlights the selection with a red border and updates the cell range in the argument of evalrange as you drag the mouse. Here we pass a 3 x 3 matrix as an argument to Mathematica's determinant function.

CalcLink

Upon hitting "Enter", you instantly get the determinant of the matrix. (As a sidenote, all elements in the matrix are integers, and CalcLink ensures that the data is passed to the Mathematica kernel as integers, and therefore the return of the Det function is an integer again. This is the Dynamic Type Detection feature of Mathematica. CalcLink then submits the result back to Calc as an integer!)

CalcLink

CalcLink fully supports array formulas. The inverse of a non-singular 3 x 3 matrix is a unique 3 x 3 matrix again, and you compute it with CalcLink by selecting the destination cells, entering the appropriate CalcLink function, ...

CalcLink

... and upon hitting Ctrl+Shift+Return you instantly get the inverse matrix, placed in the cell range you selected.

CalcLink

Notice that the display in the Calc spreadsheet shows decimal numbers here. The inverse of an integer matrix is usually not an all-integer matrix again. Mathematica and CalcLink use rationals internally throughout, but as Calc itself can only display decimal numbers and not fractions, the display in the Calc worksheet has to be in decimals. All computations in Mathematica and CalcLink remain entirely rational and thus incur absolutely zero round-off error internally! Only the final display step incurs the conversion to decimals, never any computation!

With the same method we now compute the eigenvalues of the matrix. A non-singular 3 x 3 matrix has exactly 3 unique eigenvalues. We select the destination cell range first, enter the CalcLink function, ...

CalcLink

... and then hit Ctrl+Shift+Return and instantly get the three eigenvalues corresponding to the matrix.

CalcLink

Here we compute the three eigenvectors of the matrix. A non-singular 3 x 3 matrix has exactly 3 unique (up to normalization) eigenvectors pertaining to its 3 unique eigenvalues. Selecting the destination cell range, entering the formula ...

CalcLink

... and upon hitting Ctrl+Shift+Return we instantly get the three eigenvectors placed in the destination cells specified.

CalcLink

CalcLink lets you pop up windows with Mathematica graphics from a spreadsheet cell. Here we generate a bar chart display with Mathematica's BarChart command. Notice that the Mathematica expression used in the CalcLink function evalplotrange is just the familiar Mathematica code that we'd use in the Mathematica front-end, except when using data that is specified by using a cell range definition, we submit the expression as a pure function.

This creates a new window with a bar chart display (using 3d effects settings that are new in the Mathematica 7 kernel) of the number of days of the months and gives it a title and uses default settings for window height and width.

CalcLink

A new window pops up displaying the Mathematica bar chart graphics.

CalcLink

Unlike OpenOffice charts, the graphics are not embedded in the Calc spreadsheet, they are new popups and therefore can be freely moved around on the desktop.

CalcLink

CalcLink also has a simple front-end of its own. Its features are far inferior to the full Mathematica front-end, but it can be conviently used as a "scratch pad" front-end that consumes much less memory than the full Mathematica front-end while retaining full interactivity and connectivity with the Calc spreadsheet.

The CalcPad can be launched from a spreadsheet cell with the CalcLink function called "calcpad". When submitting "=calcpad()" from a spreadsheet cell the CalcPad pops up.

The default behavior of CalcLink is to use the SAME kernel for the Mathematica function calls submitted from Calc cells and the CalcPad (this can be changed by the user). Thus, function/symbol definitions can be made on "both sides" of the kernel, it effectively allows the user to share expressions between the two.

Here we define a variable "myvariable" from a Calc spreadsheet cell and assign the value 45.6 to it.

CalcLink

As we type the variable name in the CalcPad, we request its value.

CalcLink

Likewise, we can set up a symbol definition in the CalcPad ...

CalcLink

... and request its value from a spreadsheet cell ...

CalcLink

... and we get its value, previously defined in the CalcPad.

CalcLink

In Mathematica all expressions are hierarchical, tree-like structures. CalcLink provides an interactive expression viewer for any Mathematica expression to make it easier to understand deeply nested expression trees. Every node can be expanded or collapsed, allowing the user to interactively study only those parts of the expression tree that are of interest.

a+b+c+d+Pi
A simple expression, only one nesting level
HornerForm[x^5+x^4+x^3+x^2+x+1].
Every node has a nesting level.
CalcLink

CalcLink

Plot3D[Sin@x Cos@x,{x,-Pi,Pi},{y,-Pi,Pi}]
A very deep structure generated by Plot3D
Series[Tan@x,{x,2,6}]
A moderately deep structure generated by Series
CalcLink

CalcLink

CalcLink provides a convenient window-copy function. By simply right-clicking (or center-clicking or pressing the mouse-wheel) a new window is created containing an identical copy of the contents of the original window.

The original: Plot[Tan@x,{x,-Pi,Pi},PlotStyle->Red] The copy:
CalcLink

CalcLink

The CalcPad displays all graphics and typeset output exactly the way the Mathematica front-end would (as the latter is used as a service to the kernel that is being used). Notice the vertical lines at the poles, the fonts used in the tick labels, and the tick marks. Also notice the color-coding of the Mathematica expression (however, that is different from the color-coding used by the Mathematica front-end and can be fully customized in the menus of the CalcPad along with bracket-matching behavior.).

CalcLink

CalcLink supports most free and commercial Look-and-Feels, standard and from third-party providers.

Nimbus Standard/Ocean JGoodies Plastic 3D
CalcLink

CalcLink

CalcLink

Visual Studio 2005 JGoodies Windows JGoodies Plastic XP
CalcLink

CalcLink

CalcLink

Nimrod Squareness Tonic
CalcLink

CalcLink

CalcLink

Copyright 2008 Andreas Lauschke Consulting. All Rights Reserved.