This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from datetime import datetime | |
import matplotlib.pyplot as plt | |
#get the csv lines as strings | |
lines = list(open('hussieout.csv')) | |
lines = lines[:-1] #remove final newline | |
#split each line on commas (hopefully there's only one per line) | |
lines = [line.split(',') for line in lines] | |
#remove whitespace at the ends of the elements (mostly--only?--just \n characters at the ends) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
from matplotlib import colors | |
import numpy as np | |
from tomIntegrate import randr | |
from time import sleep | |
NX = NY = 64 | |
figsize=(16, 16) | |
ptake = 0.001 | |
pgive = 0.0004 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from tomIntegrate import intor, randr | |
from matplotlib import pyplot as plt | |
from numpy import array, polyfit, log, exp | |
def dxdt(X, r=28.): | |
s = 10. | |
b = 8. / 3. | |
x = X[0] | |
y = X[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
returnList.py | |
_returnList.so | |
*_wrap.cxx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Really, when tuning, you have a reference note a fifth above or below the | |
# target note. But, just to show a beat-frequency effect, having the reference | |
# and target notes be about the same frequency is fine. | |
import numpy as np | |
import matplotlib.pylab as plt | |
length = 444 # make this larger if the waves shown are not very wave-like | |
resolution = 10000.0 | |
xl = list(np.arange(1, length, length / resolution)) | |
w1 = 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import exp, cos, sin | |
def print_answers(fs, fnames, W, tx=4.0): | |
for (name, f) in zip(fnames, fs): | |
print name+'(', tx, '):', f(tx) | |
print " W(", tx, "):", W(tx) | |
def n32b(): | |
f1 = lambda t: exp(float(t)) * (3.0 / 4.0 - t / 2) - exp(-1.0 * t) / 4 | |
f1p = lambda t: exp(float(t))*(1./4-t/2)+exp(-t)/4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#with open('/home/tsbertalan/bin/wordlists/nounsb.txt') as f: | |
with open('/home/tsbertalan/bin/wordlists/nouns/91K nouns.txt') as f: | |
nouns = f.read().splitlines() | |
#with open('/home/tsbertalan/bin/wordlists/adjectivesb.txt') as f: | |
with open('/home/tsbertalan/bin/wordlists/adjectives/28K adjectives.txt') as f: | |
adjs = f.read().splitlines() | |
nouns = list(set(nouns)) | |
adjs = list(set(adjs)) | |
from random import choice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def n232nondiscriminant(a,b): | |
return(b-a**2-1) | |
def n232discriminant(a,b): | |
return((a**2-b+1)**2 - 4*a**2) | |
if __name__ == "__main__": | |
stable_real_a = [] | |
stable_real_b = [] | |
unstable_real_a = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [nlist, tlist] = birthdeath(l,K,numsteps) | |
nlist =[0]; % list of numbers of transcripts at corresponding place in t | |
tlist =[0]; % list of times. drawn from bernoulli distribution. | |
evlist=[0]; % list of events. degradation is -1, transcription is 1,neither is 0. | |
t = 0; | |
n = 0; | |
ev = 1; | |
for j=[1:numsteps] | |
t = t - log(1-rand(1))/(K*n+l); | |
tlist = [tlist t]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = 10; | |
k = 1; | |
P0 = [zeros([N, 1]) ; 1]; | |
A = irreversible(N); | |
f = @(t,P)mastereqn(P,A); | |
[tvec,P]=ode45(f, [0,25], P0); | |
tvecsize = size(tvec); | |
num_timesteps = tvecsize(1); | |
% % Uncomment to check probability sums: |