Theoretical physics in transportation

Install Python

The easiest way how to install all prerequisities is to use Anaconda which is available for Windows, Linux and MacOS. Download the version appropriate for your operating system, choose Python 3.x (that is, Python of version 3 or higher) and follow the installation instructions.

If you encounter any problem during installation, let me know, but only if you are one of my students, please.

Runnning jupyter notebook

After installing Anaconda, try to run the Jupyter notebook. Open the console (the way depends on your operating system) and type

  jupyter notebook
Console with command jupyter notebook

That should open your default web browser (Chrome in my case) and display the content of your disk.

Folder list in Chrome browser

Navigate to your preferred folder and create a new Python file.

You should now see something like this:

where I have already changed the default name Untitled to My first notebook. Now you can click on the line In []and type some Python command. In this example, we enter the following code:

  sum( x**2 for x in range(101) )

which calculates the sum $1^2 + 2^2 + \cdots + 100^2$. After you type the code, press Shift + ENTER which executes the code. Your window should look like this:

As you can see, the commands are entered in the cells starting with In [ number ]. After executing the code by Shift + ENTER, a new cell appears below which starts with Out [ number ] and contains the result of the calculation. I wrote a short tutorial on jupyter notebook which you might find useful.

Installing libraries

If you succeeded in installing Anaconda , you should have already almost all necessary libraries installed. We will need packages NumPy, SciPy, SymPy, matplotlib. Let us check if, for example, matplotlib is installed. Open the console and type

  cond install matplotlib

This is what happened on my computer:

Type y ENTER in order to confirm the update of existing packages:

Now you should have working and up-to-date matplotlib package working on your computer.


Last update of this page: June 05 2019 12:53:42.