Skip to content

Commit

Permalink
add missing files, removed files that are too big
Browse files Browse the repository at this point in the history
  • Loading branch information
Ameyanagi committed Jan 8, 2024
1 parent 8e8a726 commit 8badcd7
Show file tree
Hide file tree
Showing 237 changed files with 5,593,082 additions and 55 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,9 @@ cython_debug/
.DS_Store

# Backup
backup
<<<<<<< HEAD
backup
=======
backup
examples/sweep/*.csv
>>>>>>> 2cb53ab (add missed files)
Binary file modified decomnano/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified decomnano/__pycache__/cli.cpython-311.pyc
Binary file not shown.
Binary file modified docs/_build/doctrees/decomnano.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/readme.doctree
Binary file not shown.
89 changes: 83 additions & 6 deletions docs/_build/html/_modules/decomnano/cli.html

Large diffs are not rendered by default.

154 changes: 126 additions & 28 deletions docs/_build/html/_modules/decomnano/decomnano.html

Large diffs are not rendered by default.

49 changes: 38 additions & 11 deletions docs/_build/html/_modules/decomnano/sweep.html

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions docs/_build/html/decomnano.html

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ <h2 id="C">C</h2>
</li>
<li><a href="decomnano.html#decomnano.sweep.SweepDecomNano.calc_sweep">calc_sweep() (decomnano.sweep.SweepDecomNano method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="decomnano.html#decomnano.sweep.SweepDecomNano.calc_sweep_const_2param">calc_sweep_const_2param() (decomnano.sweep.SweepDecomNano method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.check_duplicate_input">check_duplicate_input() (decomnano.decomnano.DecomNano method)</a>
</li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.column">column (decomnano.decomnano.DecomNano attribute)</a>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.column">column (decomnano.decomnano.DecomNano attribute)</a>, <a href="decomnano.html#id0">[1]</a>
</li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.column_hollow">column_hollow (decomnano.decomnano.DecomNano attribute)</a>
</li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.convert_dict">convert_dict() (decomnano.decomnano.DecomNano method)</a>
</li>
Expand Down Expand Up @@ -150,6 +152,8 @@ <h2 id="D">D</h2>
</li>
</ul></li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.decomnano_equation">decomnano_equation (decomnano.decomnano.DecomNano attribute)</a>
</li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.decomnano_equation_hollow">decomnano_equation_hollow (decomnano.decomnano.DecomNano attribute)</a>
</li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.dict_regex">dict_regex (decomnano.decomnano.DecomNano attribute)</a>
</li>
Expand Down Expand Up @@ -228,6 +232,8 @@ <h2 id="P">P</h2>
<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.respawn_kernel">respawn_kernel() (decomnano.decomnano.DecomNano method)</a>
</li>
<li><a href="decomnano.html#decomnano.decomnano.DecomNano.results">results (decomnano.decomnano.DecomNano attribute)</a>
</li>
</ul></td>
Expand Down
4 changes: 4 additions & 0 deletions docs/_build/html/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ <h1>decomnano<a class="headerlink" href="#decomnano" title="Permalink to this he
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.dict_regex"><code class="docutils literal notranslate"><span class="pre">DecomNano.dict_regex</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.calc_decomnano"><code class="docutils literal notranslate"><span class="pre">DecomNano.calc_decomnano()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.check_duplicate_input"><code class="docutils literal notranslate"><span class="pre">DecomNano.check_duplicate_input()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#id0"><code class="docutils literal notranslate"><span class="pre">DecomNano.column</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.column_hollow"><code class="docutils literal notranslate"><span class="pre">DecomNano.column_hollow</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.convert_dict"><code class="docutils literal notranslate"><span class="pre">DecomNano.convert_dict()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.decomnano_equation"><code class="docutils literal notranslate"><span class="pre">DecomNano.decomnano_equation</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.decomnano_equation_hollow"><code class="docutils literal notranslate"><span class="pre">DecomNano.decomnano_equation_hollow</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.init_input"><code class="docutils literal notranslate"><span class="pre">DecomNano.init_input()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.load_results"><code class="docutils literal notranslate"><span class="pre">DecomNano.load_results()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.print_input"><code class="docutils literal notranslate"><span class="pre">DecomNano.print_input()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.print_results"><code class="docutils literal notranslate"><span class="pre">DecomNano.print_results()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.respawn_kernel"><code class="docutils literal notranslate"><span class="pre">DecomNano.respawn_kernel()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.save_results"><code class="docutils literal notranslate"><span class="pre">DecomNano.save_results()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.solve_decomnano"><code class="docutils literal notranslate"><span class="pre">DecomNano.solve_decomnano()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="decomnano.html#decomnano.decomnano.DecomNano.terminate"><code class="docutils literal notranslate"><span class="pre">DecomNano.terminate()</span></code></a></li>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/_build/html/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<h1>DecomNano<a class="headerlink" href="#decomnano" title="Permalink to this heading"></a></h1>
<a class="reference external image-reference" href="https://pypi.python.org/pypi/decomnano"><img alt="https://img.shields.io/pypi/v/decomnano.svg" src="https://img.shields.io/pypi/v/decomnano.svg" /></a>
<a class="reference external image-reference" href="https://travis-ci.com/Ameyanagi/decomnano"><img alt="https://img.shields.io/travis/Ameyanagi/decomnano.svg" src="https://img.shields.io/travis/Ameyanagi/decomnano.svg" /></a>
<a class="reference external image-reference" href="https://github.com/Ameyanagi/DecomNano/actions/workflows/documentation.yaml/badge.svg"><img alt="Documentation Status" src="https://ameyanagi.github.io/DecomNano/index.html" /></a>
<a class="reference external image-reference" href="https://ameyanagi.github.io/DecomNano/index.html"><img alt="Documentation Status" src="https://github.com/Ameyanagi/DecomNano/actions/workflows/documentation.yaml/badge.svg" /></a>
<p>DecomNano is a heterogeneity analysis of bimetallic nanoparticles using coordination numbers obtained from XAS analysis.</p>
<ul class="simple">
<li><p>Free software: MIT license</p></li>
Expand All @@ -117,6 +117,7 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
<p>Detailed instructions for installation are available in the <a class="reference external" href="https://ameyanagi.github.io/DecomNano/installation.html">installation documentation</a>.</p>
<section id="installation-from-pypi">
<h3>Installation from PyPI<a class="headerlink" href="#installation-from-pypi" title="Permalink to this heading"></a></h3>
<p>(This method is not available yet. It will be available after the submission.)</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>decomnano
</pre></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions docs/conversion_of_PDF_from_particle_average_to_atom_average.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
marp:true
theme: default
paginate: true
footer: "Conversion of PDF from particle average to atom average"
marp: true
---

# Conversion of PDF from particle average to atom average
Aug 28, 2023

---
# Conversion of PDF from particle average to atom average

- Particle size distribution (PDF) measured by TEM is usually a particle average PDF.

- In XAS, The average spectrum is and atom average of all the sites.

- Therefore, the particle size obtained from TEM and particle size obtained from XAS will be different. (*Annu. Rev. Anal. Chem.* **2011**. *4*, 23–39)

- Here, we will discuss how to convert the particle average PDF to atom average PDF.

---
# Assumptions

- The particle is spherical.
$$ V(r) = \frac{4}{3}\pi r^3 $$
$$ V(D) = \frac{1}{6}\pi D^3 $$

- The particle size distribution is normal distribution.
$$ f(D) = \frac{1}{\sqrt{2\pi}\sigma} \exp\left(-\frac{(D-\mu)^2}{2\sigma^2}\right) $$

---
# Conversion

When $g(D)$ is the probability density function of particle size distribution scaled by $V(D)$, the conversion of $f(D)$ to $g(D)$ is given by
$$g(D) = \frac{V(D)f(D)}{\int_{-\infty}^{\infty} V(D)f(D) dD}$$

The expectation and variance of $g(D)$ are given by

$$ \mu = \int_{-\infty}^{\infty} D g(D) dD $$
$$ \sigma^2 =\int_{-\infty}^{\infty} (D-\mu)^2 g(D) dD $$
$$= \int_{-\infty}^{\infty} D^2 g(D) dD - \mu^2 $$



---

# Calculation of normalization factor

The integrals were performed using Wolfram Mathematica 12.3.1. The results are given below.
$$\int_{-\infty}^{\infty} V(D)f(D) dD = \frac{1}{\sqrt{2\pi}\sigma} \int_{-\infty}^{\infty} \frac{1}{6}\pi D^3 \exp\left(-\frac{(D-\mu)^2}{2\sigma^2}\right) dD$$

$$=\frac{\pi}{6}\mu(\mu^2+3\sigma^2)$$

Mathematica ouput:
![normalization](./img/normalization.png)

---

# g(D)

$$g(D) = \frac{x^3}{\mu(\mu^2+3\sigma^2)\sqrt{2\pi}\sigma} \exp\left(-\frac{(D-\mu)^2}{2\sigma^2}\right)$$

---
# Calculation of expectation

$$ \mu = \int_{-\infty}^{\infty} D g(D) dD $$
$$ = \frac{\mu^4 + 6\mu^2\sigma^2 + 3\sigma^4}{\mu(\mu^2+3\sigma^2)} $$

Mathematica output:
![mu](./img/mu.png)


---
# Calculation of variance

$$ \sigma^2 =\int_{-\infty}^{\infty} D^2 g(D) dD - \mu^2 $$
$$ = \frac{\mu^4 + 10 \mu^2 \sigma^2 + 15 \sigma^4}{\mu^2 + 3\sigma^2} - \mu^2 $$

Mathematica output:
![variance](./img/variance.png)

---

# Mock example

$\mu = 17 Å$, $\sigma = 6 Å$


![width:500px](./img/calculation_of_V_average.png)

---
# Conclusion

- The conversion of particle average PDF to atom average PDF obtained by 2 assumptions.
- The particle is spherical.
- The particle size distribution is normal distribution.

- The converted $\mu$ and $\sigma$ are given by
$$ \mu = \frac{\mu^4 + 6\mu^2\sigma^2 + 3\sigma^4}{\mu(\mu^2+3\sigma^2)} $$
$$ \sigma^2 = \frac{\mu^4 + 10 \mu^2 \sigma^2 + 15 \sigma^4}{\mu^2 + 3\sigma^2} - \mu^2 $$

---

# Python code

```python
def mu_vol(mu, sigma):
return (mu**4 + 6*mu**2*sigma**2 + 3*sigma**4)/(mu*(mu**2 + 3*sigma**2))

def sigma_vol(mu, sigma):
return np.sqrt((mu**4 + 10 * mu**2 * sigma**2 + 15 * sigma**4)/(mu**2 + 3*sigma**2) - mu_vol(mu, sigma)**2)
```
Binary file not shown.
Binary file added docs/img/calculation_of_V_average.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/mu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/normalization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/variance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8badcd7

Please sign in to comment.