electromagnetic simulation code using numpy/scipy