SusiePHaltmann's picture
Request to upload 5.31.22
33a3dac
raw
history blame
902 Bytes
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:
import streamlit as st
import numpy as np
L = 10 #lattice size
N = st.slider("Number of particles", 1, L**2/2, 10) #number of particles
st.write("Particle configuration:")
particles = np.random.randint(0, L, (N, 2)) #particle positions
st.write(particles)
st.title("Haltmannn Diffusion [C] 20XX")