Skip to content

Commit

Permalink
Merge pull request #175 from sandialabs/fjc-isometric-legendre
Browse files Browse the repository at this point in the history
FJC isometric legendre tests
  • Loading branch information
mrbuche authored Apr 15, 2023
2 parents 97b8198 + ed87f78 commit 7b4f159
Show file tree
Hide file tree
Showing 8 changed files with 1,173 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polymers"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
description = "Polymers Modeling Library"
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Polymers"
uuid = "8aef037c-a721-4e8a-9d81-eb7093daef2c"
authors = ["mrbuche <[email protected]>"]
version = "0.3.0"
version = "0.3.1"

[deps]
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ function force(
end

"""
The expected nondimensional force as a function ``\\eta`` of the applied nondimensional end-to-end length per link ``\\gamma``,
parameterized by the number of links ``N_b``,
The expected nondimensional force as a function ``\\eta`` of the applied nondimensional end-to-end length per link ``\\gamma``.
```math
\\eta(\\gamma) \\sim \\mathcal{L}^{-1}(\\gamma) \\quad \\text{for } N_b\\gg 1,
Expand Down Expand Up @@ -450,7 +449,6 @@ end

"""
The nondimensional relative Helmholtz free energy per link ``\\Delta\\vartheta\\equiv\\beta\\Delta\\psi/N_b`` as a function of the applied nondimensional end-to-end length per link ``\\gamma`` and temperature ``T``,
parameterized by the number of links ``N_b``,
given by [Buche and Silberstein](https://doi.org/10.1016/j.jmps.2021.104593) as
```math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn force(number_of_links: &u8, link_length: &f64, end_to_end_length: &f64, t
BOLTZMANN_CONSTANT*temperature/link_length*nondimensional_force(&(end_to_end_length/((*number_of_links as f64)*link_length)))
}

/// The expected nondimensional force as a function of the applied nondimensional end-to-end length per link, parameterized by the number of links.
/// The expected nondimensional force as a function of the applied nondimensional end-to-end length per link.
pub fn nondimensional_force(nondimensional_end_to_end_length_per_link: &f64) -> f64
{
inverse_langevin(nondimensional_end_to_end_length_per_link)
Expand Down Expand Up @@ -98,7 +98,7 @@ pub fn nondimensional_relative_helmholtz_free_energy(number_of_links: &u8, nondi
nondimensional_relative_helmholtz_free_energy_per_link(nondimensional_end_to_end_length_per_link)*(*number_of_links as f64)
}

/// The nondimensional relative Helmholtz free energy per link as a function of the nondimensional end-to-end length per link, parameterized by the number of links.
/// The nondimensional relative Helmholtz free energy per link as a function of the nondimensional end-to-end length per link.
pub fn nondimensional_relative_helmholtz_free_energy_per_link(nondimensional_end_to_end_length_per_link: &f64) -> f64
{
let nondimensional_force = nondimensional_force(nondimensional_end_to_end_length_per_link);
Expand All @@ -116,7 +116,7 @@ pub fn equilibrium_distribution(number_of_links: &u8, link_length: &f64, normali
pub fn nondimensional_equilibrium_distribution(number_of_links: &u8, normalization_nondimensional_equilibrium_distribution: &f64, nondimensional_end_to_end_length_per_link: &f64) -> f64
{
let nondimensional_force = nondimensional_force(nondimensional_end_to_end_length_per_link);
(nondimensional_force.sinh()/nondimensional_force*(-nondimensional_force**nondimensional_end_to_end_length_per_link).exp()).powi(*number_of_links as i32)/normalization_nondimensional_equilibrium_distribution
(nondimensional_force.sinh()/nondimensional_force*(-nondimensional_force**nondimensional_end_to_end_length_per_link).exp()).powi(*number_of_links as i32)/normalization_nondimensional_equilibrium_distribution
}

/// The equilibrium probability density of end-to-end lengths as a function of the end-to-end length, parameterized by the number of links and link length.
Expand Down
347 changes: 346 additions & 1 deletion src/physics/single_chain/fjc/thermodynamics/test.jl

Large diffs are not rendered by default.

Loading

0 comments on commit 7b4f159

Please sign in to comment.