Gas Law

Set V:   
Set T:   
Set N:   

Init

Test the hard-sphere model to see if it obeys the ideal gas law.  The pressure is calculated using the change in momentum due to collisions and averaged over 100 time steps to reduce statistical fluctuations.   The script performs an isothermal compression whenever the volume is changed so compression heating does not take place.


Script Example (Partial)

<script language="JavaScript">
function setVol(v){
    newVol=eval(v);
    if(newVol<110){
        alert("Volume cannot be less than 110.");
        document.dataForm.volField.value=110;
        newVol=110;
    }
    document.Molecular.setVolumeIsothermal(newVol,10);
}

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

function setNum(n){
    newNum=eval(n);
    document.Molecular.setParticles(newNum);
}
</script>