Falling Piston

Init

Adiabatic Compression

The temperature of an ensemble will increase if it compressed in an insulating container due to the work, P DV that is done on the gas.  The data graph shows the volume and the temperature, i.e., <KE>, of the ensemble as the piston free-falls under the action of a constant force.  The piston has 300x the mass of a single particle and the acceleration of gravity has been set to -2.0 for better visualization.

This page contains two Physlets that are able to share data using the common superclass or all Physlets, SApplet.   The ensemble in the MolecularPiston Physlet acts as a data source.  The DataGraph acts as a data listener.  In this simulation,  the ensemble delivers the state variables volume, V, and temperature, T, to the graph.  Volume is shown in red and temperature is shown in green.


Script Example

<script language="JavaScript">
function initPhyslet(){
     document.Molecular.setAutoRefresh(false);
     document.Molecular.setDefault();
     document.Molecular.setShowControls(false);
     document.Molecular.setPeriodicH(false);
     document.Molecular.createParticles(20);
     eid=document.Molecular.getEnsembleID();

     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.clearSeries(2);
     document.DataGraph.setSeriesStyle(2,true,0);
     document.DataGraph.setSeriesRGB(2,0,255,0);
     document.DataGraph.setLabelY("V & T"); 
     document.DataGraph.setLabelX("Time"); 
     document.DataGraph.setTitle("Vol and Temp vs Time"); 
     gid=document.DataGraph.getGraphID();
     document.Molecular.deleteDataConnections(); 
     document.Molecular.makeDataConnection(eid,gid,1,"time","v");  
     document.Molecular.makeDataConnection(eid,gid,2,"time","t");  

     document.Molecular.setAutoRefresh(true);
     document.Molecular.forward();
}
</script>