Pressure

Small

Medium

Large

Statistical Fluctuations

Pressure is caused by molecular collisions.  On a macroscopic scale individual collisions go unnoticed because there are of the order of Avagadro's number of collisions every second.  On a microscopic scale, however, collisions manifest themselves in pressure fluctuations. (See the Brownian motion script for a examples of speed and energy fluctuations.)

This page contains three Physlets that are able to share data using a connection made by a common superclass, SApplet. The ensemble walls keep track of the change in momentum, i.e., the pressure, during each time step, dt,  and provides this data to the DataGraph Physlet and the DataTable Physlet.  The DataGraph plots the pressure on the four walls by measuring the change in momentum, dp/dt, during the animation time step, dt.  It is easy to estimate the average pressure by eyeballing the graph. The DataTable provides three different numerical values.  The first is the pressure calculated from the ideal gas law, P=NkT/V, where Boltzmann's constant is 1. The second is the pressure during a single time step.  This is the value plotted in the graph.  The third is the pressure averaged over 100 time steps.

It is instructive to compare the pressure obtained from the change in momentum with the ideal gas pressure.  Notice that the ideal gas law pressure is too low for large particles in agreement with the Van der Waals equation of state.

Script Example

`<script language="JavaScript">`
```function appletInit(s){
size=eval(s);
document.Molecular.setAutoRefresh(false);
document.Molecular.setDefault();
document.Molecular.setShowControls(false);
document.Molecular.setPeriodicH(false);
document.Molecular.setPeriodicV(false);
document.Molecular.setDefaultSize(size);
document.Molecular.createParticles(40);
eid=document.Molecular.getEnsembleID();

document.Molecular.setTemp(20);
document.Molecular.setAutoRefresh(true);

document.DataGraph.setAutoscaleX(true);
document.DataGraph.setAutoscaleY(true);
document.DataGraph.setMinMaxX(0,6.5);
document.DataGraph.setMinMaxY(-6,6);
document.DataGraph.clearSeries(1);
document.DataGraph.setSeriesStyle(1,true,0);
document.DataGraph.setSeriesRGB(1,255,0,0);

document.DataGraph.setLabelY("Pressure");
document.DataGraph.setLabelX("Time");
document.DataGraph.setTitle("Pressure vs Time");
gid=document.DataGraph.getGraphID();

document.DataTable.setDefault();
document.DataTable.setSeriesLabel(1,"N*T/V");
document.DataTable.setSeriesLabel(2,"P");
document.DataTable.setSeriesLabel(3,"<P>");
document.DataTable.sizeToFit(true);
tid=document.DataTable.getTableID();

document.Molecular.deleteDataConnections();
document.Molecular.makeDataConnection(eid,gid,1,"time","(pt+pr+pb+pl)/4");

document.Molecular.makeDataConnection(eid,tid,1,"n*t/v","0");
document.Molecular.makeDataConnection(eid,tid,2,"(pt+pr+pb+pl)/4","0");
cid=document.Molecular.makeDataConnection(eid,tid,3,"(pt+pr+pb+pl)/4","0");
document.Molecular.setConnectionSmoothing(cid,100);
document.Molecular.forward();
}
</script>```