boltz.fac: Boltzmann factor

View source: R/stat.mech.functions.R

boltz.facR Documentation

Boltzmann factor

Description

This function computes a Boltzmann factor

Usage

boltz.fac(energy, Temp, logQ = F)

Arguments

energy

an energy, scaled energy or offset energy

Temp

temperature

Details

This is a function computes a Boltzmann factor.

Value

a Boltzmann factor.

Examples

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??


npetraco/che302r documentation built on April 17, 2025, 10:34 p.m.