Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

jstults

😀
View GitHub Profile
@jstults
jstults / integrate_fs3.py
Created Feb 26, 2012
Square Root Map for Falkner-Skan
View integrate_fs3.py
import scipy as sp
from scipy.integrate import ode
from scipy.optimize import fsolve
from matplotlib import rc
rc('text', usetex=True)
tick_size = 'large'
label_size = 'xx-large'
rc('xtick', labelsize=8)
rc('ytick', labelsize=8)
rc('legend', fontsize=12)
@jstults
jstults / sketch_mar17a.pde
Created Mar 18, 2012
Sampling Arduino Pins Quickly
View sketch_mar17a.pde
/*
Sampling with the Arduino
based on examples from
http://sites.goggle.com/site/MeasuringStuff
*/
#define FASTADC 1
// defines for setting and clearing register bits
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
@jstults
jstults / os_stats.R
Created Jun 2, 2012
simple time-series analysis of android market share data
View os_stats.R
#
# do some simple time series analysis on smartphone os data
# data: http://www.catb.org/esr/comscore/
# commentary: http://esr.ibiblio.org/?p=4368
#
# this file has the market share percentages table
osdata = t(read.csv("os_stats.csv",header=TRUE,row.names=1))
# this file has the raw userbase in millions
osdata2 = t(read.csv("os_stats_2.csv",header=TRUE,row.names=1))
@jstults
jstults / basis_exp_dx.R
Created Jul 5, 2012
example 2D experimental designs using AlgDesign library
View basis_exp_dx.R
#
# experimental designs using different basis
#
library(AlgDesign)
# generate a full factorial combination of factor levels
candidates = gen.factorial(levels=c(51,51), nVars=2, center=TRUE, varNames=c("X1","X2"))
cand.2 = gen.factorial(levels=c(7,7), nVars=2, center=TRUE, varNames=c("X1","X2"))
# add columns for the orthogonal basis
candidates = transform(candidates, X1.p = poly(candidates$X1, degree=6), X2.p = poly(candidates$X2, degree=6))
@jstults
jstults / polywell_sym.R
Created Jul 28, 2012
example of a test design and mixed effect analysis for measuring polywell performance and characterizing symmetry
View polywell_sym.R
# file: polywell_sym.R
# example of a test design and mixed effect analysis for measuring
# polywell performance and characterizing symmetry
# author: Josh Stults, www.variousconsequences.com
# date: 28 July 2012
# see also:
# http://prometheusfusionperfection.com/2012/07/27/symmetry-test/
# http://cran.r-project.org/web/packages/AlgDesign/index.html
# www.stat.wisc.edu/~bates/IMPS2008/lme4D.pdf
@jstults
jstults / idopt.R
Created Aug 18, 2012
comparison of D- and I-optimal samples for a 6th order 2D response surface
View idopt.R
# compare point distributions for I and D optimal designs
# file: idopt.R
#
rm(list=ls())
library(pwr)
library(AlgDesign)
library(xtable)
dice = data.frame(var=c("x","y"), low=c(-1,-1), high=c(1,1), center=c(0,0), nLevels=111, round=4, factor=FALSE)
Ispace = gen.factorial(levels=c(111,111),nVars=2,center=TRUE,varNames=c("x","y"))/55
View gist:3853261
Authentication successful.
+-----------------------------------------+-------------------------+
| property | value |
+-----------------------------------------+-------------------------+
| name | varconcfd |
| description | |
| creation time | 2012-10-08T15:48:04.889 |
| ips | |
| INSTANCES quota usage / limit | 0.0 / 8.0 |
| CPUS quota usage / limit | 0.0 / 8.0 |
@jstults
jstults / gist:3853337
Created Oct 8, 2012
gce_first_instance
View gist:3853337
+------------------------+-----------------------------------------------+
| property | value |
+------------------------+-----------------------------------------------+
| name | my-first-instance |
| description | |
| creation time | 2012-10-08T16:10:29.342 |
| machine | n1-standard-1 |
| image | projects/google/images/ubuntu-12-04-v20120912 |
| zone | us-central1-a |
| tags | |
@jstults
jstults / gist:3853492
Created Oct 8, 2012
Ubuntu OpenFoam Config
View gist:3853492
VERS=$(lsb_release -cs)
sudo sh -c "echo deb http://www.openfoam.org/download/ubuntu $VERS main > /etc/apt/sources.list.d/openfoam.list"
apt-get update
apt-get install openfoam211 paraviewopenfoam3120
@jstults
jstults / gist:3853656
Created Oct 8, 2012
openFoam configuration test
View gist:3853656
$ icoFoam -help
Usage: icoFoam [OPTIONS]
options:
-case <dir> specify alternate case directory, default is the cwd
-noFunctionObjects
do not execute functionObjects
-parallel run in parallel
-roots <(dir1 .. dirN)>
slave root directories for distributed running
You can’t perform that action at this time.