Skip to content

Instantly share code, notes, and snippets.

Jason K. Moore moorepants

Block or report user

Report or block moorepants

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@moorepants
moorepants / Redox.r
Created Dec 4, 2010
Yumi's data analysis in R
View Redox.r
# bring in the data
Redox = read.csv('Redox.csv', header=TRUE)
print(names(Redox))
# make an example plot for iron, PH average
ironsub = subset(Redox, trt == "High Fe(II)" | trt == "Low Fe(II)")
xlim = range(Redox$day, na.rm=TRUE)
ylim = range(Redox$pH, na.rm=TRUE)
@moorepants
moorepants / test.r
Created Dec 7, 2010
shows how to loop through a subset of columns
View test.r
Redox=read.csv('Redox.csv', header=TRUE)
col = c("pH", "mmol.DOC", "SUVA", "mmol.fe2")
newRedox = Redox[col] # removes columns not in col
for(item in newRedox) # for each column in newRedox
{
ylim = range(item, na.rm=TRUE)
xlim = range(Redox$day, na.rm=TRUE)
@moorepants
moorepants / gist:1007366
Created Jun 3, 2011
Basic Matlab Animation
View gist:1007366
t = 0:0.001:1000;
x = cos(t);
y = sin(t);
fig = figure();
ax = axes();
hold on
dot1 = plot(x(1), y(1));
dot2 = plot(1.5 * x(1), 1.5 * y(2));
hold off
@moorepants
moorepants / gist:1098315
Created Jul 21, 2011
Aurelia's pydy code
View gist:1098315
from sympy import *
from sympy.physics.mechanics import *
theta, phi, omega, alpha = dynamicsymbols('theta phi omega alpha')
thetad, phid, omegad, alphad = dynamicsymbols('theta phi omega alpha', 1)
gravity = symbols('gravity')
m, l = symbols('m l')
I1, I2, I3 = symbols('I1, I2, I3')
@moorepants
moorepants / gist:1100050
Created Jul 22, 2011
problem that hangs in pydy
View gist:1100050
from sympy import *
from sympy.physics.mechanics import *
# the unknown steer torque
Tdelta = dynamicsymbols('Tdelta')
# constants we measure on the bicycle
d, ds1, ds3 = symbols('d ds1 ds2')
c = symbols('c')
@moorepants
moorepants / vimstuff
Created Sep 15, 2011
vim settings for luke
View vimstuff
this is my html file that i keep in .vim/after/ftplugin
-------------------------------------------------------
set tabstop=2 " hard tab shows up as 2 spaces
set shiftwidth=2 " autoindent and >> make 2 spaces
set textwidth=79 " wrap lines after 79 characters
this is my vimrc
----------------
@moorepants
moorepants / whipple_transfer_functions.py
Created Feb 8, 2012
Whipple Model Transfer Functions
View whipple_transfer_functions.py
#!/usr/bin/env python
# This script calculates the numerators and denominator polynomials of the
# Whipple bicycle model tranfer functions as a function of the canonical matrix
# entries given in Meijaard2007.
import numpy as np
import matplotlib.pyplot as plt
from sympy import Symbol, Matrix, symbols, eye, zeros, roots, Poly
import uncertainties as un
@moorepants
moorepants / convert_cite.txt
Created Aug 8, 2012
vim command to convert my Sphinx citations to sphinxcontrib-bibtex format
View convert_cite.txt
%s/\[\(\w*\d\d\d\d\w*\)\]_/:cite:`\1`/gc
@moorepants
moorepants / readonly.py
Created Aug 16, 2012
read only property
View readonly.py
class MainClass(object):
@property
def name(self):
if self.__class__ is MainClass:
return name
else:
#dont return, give error or warning
raise StandardError
@moorepants
moorepants / bicycle.bib
Created Aug 29, 2012
dissertation bib file
View bicycle.bib
% This file was created with JabRef 2.8.1.
% Encoding: UTF8
@ARTICLE{Astrom1976,
author = {{\AA}str{\"o}m, Karl Johan and K{\"a}llstr{\"o}m, Claes},
title = {Identification on Ship Steering Dynamics},
journal = {Automatica},
year = {1976},
volume = {12},
pages = {9–22},
You can’t perform that action at this time.