This file contains 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
# Dirichlet bc eliminated | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.sparse as sp | |
import scipy.sparse.linalg as spla | |
N = 64 | |
sources = [ | |
(0.3, 0.3, 15), | |
(0.7, 0.7, 25) |
This file contains 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 arbor | |
class master_recipe(arbor.recipe): | |
def __init__(self, *recipes): | |
arbor.recipe.__init__(self) | |
self.recipes = list(recipes) | |
self.setup_master_recipe() | |
### :::THIS IS THE ONLY PROBLEM::: | |
### global_properties() can not be specified up to subrecipe level | |
### which means catalogue mechanism names can not collide |
This file contains 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 json | |
import random | |
import time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
import numba | |
@numba.jit(fastmath=True, cache=True, nopython=True) | |
def simulate(transient=10, seconds=1, delta=0.015, record_every=10): |
This file contains 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
<!doctype html> | |
<meta charset="utf-8"> | |
<div id=live style='overflow-wrap: break-word; font-family: monospace'></div> | |
<script> | |
class Controller { | |
constructor(ip) { | |
this.ip = ip | |
this.connect() |
This file contains 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
# Adapted from https://hodgkin-huxley-tutorial.readthedocs.io/en/latest/_static/Hodgkin%20Huxley.html | |
%matplotlib inline | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.integrate import solve_ivp | |
C_m = 1.0 | |
g_Na = 120.0 |
This file contains 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 matplotlib.pyplot as plt | |
import numba | |
import numpy as np | |
@numba.jit(fastmath=True, cache=True, nopython=True) | |
def simulate(skip_initial_transient_seconds=0, sim_seconds=10, delta=0.005, record_every=20, | |
# Parameters | |
g_int = 0.13, # Cell internal conductance -- now a parameter (0.13) | |
p1 = 0.25, # Cell surface ratio soma/dendrite | |
p2 = 0.15, # Cell surface ratio axon(hillock)/soma |
This file contains 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 sys | |
import numpy as np | |
from PyQt5 import QtGui, QtWidgets, QtCore | |
class MainWindow(QtWidgets.QMainWindow): | |
def __init__(self): | |
super().__init__() | |
self.imshow = Grayscale() | |
self.setCentralWidget(self.imshow) | |
self.update_timer = QtCore.QTimer() |
This file contains 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 sys | |
import pyte | |
import struct | |
import select | |
import time | |
import fcntl | |
import os | |
import pty | |
import subprocess | |
import termios |
This file contains 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 os | |
import time | |
import json | |
import requests | |
import rtmidi | |
# pip install python-rtmidi | |
midi = rtmidi.MidiIn() | |
ports = midi.get_ports() |
This file contains 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 sympy as sm | |
import lark | |
parser = lark.Lark(r''' | |
%import common.SIGNED_NUMBER -> NUMBER | |
%import common.WS | |
%ignore WS | |
%ignore /\?.*\n/ | |
%ignore /:.*\n/ |