File size: 902 Bytes
b743e81
a596f98
bcc480e
9b44ae3
dbd58af
bcc480e
 
dbd58af
bcc480e
 
dbd58af
bcc480e
dbd58af
33a3dac
 
dbd58af
33a3dac
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

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")