Mathematical Models, Spring 2021
Installing Software

During this class we will be using the computer programming language Python which we will be interfacing with through Jupyter notebooks. Furthermore we will be working through some notebooks created by our book's author, Allen Downey. This page decribes how to get started with this software.

There are two ways to access Jupyter notebooks, depending on whether you want to run it on your personal computer or access it online. Accessing the materials online is simpler and makes it easier to share files with your classmates, especially when you are working on projects. On the other hand, installing it on your personal computer means that it will be available even if you are offline, and can run more seamlessly and on the faster processor of your computer. Here is how to access them in both ways.

Accessing and using Google Colab
  • Go to https://colab.research.google.com/ and make sure you are logged in with your Queens College Google account.
  • You will be editing jupyter notebooks provided for you on our course content page. To get a taste of what this will feel like, visit the ModSimPy Github page and click on one of the links ending in "ipynb".
  • Before you start working on a file, save your own copy of the file to Google Drive by clicking on the "Copy to Drive" button in the menu. I also suggest changing the name of the file to something like "chap01XXXX.ipynb" where XXXX is your name.
  • You're all set. You can now start using python!
OPTIONAL: Installing Python on your own computer and importing course content.
  • Install Python on your personal computer using the Anaconda Distribution.
    • Download the Anaconda Distribution installer for your operating system.
    • Run the installer that you downloaded, agreeing to the terms and clicking "Continue" as needed.
    • This will install the Anaconda Distribution on your computer and most recent version of Python.
  • Install the Python Package "Pint".
    • There is one package that we need to install on our computers that does not come standard with Anaconda. It is called pint. The easiest way to install it is from the command line, AFTER you install Anaconda.
    • Open "Terminal" on a Mac or "Command Prompt Window" on a PC. In the window that opens type:
      pip install pint
      And press enter. It will install it on your computer and be accessible each time you want it.
  • Download the course content files. There are two options.
    • Option 1: You can use GitHub (see directions below) to create and maintain an online copy of your files. This option is more intense but is the way people in industry maintain files.
    • Option 2: You can download a static copy of your files to your computer here: http://modsimpy.com/zip. Unzip the files and save them in a directory where you will be able to find them easily. This option is simpler.
OPTIONAL: Working with course content on your computer.
  • Open the program Anaconda Navigator. Click on "Launch" under "Jupyter Notebook".
  • Navigate to the folder that has your files in it and into the folder "notebooks"
  • Click on the Chapter you want to open.
  • The first time you open a notebook, make a copy of it so you'll always be able to go back! Go to "File..." and click "Make a copy." In the window that pops up, go to "File..." and "Rename", and give it a name, perhaps something like "chap01XXXX.ipynb", where XXXX is your name.
  • Now you can work in the notebook. Don't forget to evaluate the cell that imports the "modsim" package each time you open your notebook. You do not need to use the !pip install pint at the beginning of every notebook.
  • If you are creating a new notebook, always create it in this "notebooks" directory so that jupyter can find the "modsim" package.
EXPERTS ONLY: GitHub
EXPERTS ONLY: You might wish to access the course content by creating your own GitHub repo.
  • Create your own online copy of the files.
    • Sign up for a GitHub for Education account. Click on "Request a discount". At the bottom it says "New to GitHub? Create an account." Follow the steps.
    • Now make sure you are logged in to GitHub and navigate to https://github.com/AllenDowney/ModSimPy.
    • Click on the "Fork" Button on the top right, which will create your own copy of this information on your account. I suggest using the same name "ModSimPy".
  • Suggested: Download a copy of the files to your computer.
    • Next we will bring it on to your own machine. Install the program GitHub Desktop.
    • Log in with your GitHub account. Go to File > "Clone Repository" and enter in the URL for your copy of "ModSimPy". For instance, it will look like: https://github.com/mathmodelstudent/ModSimPy. Choose the name "ModSimPy" for the folder on your computer.
    • The files are now on your computer, in the folder "Documents/GitHub/ModSimPy". Then you are able to use GitHub to backup the work that you do on the GitHub website. Prof. Hanusa will not be troubleshooting your interactions with GitHub.