IJulia is an interface to Julia
making it easy to issue and edit commands to pass to the Julia
"kernel."
IJulia
uses "notebooks" to organize commands. Commands are grouped together into "cells." A typical cell looks like the following:
A typical cell
A command is typed into the entry cell and is then sent to the kernel by either clicking the "play" icon, typing shift-enter
or using the "Cell -> Run" menu item.
When a cell is executed it gets a number. In the above figure, the In[1]
indicates that this was the first command the kernel was given. When a command is being executed that part looks like In[*]
. If the command has been typed but not executed, it will look like In[ ]
. Answers are labeled as Out[1]
.
Cells may contain more than one command, as the following illustrates, where a function is defined and then a plot is made.
A multi-line cell
In most uses, the last line in a cell is the value that is displayed. To arrange for more than one value to print, the different expressions can be separated by commas.
Commas are used to have more than one value output
Comments can be added to cells. Anything after a bar #
character in a line will be taken as a comment. In the following, only the value of y
is assigned.
Hash tag is for comments
The "kernel" is the name of the julia process that interprets your commands and generates the answers. At times, for various reasons the kernel may not respond. In such cases, the kernel can be restarted with the "Kernel -> Restart" menu item. The kernel has a state that reflects all the commands it has handled since being started. This need not be the same a if each cell in the notebook is issued sequentially.
When a new project is loaded or the kernel is restarted, it can be useful to run all the commands in a notebook at once from top to bottom. This can be achieved by the "Cell -> Run All" menu item.
A command to run that adds a bunch or functionality (plots, zero solving, symbolic math, ...) to Julia
is using MTH229
.
The using MTH229 command
The warning given is not an error. This package make the notation f'
find the derivative of f
, matching the usual math notation. However, this notation is already defined (in module Calculus...
) so a warning about this is issued. If you get some different output, likely the package is not yet installed. (The using
command loads packages that have been installed already. Packages are installed with the Pkg.add
function.)
Notebooks are loaded from the "Files" tab in the "Juypter" tab. A previously defined one can be loaded by clicking on the link. A new notebook can be created by the "new" drop-down menu. You have a choice of versions of Julia
for the new notebook. As of writing, use a 0.4
series. The 0.5
series may work as well.