1

If I know the positions and the speeds of each particle in a box over the time, how can I compute the entropy ?

(I`m making a simulation where I want to show that the disperion of the particles over the time increases the entropy.)

preview :

enter image description here

nb: it`s not a shower, particles are free, they are not falling...

video:

http://www.legtux.org/?page=upload&id=6184777976

code :

the code will be released when ready with some videos of real experimentations made. We have differents situations to program, not only the present one.

entropy:

on the suggestion of qftishard I computed the entropy of the simulation presents in the video,

$$S = - k_\mathrm{B} \sum p_i \ln p_i $$

(Gibbs Entropy Formula ?)

enter image description here

nb1: I didn't use gnuplot for years, so I don't remember how to add nice title, etc. I took this screenshot quickly...

nb2: I scaled the entropy from 0 to 1 on purpose. But of course I don`t have zero entropy at the beginning of the simulation.

  • we can see that the entropy is lower when the particles are not dispersed.
  • we see the maximum of entropy (with some variations) when particles are dipsersed.
  • we see that the system never get back, even close, to his initial state.
  • we see that the entropy is rising over time to reach a maximum, so we conclude our system respect the second law of thermodynamic.
  • so, I consider this simulation succeeded! thx guys.
  • What size of box, what type of particles? – Gert Nov 23 '15 at 16:45
  • 2
    You can bin-count particles and use the log definition of entropy (https://en.wikipedia.org/wiki/Entropy_(information_theory)#Definition) – AccidentalFourierTransform Nov 23 '15 at 17:03
  • @Gert so far I use $width=10$ $height=20$ – The Unholy Metal Machine Nov 23 '15 at 17:29
  • 10 and 20 what?. Potatoes? Nanometer? – Gert Nov 23 '15 at 17:52
  • @Gert it's a simulation, so there is no real units, the dimension of the particles are quite big if you compare with realistic world. I`m using some hard-disk algorithm from a book (Introduction to Computer Simulation Methods - Harvey Gould, Jan Tobochnik, and Wolfgang Christian) – The Unholy Metal Machine Nov 23 '15 at 17:57
  • @qftishard that's my problem I don't know how I do the count – The Unholy Metal Machine Nov 23 '15 at 17:58
  • 2
    @bob-theunholymetalmachine set up a 2D grid, and index each site with two integers $i,j$. Let $P_{ij}$ be the number of particles in the site $ij$, divided by the total amount of particles. The the entropy is $S~\sum_{ij} P_{ij} \log P_{ij}$. You should be able to fill in the details... – AccidentalFourierTransform Nov 23 '15 at 18:11
  • @qftishard ok I'll do what you say, and I'll show the result. – The Unholy Metal Machine Nov 23 '15 at 19:49
  • 3
    @bob-theunholymetalmachine Of course there are units in a computer simulation... if you have not set them yet for your system, go and do it!! e.g. $1 k_B T$ can be taken as unit of energy, the radius $\sigma$ of your particles as units of length (which allows you to compare its size with that of the confining box, e.g. $10\sigma,$) if the dynamics are brownian then the usual choice of units of time is the diffusion time $w$ of particles and so on! Simulation results without well defined units are utterly useless, be it for theoreticians or experimentalists. – Ellie Nov 23 '15 at 20:59
  • @Phonon I understand, eg. in my case $k_B$ is set to one. I'm intersted to show the behaviour of the system. I put most of things to one or something wich can be easily computed... The most significant is the comparaison of the dimensions of the box and the size of the particles. This project is related to some experimentation did with my classmate. We have to talk about it. So we are on our own for the simulation... we have awesome vidz of the experimentation and hope to have awesome simulation too! we want A+++ – The Unholy Metal Machine Nov 23 '15 at 21:27
  • But of course I don`t have zero entropy at the beginning of the simulation You are free to define a zero-point for entropy. – Kyle Kanos Nov 23 '15 at 23:46
  • @KyleKanos good because that's what I did. But my teacher told us that zero entropy is only when $T=0K$. Because (I guess) it's usual and practical to set the zero at $T=0K$. In my case the system isn't at $T=0K$ (I can compute $T$, but I guess it's obvious since the particles are moving) – The Unholy Metal Machine Nov 23 '15 at 23:52
  • @bob-theunholymetalmachine Glad to see you are trying to work it out on your own. Little help for your gnuplot question: to set labels just use set title "title here", similarly for the axes set xlabel "..." and save the plot instead of screenshot, using e.g. set terminal png, set output 'out.png'. – Ellie Nov 24 '15 at 01:31
  • @Phonon thx, I have to play around with gnuplot for getting several plots. – The Unholy Metal Machine Nov 24 '15 at 03:58

0 Answers0