Skip to content

Instantly share code, notes, and snippets.

__ /^\
.' \ / :.\
/ \ | :: \
/ /. \ / ::: |
| |::. \ / :::'/
| / \::. | / :::'/
`--` \' `~~~ ':'/`
/ (
/ 0 _ 0 \
\/ \_/ \/
@robclewley
robclewley / bombardier_intro.md
Last active August 29, 2015 14:17
Brief description of gamified exploratory modeling tool application, Bombardier

Bombardier's Guild is a fun steampunk-like mobile game app that I used to play a lot. Basically, you have to shoot a projectile from one planet to hit another, while navigating a static, 2D n-body problem inbetween. It's a simple setup but a highly nonlinear four-dimensional system with two free parameters. For certain configurations of the n body obstacles, trajectory designs are very hard to intuit and figure out because of chaotic parameter regions (exponentially high sensitivity of final outcome to small changes in parameters). Hence the interest in visual diagnostic tools to assist a player in deconstructing and eventually solving the game.

I was inspired to recreate some of Bombardier's core gameplay as part of a demonstration of innovative new model exploration and algorithm diagnosis tools (see screenshot demo_shot.png below)

Here, you see a trajectory that successfully hits a user-defined target, with heatmap color coding along the line segment traj

Domain:
x: [-0.7, 0.7]
y: [0, 1.0]
Full_model:
0:
density: 0.0
radius: 0.08
position: [0.0, 0.0]
1:
density: 0.5
@robclewley
robclewley / body_config.yml
Last active August 29, 2015 14:18 — forked from tonyfast/body_config.yml
Bombardier initial D3 demo
Domain:
x: [-0.7, 0.7]
y: [0, 1.0]
Full_model:
- density: 0.0
radius: 0.08
position: [0.0, 0.0]
- density: 0.5
radius: 0.04
position: [-0.2, 0.45]
@robclewley
robclewley / Scenario-local-linear.yml
Last active August 29, 2015 14:18
Literate modeling first development ideas - continued on github
scenario-metadata:
name: local linear fit
difficulty: easy
time: short
tags: graphical, ODE
Given:
- 2D, weakly nonlinear, determininstic vector field given as a black box function of (x,y) -> (f_x(x,y), f_y(x,y))
- finite, rectangular domain [x0,x1] X [y0,y1]
- Euclidean error tolerance of forward trajectories (chosen to be feasible for the given function f, unless task scenario is open to being proven inconsistent)
PyYAML
@robclewley
robclewley / README.md
Created April 7, 2015 15:37
Simulation of any-precision binary IEEE754 numbers (including > 64 bit)

A Python module to simulate binary floating point representation to IEEE 754 standards of arbitrary fixed precision, or to infinite precision

I have written a module to simulate the machine representation of binary floating point numbers and their arithmetic. Values can be of arbitrary fixed precision or infinite precision, along the same lines as the decimal class. The design is loosely based on the decimal module, although it doesn't get in to threads, for instance. You can play with different IEEE 754 representations with different precisions and rounding modes, and compare with infinite precision Binary numbers. For instance, it is easy to learn about machine epsilon, representation/rounding error using a much simpler format such as a 4-bit exponent and 6-bit mantissa. Such a format is easily defined in the new module and can be manipulated easily.

This module is intended to help teach numerical analysis and machine arithmetic.

Documentation and basic examples can be found in the docstring of simflo

@robclewley
robclewley / notebook_importing.py
Created April 15, 2015 15:54
Module to import from ipython notebooks
"""
Module directly collated from
http://nbviewer.ipython.org/github/adrn/ipython/blob/1.x/examples/notebooks/Importing%20Notebooks.ipynb
"""
import io, os, sys, types
from IPython.nbformat import current
from IPython.core.interactiveshell import InteractiveShell
def find_notebook(fullname, path=None):
"""find a notebook, given its fully qualified name and an optional path
@robclewley
robclewley / README.md
Last active August 29, 2015 14:20 — forked from nxvipin/num.py

Some numerical codes forked from swvist/num.py

Deliberately left existing tolerance calculation errors from original and deliberately introduced additional mistake in Secant method formula for purposes of testing diagnostic tools.

Do not deploy these codes!

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.