GithubHelp home page GithubHelp logo

modsimpy-notes's Introduction

ModSimPy Notes

Notes on Modeling and Simulation in Python. A copy of the book is included in this repository as ModSimPy3.pdf, and was downloaded from Green Tea Press.

Pre-Requisites

  1. Install git (if not already installed)
  2. Install Miniconda (for conda command)

Getting Started

  1. Clone the repository (using commit c36a47)

    git clone https://github.com/AllenDowney/ModSimPy
    
  2. Create conda environment

    conda env create -f environment.yml
    
  3. Activate newly created conda environment

    conda activate ModSimPy
    

Chapter 1: Modeling

Modeling

Starting from the lower-left corner of the above diagram, and navigating clock-wise:

  • System - something in the real world we're interested in studying.

  • Abstraction - often the system is complicated, so we have to remove details.

  • Model - the result of abstraction. A description of the system with only the essential details.

  • Analysis & Simulation - model can be represented in diagrams and equations, and implemented in a computer program.

  • Prediction, Explanation, or Design - the result of analysis and simulation might be a prediction about what the system will do, an explanation of why it behaves the way it does, or a design intended to achieve a purpose.

  • Validate - validate predictions and test designs by taking measurements from the real world and comparing the data we get with the results from analysis and simulation.

  • Often simpler models are best

  • Iterative Modeling

    1. Start with a simple model, even if it is likely to be too simple.
    2. Test whether it is good enough for its purpose.
    3. If not good enough for it's purpose, then gradually add features, starting with the ones you expect to be most essential.
  • Internal Validation - Comparing results of successive models can catch conceptual, mathematical, and software errors. By adding and removing features, you can tell which ones have the biggest effect on the results, and which can be ignored.

  • External Validation - Comparing results to data from the real world is generally the strongest test.

Chapter 2: Bike Share

See chap2.py.

python chap2.py

chap2.py results

Chapter 3: Iterative Modeling

The process we use to make models less wrong.

Exercise: Make a list of ways this model is unrealistic.

Questions to Drive Exercise:

  • What assumptions is the model based on?
  • What are the differences between the model and the real world?

Iterative Modeling

  1. Start with a simple model
  2. Identify the most important problems
  3. Make gradual improvements

Deterministic vs Stochastic Models: Deterministic - predictable; do the same thing every time they run Stochastic - un-deterministic, un-predictable, and random behavior

Metrics - Statistics that quantify how well the system works are called metrics.

modsimpy-notes's People

Contributors

gbroques avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.