Today's project will require a lot of exploratory "numerical" math. In school, you are frequently presented a neatly packaged piece of math, without much discussion of where it comes from. In reality, before a useful mathematical object receives a nice pedagogical description in your text book, it takes a few decades (or centuries) for mathematicians to wrap their heads around it. During this time, an "exploratory" approach that simply "plays" with different properties of the object is very helpful and it results in quite a bit of unearthed beauty. We will try to explore the beauty of one particularly wondrous object today: a fractal, namely the "Mandelbrot Set".
However, given that the work will be both numerical and visual, we will go through an introductory "scientific programming" and "scientific visualizations" toolbox.
We will use this "notebook" interface for most of the work. This "notebook" interface is used by many scientist and engineers for numerical work (simulations, data analysis, etc) and documentation (like the text in this paragraph). The notebook is divided in "cells". By default the cells can be filled with computer code to be executed, or they can be changed to "markdown" cells, like this one, which are filled with text and description of the calculations.
Note: To enter a cell for editing just select it and press "enter". To evaluate a cell (or render the text you wrote in it) press "shift+enter" while in the cell. To add a new cell, above or below a currently selected cell, press "esc" to exit the current cell and then press "a" or "b" to add a new cell.
Below we have a "code" cell, which can be used to evaluate programming code expressions. The last line of the cell is also printed back to you with its result.
The programming language which we will use here is called "Julia" and it is particularly good at "scientific" programming that does a lot of numerical algebra.
First, let us show how this can be used like a calculator.
π = 3.1415926535897...
You can use it to evaluate functions as well (entities that take one or more numbers and spill out another number).
We can save expression results into variables for later use.
whatever_name_I_want_for_my_variable = 5 whatever_name_I_want_for_my_variable + 2
a_shorter_name = whatever_name_I_want_for_my_variable - 3 a_shorter_name
And if we want to evaluate the same expression many times, we can create a "function", that does something to the variables and returns the result.
function my_very_important_expression(my_first_parameter, my_second_parameter) my_intermediary_result = my_first_parameter - my_second_parameter return 2*my_intermediary_result end
my_very_important_expression (generic function with 1 method)
In real code you probably will want shorter, easier to write names.
We will use a "plotting" library for our visualizations and we will introduce common ways to represent the information to be visualized on a computer.