From 6964c9b50490003a4e2da939a020850d31dc8777 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 16 Dec 2021 18:16:31 +0100 Subject: Figures for statistical model --- doc/thesis/figures/data/rice_pdf.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/thesis/figures/data/rice_pdf.py (limited to 'doc/thesis/figures/data') diff --git a/doc/thesis/figures/data/rice_pdf.py b/doc/thesis/figures/data/rice_pdf.py new file mode 100644 index 0000000..110b6b3 --- /dev/null +++ b/doc/thesis/figures/data/rice_pdf.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import os +import numpy as np + +a = np.linspace(0, 3, num=100) + +ps = [] +for k in [0, 2, 5, 10]: + p = 2 * a * (1 + k) * np.exp(-k - (a**2) * (k + 1)) \ + * np.i0(2 * a * np.sqrt(k * (1 + k))) + + ps += [p] + + +data = np.array(list(zip(a, *ps))) + +# save to file +location = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) +name, _ = os.path.splitext(os.path.basename(__file__)) +filename = os.path.join(location, name + ".dat") +np.savetxt(filename, data, fmt='%.6e') -- cgit v1.2.1