Skip to content

Instantly share code, notes, and snippets.

View ellisonbg's full-sized avatar

Brian E. Granger ellisonbg

View GitHub Profile
@ellisonbg
ellisonbg / 0_reuse_code.js
Created April 2, 2014 23:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import networkx as nx
import matplotlib as mat
# Builds a graphene sheet with the given number of rows and columns.
# The sheet has a defected column running through the optionally passed
# arg. Otherwise it defaults to the center.
def build_defected_graph(rows, columns, defect = 0):
g = nx.Graph()
if( columns <= 2 ):
"""Solve the 1D diffusion equation using CN and finite differences."""
from time import sleep
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
# The total number of nodes
nodx = 3
nody = 3
@ellisonbg
ellisonbg / gist:959768
Created May 6, 2011 20:58 — forked from thider/gist:956525
cranck nicholson stuck on BCs
from numpy import *
from matplotlib.pyplot import *
from time import sleep
import numpy as np
import networkx as nx
dim = [3,2]