Mathematical Models, Spring 2018
Installing Software
This page is for a past course. Find your current course here.
 

This page details how to get access to the software for this class.

Book Resources / GitHub
Allen Downey (the author of Modeling and Simulation in Python) has made a large number of resources available for free through GitHub. Here is how to access these resources.
  • Suggested: 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". We will learn how to use GitHub to backup the work that you do on the GitHub website. You are done with GitHub for now.
  • Alternate Solution: Download the files directly.
    • Go to http://modsimpy.com/zip. Save the files in the directory "Documents/GitHub/ModSimPy" or somewhere else where you will be able to find them easily.
    • The disadvantage of this system is that it is hard to keep your files updated or access them on different copmuters.
Python
Now that you have access to the author's code, you need to work in the most recent version of Python, currently Python 3.6.
  • Suggested: 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.
  • Suggested: 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.
  • Suggested: Open Jupyter using Anaconda.
    • Now everything is set up. Open the program Anaconda Navigator. Click on "Launch" under "Jupyter Notebook".
    • Navigate to the folder that has your files in it (probably Documents/GitHub/ModSimPy/") and into the folder "code"
    • Click on the Chapter you want to open.
    • At the top of the screen, click "File > Make a Copy...".
    • Rename this copy to be your name "chapXXname" by clicking on the notebook name at the top of the page.
    • Now you can work in the notebook.
  • Alternate Solution: Set up Azure Notebooks.
    • If you do not have access on a personal computer, you can still work from any computer through a browser window. You will need a Microsoft Account, so sign up for one if you do not have one.
    • Navigate to https://notebooks.azure.com/ and log in.
    • Click on "Libraries" and click on "+ New Library". Now go to the tab that says "From GitHub" and type in "AllenDowney/ModSimPy" in the space that says "Git repo" and type in "ModSimPy" in the Library ID to make a copy of the files on the Azure website.
  • Alternate Solution: Set up your Jupyter notebook.
    • In the Libraries Menu of your Azure Notebook Account, navigate to ModSimPy. And then the folder "code". Click on the chapter you want to open.
    • At the top of the screen, click "File > Make a Copy...".
    • Rename this copy to be your name "chapXXname" by clicking on the notebook name at the top of the page.
    • EVERY TIME you run a notebook, you will need to import the package Pint first. So click on the first cell of the notebook, and open a new cell by using the + sign in the toolbar. In this new cell type in the text
      !pip install pint
      exactly as it is here, with the exclamation point. And use "Shift-Enter" to evaluate the cell.
    • You can now continue to work in the notebook.