Beispiel #1
0
import conedy as co

co.set("samplingTime", 1.0)




co.set("barkley_I", 0.1)



N = co.network()
N.lattice(1,1,1.0,co.barkley())


N.observeTime("output/barkley.py.single")
N.observeAll("output/barkley.py.single", co.component(0) )
N.observeAll("output/barkley.py.single", co.component(1) )
N.evolve(0.0,500.0)

Beispiel #2
0
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import conedy as co


N = co.network()

nodeblueprint = co.gaussianRoessler()
co.set("gaussianRoessler_a", 0.165)
co.set("gaussianRoessler_b", 0.2)
co.set("gaussianRoessler_c", 10.0)
co.set("gaussianRoessler_sigmaNoise", 0.1)


N.cycle(100, 4, nodeblueprint, co.weightedEdge(0.1))
N.rewire(0.1)

print "clustering coefficient:" + str(N.meanClustering())
print "mean path length:" + str(N.meanPathLength())

if N.isConnected():
    N.betweennessCentrality("N.betweenness")
    N.closenessCentrality("N.closeness")

N.randomizeParameter("gaussianRoessler_omega", co.uniform(0.8, 1.2))
N.randomizeStates(nodeblueprint, co.uniform(-0.1, 0.1), co.uniform(-0.1, 0.1), co.uniform(-0.1, 0.1))

N.evolve(0.0, 100.0)

N.observeTime("output_Roessler")
Beispiel #3
0
import conedy as co
import numpy as np

N = co.network()

co.set("outputBinary", True)
co.set("samplingTime", 0.015)

N.observeTime("output/writeBinary.py.time")

N.evolve(0.0, 10.0)
N.removeObserver()

print np.fromfile("output/writeBinary.py.time", dtype=np.float64)
Beispiel #4
0
import conedy as co
import numpy as np

N = co.network()

co.set("outputBinary", True)
co.set("samplingTime", 0.015)

N.observeTime("output/writeBinary.py.time")

N.evolve(0.0, 10.0)
N.removeObserver()

print np.fromfile("output/writeBinary.co.time", dtype=np.float64)
import conedy as co

N = co.network()

co.set("roessler_omega", 20.0)
co.set("roessler_a", 0.165)
co.set("roessler_b", 0.2)
co.set("roessler_c", 10.0)
co.set("lorenz_S", 10.0)
co.set("lorenz_r", 28.0)
co.set("lorenz_b", 8.0 / 3.0)

co.set("samplingTime", 0.01)

i = N.addNode(co.roessler())
j = N.addNode(co.lorenz())

N.addEdge(i, j, co.weightedEdge(2.5))

N.setState(i, 0.0, 0.0, 0.0)
N.setState(j, 1.0, 1.0, 1.0)

N.observeTime("output/roesslerLorenzCoupled.py.series")
N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(0))
N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(1))
N.observe(i, "output/roesslerLorenzCoupled.py.series", co.component(2))
N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(0))
N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(1))
N.observe(j, "output/roesslerLorenzCoupled.py.series", co.component(2))

N.evolve(0.0, 1500.0)
import conedy as co

co.set("samplingTime", 0.02)

co.set("hodgkinHuxley_I", 20.0)


N = co.network()
N.lattice(1,1,1.0,co.hodgkinHuxley())


N.observeTime("output/hodgkinHuxley.co.single")
N.observeAll("output/hodgkinHuxley.co.single",co.component(0))
N.observeAll("output/hodgkinHuxley.co.single",co.component(1))
N.evolve(0.0,500.0)

Beispiel #7
0
import conedy as co





N = co.network()

co.set("outputBinary", bool (1))
co.set("samplingTime" , 0.015)



N.observeTime("output/writeBinary.py.time")


#N.printNodeStatistics()

N.evolve(0.0,10.0)
import conedy as co

N = co.network()

co.set("roessler_omega", 0.89)
co.set("roessler_a", 0.165)
co.set("roessler_b", 0.2)
co.set("roessler_c", 10.0)

co.set("samplingTime", 0.01)


N.addNode(co.roessler())

#co.set("roessler_omega", 1.0)

N.setParam (0, "roessler_omega", 1.0);

N.addNode(co.roessler())


#N.addWeightedEdge(0,1,0.5)
#N.addWeightedEdge(1,0,0.5)
N.addEdge(0,1,co.weightedEdge(0.5))
N.addEdge(1,0,co.weightedEdge(0.5))



N.setState(0, 0.0,0.0,0.0)
N.setState(1, 1.0,1.0,0.0)
Beispiel #9
0
import conedy as co

N = co.network()

co.set("kuramoto_omega", 0.1)

co.set("samplingTime", 0.01)

#just one kuramoto oscillator
firstNodeNumber = N.addNode(co.kuramoto())
N.setState(firstNodeNumber, 0.0)
N.observeTime("output/kuramoto.py.one")
N.observe(0, "output/kuramoto.py.one", co.component(0))
N.evolve(0.0, 10.0)
N.removeObserver()

#adding a second. They should synchronize.
secondNodeNumber = N.addNode(co.kuramoto())
N.addEdge(firstNodeNumber, secondNodeNumber, co.weightedEdge(0.1))
N.addEdge(secondNodeNumber, firstNodeNumber, co.weightedEdge(0.1))

#small ring of oscillators. Should not synchronize.
N.setState(firstNodeNumber, 0.0)
N.setState(secondNodeNumber, 0.3)

N.observeTime("output/kuramoto.py.two")
N.observeAll("output/kuramoto.py.two")
N.evolve(0.0, 40.0)
N.removeObserver()

thirdNodeNumber = N.addNode(co.kuramoto())
import conedy as co

N = co.network()

co.set("roessler_omega", 20.0)
co.set("roessler_a", 0.165)
co.set("roessler_b", 0.2)
co.set("roessler_c", 10.0)
co.set("lorenz_S", 10.0)
co.set("lorenz_r", 28.0)
co.set("lorenz_b", 8.0/3.0)

co.set("samplingTime", 0.01)

i = N.addNode(co.roessler())
j = N.addNode(co.lorenz())

N.addEdge(i, j, co.weightedEdge(2.5))


N.setState(i, 0.0, 0.0, 0.0)
N.setState(j, 1.0, 1.0, 1.0)

N.observeTime("output/roesslerLorenzCoupled.py.series")
N.observe(i,"output/roesslerLorenzCoupled.py.series",co.component(0))
N.observe(i,"output/roesslerLorenzCoupled.py.series",co.component(1))
N.observe(i,"output/roesslerLorenzCoupled.py.series",co.component(2))
N.observe(j,"output/roesslerLorenzCoupled.py.series",co.component(0))
N.observe(j,"output/roesslerLorenzCoupled.py.series",co.component(1))
N.observe(j,"output/roesslerLorenzCoupled.py.series",co.component(2))
Beispiel #11
0
import conedy as co

fehlerzahl = 0

for combo in [("samplingTime", "blue"), ("samplingTime", 1),
              ("samplingTime", True), ("samplingTime", 10.0),
              ("odeIsAdaptive", "Horst"), ("odeIsAdaptive", 3.14),
              ("odeIsAdaptive", True), ("odeStepType", 42),
              ("odeStepType", 2.72), ("odeStepType", True),
              ("odeStepType", "gsl_odeiv_step_rk8pd"),
              ("outputPrecision", 1.41), ("outputPrecision", "Fisch"),
              ("outputPrecision", 12)]:
    try:
        co.set(combo[0], combo[1])
    except:
        fehlerzahl += 1

print "Should be 10: %i" % fehlerzahl
import conedy as co


N = co.network()

co.set("samplingTime" , 0.015)



N.observeTime("output/observeTime.py.time")


N.evolve(0.0,10.0)
Beispiel #13
0
import conedy as co

co.set("samplingTime", 10.0)
co.set("odeIsAdaptive", True)
co.set("odeStepType", "gsl_odeiv_step_rk8pd")
co.set("outputPrecision", 4)
Beispiel #14
0
import conedy as co

N = co.network()

co.set("samplingTime", 1000.0)

nodeNumber = N.addNode(co.pcoIntegrateFire())

N.observeTime("output/evolve2.py.series")
N.observe(nodeNumber, "output/evolve2.py.series")

for i in range(0, 100):  #observe the state of the node at times 0.3 * n
    N.evolve(0.03 * i, 0.03 * (i + 1))
Beispiel #15
0
#!/usr/bin/python
# coding=utf8

import conedy as co

def foo():
	N = co.network()
	N.addNode(co.lorenz())
	N.evolve(0, 100)



for i in range(0,10):
	print i
	co.set("progressVerbosity", 0.0)
#	co.set("stepSize", 0.01)
	foo()
	#N.clear()
Beispiel #16
0
import conedy as co

N = co.network()



co.set("samplingTime" , 1000.0)



nodeNumber = N.addNode(co.pcoIntegrateFire())


N.observeTime("output/evolve2.py.series")
N.observe(nodeNumber, "output/evolve2.py.series")


for i in range (0, 100):                  #observe the state of the node at times 0.3 * n
	N.evolve ( 0.03 * i, 0.03 *( i+1))
Beispiel #17
0
import conedy as co

fehlerzahl = 0

for combo in [
	("samplingTime", "blue"),
	("samplingTime", 1),
	("samplingTime", True),
	("samplingTime", 10.0),
	("odeIsAdaptive", "Horst"),
	("odeIsAdaptive", 3.14),
	("odeIsAdaptive", True),
	("odeStepType", 42),
	("odeStepType", 2.72),
	("odeStepType", True),
	("odeStepType", "gsl_odeiv_step_rk8pd"),
	("outputPrecision", 1.41),
	("outputPrecision", "Fisch"),
	("outputPrecision", 12)
	]:
	try:
		co.set(combo[0], combo[1])
	except:
		fehlerzahl += 1

print "Should be 10: %i" % fehlerzahl
Beispiel #18
0
import conedy as co

co.set("samplingTime", 1.0)

N = co.network()

newNodeNumber = N.addNode(co.logisticMap())
N.setState(newNodeNumber, 0.3)
N.observe(newNodeNumber, "output/observe.py.series")

N.evolve(0.0, 1000.0)
Beispiel #19
0
import conedy as co


N = co.network()

co.set("lorenz_S", 10.0)
co.set("lorenz_r", 28.0)
co.set("lorenz_b", 8.0/3.0)
co.set("samplingTime" , 0.01)


N.addNode(co.lorenz())
N.setState(0, 1.0, 1.0, 1.0)
N.observeTime("output/lorenz.py.series")
N.observeAll("output/lorenz.py.series", co.component(0))
N.observeAll("output/lorenz.py.series", co.component(1))
N.observeAll("output/lorenz.py.series", co.component(2))


N.evolve(0.0,1500.0)
Beispiel #20
0
import conedy as co

N = co.network()

co.set ("samplingTime" , 1.0);

for i in range (0,100):
	N.addNode(co.logisticMap())

N.randomizeStates(co.logisticMap(), co.constant (0.4))
N.observeSum("output/observeSum.py.sum")

N.evolve(0.0,100.0)

Beispiel #21
0
import conedy as co

N = co.network()

co.set("kuramoto_omega", 0.1)

co.set("samplingTime", 0.01)


#just one kuramoto oscillator
firstNodeNumber = N.addNode(co.kuramoto())
N.setState(firstNodeNumber, 0.0 )
N.observeTime("output/kuramoto.py.one")
N.observe(0,"output/kuramoto.py.one", co.component(0))
N.evolve(0.0,10.0)
N.removeObserver()


#adding a second. They should synchronize.
secondNodeNumber = N.addNode(co.kuramoto())
N.addEdge (firstNodeNumber,secondNodeNumber  ,co.weightedEdge(0.1))
N.addEdge (secondNodeNumber, firstNodeNumber ,co.weightedEdge(0.1))





#small ring of oscillators. Should not synchronize.
N.setState(firstNodeNumber, 0.0 )
N.setState(secondNodeNumber, 0.3 )
import conedy as co


N = co.network()



co.set("ornUhl_drift" , 0.2)
co.set("ornUhl_diffusion" , 0.1)
co.set("samplingTime", 0.1)


N.addNode(co.ornUhl())
N.setState(0, 1.0)
N.observeTime("output/sdeIntegrator.py.series")
N.observeAll("output/sdeIntegrator.py.series", co.component(0))
N.evolve(0.0,15000.0)




# to calculate the variance of the ornstein-uhlenbeck
# the variance should be diffusion^2/(2*drift)
file = open('output/sdeIntegrator.py.series')
sum = 0
s2 = 0
n = 0
for line in file:
	fl = float(line.split()[1])
	sum += fl
	s2 += fl*fl
import conedy as co
N = co.network()
co.set ("roessler_a", 0.22)
co.set ("roessler_b", 0.1)
co.set ("roessler_c", 8.5)
r1 = N.addNode(co.roessler())
r2 = N.addNode(co.roessler())
r3 = N.addNode(co.roessler())
N.setParam(r1, "roessler_omega", 1.02)
N.setParam(r2, "roessler_omega", 1.0)
N.setParam(r3, "roessler_omega", 0.98)
N.randomizeStates (co.roessler(), co.uniform (-10.0, 10.0),co.uniform (-5.0, 5.0), co.uniform (-0.5, 1.5))
N.addEdge(r1, r2, co.weightedEdge(0.075))
N.addEdge(r2, r1, co.weightedEdge(0.075))
N.addEdge(r1, r3, co.weightedEdge(0.075))
N.addEdge(r3, r1, co.weightedEdge(0.075))
N.evolve(0.0, 100.0)
N.observeTime("roessler.dat")
N.observe(r1, "roessler.dat", co.component(1))
N.observe(r2, "roessler.dat", co.component(1))
N.observe(r3, "roessler.dat", co.component(1))
co.set("samplingTime", 0.01)
N.evolve(100.0, 200.0)

Beispiel #24
0
import conedy as co

N = co.network()

co.set("lorenz_S", 10.0)
co.set("lorenz_r", 28.0)
co.set("lorenz_b", 8.0 / 3.0)
co.set("samplingTime", 0.01)

N.addNode(co.lorenz())
N.setState(0, 1.0, 1.0, 1.0)
N.observeTime("output/lorenz.py.series")
N.observeAll("output/lorenz.py.series", co.component(0))
N.observeAll("output/lorenz.py.series", co.component(1))
N.observeAll("output/lorenz.py.series", co.component(2))

N.evolve(0.0, 1500.0)
Beispiel #25
0
import conedy as co


co.set("pcoMirollo_a" , 0.015)
co.set("pcoMirollo_b" , 0.045)


N = co.network()
N.randomNetwork(1000, 0.01, co.pcoMirollo(),co.edge())
N.randomizeStates(co.pcoMirollo(), co.uniform(0.0, 1.0))
N.observeTime("order.dat")
N.observePhaseCoherence("order.dat")
N.evolve(0.0, 1000.0)
Beispiel #26
0
import conedy as co

co.set("samplingTime", 0.02)

co.set("hodgkinHuxley_I", 20.0)

N = co.network()
N.lattice(1, 1, 1.0, co.hodgkinHuxley())

N.observeTime("output/hodgkinHuxley.co.single")
N.observeAll("output/hodgkinHuxley.co.single", co.component(0))
N.observeAll("output/hodgkinHuxley.co.single", co.component(1))
N.evolve(0.0, 500.0)
Beispiel #27
0
import conedy as co
N = co.network()
co.set ("gaussianBarkley_sigma",  0.18)

bark = co.gaussianBarkley()
bark.setState (0.0, 0.0)
N.lattice(512, 512, 1.0, bark, co.staticWeightedEdge (3.84))
N.rewire(0.001)
N.evolve(0.0, 20.0)
N.observeAll("waves.dat", co.component(0))
N.snapshot()
import conedy as co


co.set("samplingTime", 0.025)



co.set("pcoIntegrateFire_noiseFrequency", 0.0)
co.set("pcoIntegrateFire_timeDelay", 0.01)
co.set("pcoIntegrateFire_t_ref", 0.05)
co.set("pcoIntegrateFire_alpha", 0.9)


N = co.network()




rewiring = 0.5
coupling = 0.012

#n.useLatticePositioning(100,100);

N.torusNearestNeighbors(40,40,36.0, co.pcoIntegrateFire(), co.weightedEdge())

N.rewire(rewiring)

N.randomizeStates(co.pcoIntegrateFire(), co.uniform(0.0,1.0));
N.randomizeWeights(co.uniform(coupling,coupling));

N.saveAdjacencyList("output/nonconverging.py.graph");
import conedy as co

N = co.network()
i = N.addNode(co.roessler())

co.set("nodeVerbosity", 0)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 0, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"

co.set("nodeVerbosity", 1)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 1, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 2, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print"\n\n"



j = N.addNode(co.roessler())
N.addEdge(i, j, co.weightedEdge(1.0))
Beispiel #30
0
import conedy as co

N = co.network()
i = N.addNode(co.roessler())

co.set("nodeVerbosity", 0)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 0, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"

co.set("nodeVerbosity", 1)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 1, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 0)
print "nodeVerbosity = 2, edgeVerbosity = 0\n"
print "------------------------------------\n"
N.printNodeStatistics()
print "\n\n"

j = N.addNode(co.roessler())
N.addEdge(i, j, co.weightedEdge(1.0))

co.set("nodeVerbosity", 2)
co.set("edgeVerbosity", 1)
Beispiel #31
0
import conedy as co

N = co.network()

co.set("samplingTime", 0.01)
co.set("roessler_omega", 0.89)
co.set("roessler_a", 0.165)
co.set("roessler_b", 0.2)
co.set("roessler_c", 10.0)

N.addNode(co.roessler())
N.setState(0, 0.0, 0.0, 0.0)
N.observeTime("output/roessler.py.series")
N.observeAll("output/roessler.py.series", co.component(0))
N.observeAll("output/roessler.py.series", co.component(1))
N.observeAll("output/roessler.py.series", co.component(2))

N.evolve(0.0, 1500.0)
Beispiel #32
0
import conedy as co

N = co.network()

co.set("gaussianRoessler_omega", 0.89)
co.set("gaussianRoessler_a", 0.165)
co.set("gaussianRoessler_b", 0.2)
co.set("gaussianRoessler_c", 10.0)
co.set("gaussianRoessler_sigmaNoise", 1.0)
co.set("samplingTime", 0.01)

N.addNode(co.gaussianRoessler())
N.setState(0, 0.0, 0.0, 0.0)
N.observeTime("output/gaussianRoessler.py.series")
N.observeAll("output/gaussianRoessler.py.series", co.component(0))
N.observeAll("output/gaussianRoessler.py.series", co.component(1))
N.observeAll("output/gaussianRoessler.py.series", co.component(2))
N.evolve(0.0, 1500.0)
Beispiel #33
0
import conedy as co

N = co.network()


co.setRandomSeed(0)
co.set("gaussianLorenz_S", 10.0)
co.set("gaussianLorenz_r", 28.0)
co.set("gaussianLorenz_b", 8.0/3.0)
co.set("gaussianLorenz_sigmaNoise", 10.0)
co.set("samplingTime", 0.01)


N.addNode(co.gaussianLorenz())
N.setState(0, 1.0, 1.0, 1.0)

N.observeTime("output/gaussianLorenz.py.series")
N.observeAll("output/gaussianLorenz.py.series", co.component(0))
N.observeAll("output/gaussianLorenz.py.series", co.component(1))
N.observeAll("output/gaussianLorenz.py.series", co.component(2))


N.evolve(0.0,1500.0)