Pressure Interactions


Init

Set T Left:    Set T Right:   
Set N Left:    Set N Right:   

Change the state variables in the two ensembles and observe the interactions between the state variables.  The piston mass is 50x the particles mass.  This large piston mass produces a slow mechanical oscillation about the equal-pressure equilibrium point whenever a disequilibrium is created.  Over time, however, these oscillations will decay as the mechanical energy is converted to thermal energy.  The piston will eventually fluctuate with a Brownian-like manner about the equilibrium point.


Script Example (Partial)

<script language="JavaScript">
function setTR(t){
    newTemp=eval(t);
    document.Molecular.setTempR(newTemp);
}

function setNR(n){
    newNum=eval(n);
    document.Molecular.setParticlesR(newNum);
}

function setTL(t){
    newTemp=eval(t);
    document.Molecular.setTempL(newTemp);
}

function setNL(n){
    newNum=eval(n);
    document.Molecular.setParticlesL(newNum);
}

function initApplet(){
    document.Molecular.setAutoRefresh(false); 
    document.Molecular.setDefault();
    document.Molecular.createParticlesL(20);
    document.Molecular.createParticlesR(10);
    document.Molecular.setAutoRefresh(true); 

    document.DataTable.setAutoRefresh(false);   
    document.DataTable.setDefault();
    document.DataTable.setDataStride(1,2);
    document.DataTable.setDataStride(2,2);
    document.DataTable.setDataStride(3,2);
    document.DataTable.setSeriesLabel(1,"P Left");
    document.DataTable.setSeriesLabel(2,"V Left");  
    document.DataTable.setSeriesLabel(3,"T Left");
    document.DataTable.setSeriesLabel(4,"N Left");
    document.DataTable.sizeToFit(true);
    document.DataTable.setAutoRefresh(true);   
    tid=document.DataTable.getTableID();

    document.DataTable2.setAutoRefresh(false);     
    document.DataTable2.setDefault();
    document.DataTable2.setDataStride(1,2);
    document.DataTable2.setDataStride(2,2);
    document.DataTable2.setDataStride(3,2);
    document.DataTable2.setSeriesLabel(1,"P Right");
    document.DataTable2.setSeriesLabel(2,"V Right");  
    document.DataTable2.setSeriesLabel(3,"T Right");
    document.DataTable2.setSeriesLabel(4,"N Right");
    document.DataTable2.sizeToFit(true);
    document.DataTable2.setAutoRefresh(true);
    tid2=document.DataTable2.getTableID();

    document.Molecular.deleteDataConnections(); 
    eid=document.Molecular.getEnsembleLeftID();
    cid=document.Molecular.makeDataConnection(eid,tid,1,"pt+pr+pb+pl","0"); 
    document.Molecular.setConnectionSmoothing(cid,100);
    document.Molecular.makeDataConnection(eid,tid,2,"v","0");  
    document.Molecular.makeDataConnection(eid,tid,3,"t","0"); 
    document.Molecular.makeDataConnection(eid,tid,4,"n","0"); 

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