View source: R/stat.mech.functions.R
boltz.fac | R Documentation |
This function computes a Boltzmann factor
boltz.fac(energy, Temp, logQ = F)
energy |
an energy, scaled energy or offset energy |
Temp |
temperature |
This is a function computes a Boltzmann factor.
a Boltzmann factor.
library(che302r)
num.states <- 4 # Number of PIAB states
L.box <- 50e-6 # Box length
m.particle <- 1.78e-37 # Mass of particle(s)
TT <- 77 # Temperature
N <- 2.3*N.A # Total number of particles
# PIAB energies:
e <- piab.energy(1:num.states, m = m.particle, L = L.box)
e
# Compute the scaled partition function, Z-tilde:
# PIAB energies relative to PIAB state 1:
e.tilde <- e-e[1]
e.tilde
# Compute partition function, Z:
# Boltzmann factors for each PIAB state:
bfs <- boltz.fac(e, Temp = TT)
bfs
# Sum of the Boltzmann factors is the partition function
Z <- sum(bfs)
Z
# Boltzmann factors relative to PIAB state 1:
bfs.tilde <- boltz.fac(e.tilde, Temp = TT)
bfs.tilde
# Sum to get Z-tilde:
Z.tilde <- sum(bfs.tilde)
Z.tilde
# Z-tilde repationship to Z
Z
bfs[1]*Z.tilde # Same as Z??
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.