Skip to content

Instantly share code, notes, and snippets.

jstults

Block or report user

Report or block jstults

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
@jstults
jstults / multi_scatter.R
Created Jan 21, 2013
example of small multiple scatter plots and marginal densities in R
View multi_scatter.R
ninputs = 3 # across the columns
noutputs = 2 # down the rows
iin = c(1,2,3) # indices for the inputs
jout = c(4,5) # indices for the ouputs
# example data frame:
npoints = 2**14
data.set = data.frame(X1=rnorm(npoints), X2=rnorm(npoints), X3=rnorm(npoints))
data.set = transform(data.set, X4=X1*X2+0.1*X3**2, X5=2*X2+X1+0.1*X3**2)
# the width/height are set by \showthe\columnwidth \textheight in latex
@jstults
jstults / octet.py
Created Dec 21, 2012
functions for generating mged (BRLCAD) commands to make octet truss primitives
View octet.py
#
# http://www.variousconsequences.com/2012/12/octet-truss-for-topology-optimization.html
#
import scipy as sp
class rcc_shape():
def __init__(self, name, origin, height, radius):
self.name = name
self.origin = origin
self.height = height
@jstults
jstults / octet_volfrac_array.py
Created Dec 21, 2012
generate octet truss array with varying member radius, and generate a part based on a variable density solution from ToPy
View octet_volfrac_array.py
#
# http://www.variousconsequences.com/2012/12/octet-truss-for-topology-optimization.html
#
import scipy as sp
import cPickle
import octet
if __name__ == "__main__":
import os
@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
@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: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 | |
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 / 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
@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 / 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))
You can’t perform that action at this time.