-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Oct 4, 2024
1 parent
33e64ca
commit 8feddc4
Showing
45 changed files
with
2,112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.1.5 | ||
v0.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.1.5 | ||
v0.1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-04T09:00:41","documenter_version":"1.7.0"}} |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Accuracy · OrnsteinZernike.jl Documentation</title><meta name="title" content="Accuracy · OrnsteinZernike.jl Documentation"/><meta property="og:title" content="Accuracy · OrnsteinZernike.jl Documentation"/><meta property="twitter:title" content="Accuracy · OrnsteinZernike.jl Documentation"/><meta name="description" content="Documentation for OrnsteinZernike.jl Documentation."/><meta property="og:description" content="Documentation for OrnsteinZernike.jl Documentation."/><meta property="twitter:description" content="Documentation for OrnsteinZernike.jl Documentation."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">OrnsteinZernike.jl Documentation</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Index</a></li><li><span class="tocitem">Tutorials</span><ul><li><a class="tocitem" href="SingleCompLJ.html">First steps</a></li><li><a class="tocitem" href="HardSphereMixture.html">Hard-sphere mixture</a></li><li><a class="tocitem" href="HighDensities.html">Solving at high densities</a></li><li><a class="tocitem" href="OtherDimensions.html">Other dimensions</a></li><li class="is-active"><a class="tocitem" href="Accuracy.html">Accuracy</a></li><li><a class="tocitem" href="ThermodynamicConsistency.html">Thermodynamic Consistency</a></li></ul></li><li><span class="tocitem">Basics</span><ul><li><a class="tocitem" href="GeneralWorkflow.html">General Workflow</a></li><li><a class="tocitem" href="Potentials.html">Interaction Potentials</a></li><li><a class="tocitem" href="Systems.html">Systems</a></li><li><a class="tocitem" href="Closures.html">Closures</a></li><li><a class="tocitem" href="Solvers.html">Solvers</a></li></ul></li><li><a class="tocitem" href="Theory.html">Theory</a></li><li><span class="tocitem">Extending</span><ul><li><a class="tocitem" href="ExtendingPotentials.html">Defining your own potentials</a></li><li><a class="tocitem" href="ExtendingClosures.html">Defining your own closure</a></li></ul></li><li><a class="tocitem" href="API.html">API</a></li><li><a class="tocitem" href="FromPython.html">From Python</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Tutorials</a></li><li class="is-active"><a href="Accuracy.html">Accuracy</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="Accuracy.html">Accuracy</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/IlianPihlajamaa/OrnsteinZernike.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/IlianPihlajamaa/OrnsteinZernike.jl/blob/main/docs/src/Accuracy.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Accuracy"><a class="docs-heading-anchor" href="#Accuracy">Accuracy</a><a id="Accuracy-1"></a><a class="docs-heading-anchor-permalink" href="#Accuracy" title="Permalink"></a></h1><p>The discrete Fourier tranforms used by the <code>FourierIteration</code>, and <code>NgIteration</code> solvers to represent their continuous counterparts using first order accuracy in <span>$n$</span> dimensions and second order accuracy in three dimensions (with the trapezoidal rule). To obtain the latter accuracy, it is important that any discontinuities of the interaction potential lie on an exact multiple of <code>dr</code>. To test this, we can compute the pressure of a hard-sphere system, and compare to the exact value. Below, we compute the relative error for different values of the number of gridpoints <code>M</code>, and plot the result on a log-log-scale</p><pre><code class="language-julia hljs">using OrnsteinZernike, Plots | ||
|
||
# Make sure the discontinuity is a multiple of dr | ||
Rmax = 10.0 | ||
M_array = 10 * round.(Int, 10 .^ (range(1,4,length=20))) | ||
p = zeros(length(M_array)) | ||
ρ = 0.3 | ||
kBT = 1.0 | ||
dims = 3 | ||
pot = HardSpheres(1.0) | ||
system = SimpleLiquid(dims, ρ, kBT, pot) | ||
|
||
for (i,M) in enumerate(M_array) | ||
dr = Rmax/M | ||
method = NgIteration(M=M, dr=dr, verbose=false) | ||
sol = solve(system, PercusYevick(), method) | ||
pressure = compute_virial_pressure(sol, system) | ||
p[i] = pressure/ρ/kBT-1.0 | ||
println("The pressure = ", round(pressure, digits=8), " with M = $(M) gridpoints.") | ||
end</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">The pressure = 0.58024311 with M = 100 gridpoints. | ||
The pressure = 0.5831676 with M = 140 gridpoints. | ||
The pressure = 0.58483445 with M = 210 gridpoints. | ||
The pressure = 0.58550373 with M = 300 gridpoints. | ||
The pressure = 0.5858285 with M = 430 gridpoints. | ||
The pressure = 0.58598643 with M = 620 gridpoints. | ||
The pressure = 0.58606101 with M = 890 gridpoints. | ||
The pressure = 0.58609654 with M = 1270 gridpoints. | ||
The pressure = 0.58611421 with M = 1830 gridpoints. | ||
The pressure = 0.58612271 with M = 2640 gridpoints. | ||
The pressure = 0.58612675 with M = 3790 gridpoints. | ||
The pressure = 0.58612871 with M = 5460 gridpoints. | ||
The pressure = 0.58612966 with M = 7850 gridpoints. | ||
The pressure = 0.58613011 with M = 11290 gridpoints. | ||
The pressure = 0.58613033 with M = 16240 gridpoints. | ||
The pressure = 0.58613044 with M = 23360 gridpoints. | ||
The pressure = 0.58613049 with M = 33600 gridpoints. | ||
The pressure = 0.58613051 with M = 48330 gridpoints. | ||
The pressure = 0.58613053 with M = 69520 gridpoints. | ||
The pressure = 0.58613053 with M = 100000 gridpoints.</code></pre><p>We can see that the method has well-behaved second order convergence, and that with <span>$M=10^4$</span>, we get almost 6 digits of relative accuracy.</p><pre><code class="language-julia hljs">η = ρ/6*π | ||
p_exact = (1+2η+3η^2)/(1-η)^2-1.0 | ||
scatter(M_array, abs.(p.-p_exact)./p_exact) | ||
plot!(ylabel="relative error", xlabel="M", xscale=:log, yscale=:log)</code></pre><img src="Accuracy-995f857c.svg" alt="Example block output"/><p>In principle, these results can be extrapolated to improve the accuracy further.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="OtherDimensions.html">« Other dimensions</a><a class="docs-footer-nextpage" href="ThermodynamicConsistency.html">Thermodynamic Consistency »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Friday 4 October 2024 09:00">Friday 4 October 2024</span>. Using Julia version 1.10.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.