Skip to content

Instantly share code, notes, and snippets.

View tpogden's full-sized avatar

Thomas Ogden tpogden

View GitHub Profile
@tpogden
tpogden / aggregation.txt
Last active March 4, 2019 14:20
aggregation.txt
x y c
15.55 28.65 2
14.9 27.55 2
14.45 28.35 2
14.15 28.8 2
13.75 28.05 2
13.35 28.45 2
13 29.15 2
13.45 27.5 2
13.6 26.5 2
x y c
0.85 17.45 2
0.75 15.6 2
3.3 15.45 2
5.25 14.2 2
4.9 15.65 2
5.35 15.85 2
5.1 17.9 2
4.6 18.25 2
4.05 18.75 2
0.85 17.45 2
0.75 15.6 2
3.3 15.45 2
5.25 14.2 2
4.9 15.65 2
5.35 15.85 2
5.1 17.9 2
4.6 18.25 2
4.05 18.75 2
3.4 19.7 2
@tpogden
tpogden / run_notebooks.py
Last active February 7, 2023 14:02
Run a Set of Jupyter Notebooks from the Command Line
# ! python
# coding: utf-8
import os
import argparse
import glob
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
from nbconvert.preprocessors.execute import CellExecutionError
@tpogden
tpogden / .block
Last active January 26, 2017 18:41
Sieve of Eratosthenes
height: 944
border: no
@tpogden
tpogden / README.md
Last active April 4, 2016 18:45
Otimes Icon
@tpogden
tpogden / README.md
Last active April 3, 2016 18:38
Monte Carlo Integration 1

Monte Carlo integration of the function $f(x) = x^2$ on the interval $\left[ 0, 1 \right]$ on $\mathbb{R}$. The correct result is $1/3$. How close is the numerically computed result?

We sample $N = 1000$ points on the plane $(x,y) \in ([0,1], [0,1])$ and define an acceptance function

$$ A(x,y) = \begin{cases} 1 & \text{if} ~ y \leq f(x) \

@tpogden
tpogden / README.md
Last active April 4, 2016 17:45
Hermite Polynomials

Plots the first ten Hermite polynomials (physicists' definition), defined using the recursion relation.

$$ H_{n+1}(x) = 2x H_n(x) - 2 (n-1) H_{n-2}(x) $$

@tpogden
tpogden / README.md
Last active August 29, 2015 14:08
Least Squares Fit

Fits a straight line to data using the Least Squares method.

"Least squares" means that the overall solution minimizes the sum of the squares of the errors made in the results of every single equation.

Least squares function by Ben van Dyke.

@tpogden
tpogden / README.md
Last active August 29, 2015 14:08
Random Scatter

A set of 100 points are given a new uniform random distribution every 5 seconds.