Skip to content

Instantly share code, notes, and snippets.

@guyer
guyer / multipass_beer_lambert.py
Created June 8, 2012 13:40 — forked from danieljfarrell/multipass_beer_lambert.py
Fipy: Beer-Lambert law with multiple reflections
# http://matforge.org/wd15/blog
from __future__ import division
from fipy import *
# Grid things
N = 1000
D = 1
dx = D / N
m = Grid1D(nx=N+1, dx=dx) + [[-dx/2.]]
I_right = CellVariable(mesh=m, value=1., name='I_right') # Intensity along the positive direction