Skip to content

Instantly share code, notes, and snippets.

@orzelc
orzelc / tape_sim_2.py
Created January 18, 2014 18:42
VPython mock-up of the attraction between two charged pieces of tape, used in intro E&M labs, representing the tapes as charged balls hung from strings.
from visual import *
# Constants and other definitions
e=1.6e-19
k=9e9
g=9.80
length=0.21
height=0.3
sep=0.1524
mass=0.0003
@orzelc
orzelc / tape_sim_toy.py
Created January 18, 2014 18:51
VPython mock-up of charged tape problem as a mass-on-a-spring, because the equations are easier to deal with.
from visual import *
# Constants and other definitions
e=1.6e-19
k=9e9
g=9.80
length=0.21
height=0.3
sep=0.1524
mass=0.0003
from visual import *
from math import *
g=9.80
size=0.3
mass=1000
distance=6000
startvel=0
drag=0.5
@orzelc
orzelc / blackbody2.py
Created May 26, 2015 12:42
Crude Blackbody Monte Carlo
from visual import *
from visual.graph import *
from random import random
strength1 = 0.01
strength2 = 0.0001
prob2=1-strength2
prob1=prob2-strength1