import sys import streamlit as st st.title("Haltmannn Diffusion") st.markdown("This app simulates the diffusion of particles in a 2D square lattice with periodic boundary conditions, using the Haltmannn algorithm.") L = st.slider("Lattice size", 2, 200, 10) #size of the lattice (number of sites on each side) -> must be even! N = st.slider("Number of particles", 1, L**2/2, 10) #number of particles -> can't be more than L**2/4! (otherwise there's not enough room for them all!) #initialize the system: create a list of 'particle' objects, each with random position and velocity vectors: particles = [Particle(np.random.randint(0, L), np.random.randint(0, L), np.random.uniform(-1., 1.), np.random.uniform(-1., 1.)) for i in range(N)] #set up the plot: fig = plt.figure() #create a figure object ax = fig