{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Sensitivity analysis for the Ishigama function using PCE\n", "\n", "Run an EasyVVUQ campaign to analyze the sensitivity for the Ishigami function\n", "\n", "This is done with PCE." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.244157Z", "start_time": "2021-06-07T14:42:41.768114Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:33:52.869112Z", "iopub.status.busy": "2025-07-18T11:33:52.868973Z", "iopub.status.idle": "2025-07-18T11:34:12.250919Z", "shell.execute_reply": "2025-07-18T11:34:12.250176Z", "shell.execute_reply.started": "2025-07-18T11:33:52.869104Z" } }, "outputs": [], "source": [ "# Run an EasyVVUQ campaign to analyze the sensitivity for the Ishigami function\n", "# This is done with PCE.\n", "%matplotlib inline\n", "import os\n", "import easyvvuq as uq\n", "import chaospy as cp\n", "import pickle\n", "import numpy as np\n", "import matplotlib.pylab as plt\n", "import time\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.248425Z", "start_time": "2021-06-07T14:42:46.245314Z" }, "execution": { "iopub.execute_input": "2025-07-18T11:34:12.259360Z", "iopub.status.busy": "2025-07-18T11:34:12.259114Z", "iopub.status.idle": "2025-07-18T11:34:12.267453Z", "shell.execute_reply": "2025-07-18T11:34:12.266569Z", "shell.execute_reply.started": "2025-07-18T11:34:12.259336Z" } }, "outputs": [ { "data": { "text/plain": [ "'1.26.4'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.__version__" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.253612Z", "start_time": "2021-06-07T14:42:46.249610Z" }, "code_folding": [ 0, 1 ], "execution": { "iopub.execute_input": "2025-07-18T11:34:12.269811Z", "iopub.status.busy": "2025-07-18T11:34:12.268342Z", "iopub.status.idle": "2025-07-18T11:34:12.276632Z", "shell.execute_reply": "2025-07-18T11:34:12.275829Z", "shell.execute_reply.started": "2025-07-18T11:34:12.269772Z" } }, "outputs": [], "source": [ "# Define the Ishigami function\n", "def ishigamiSA(a,b):\n", " '''Exact sensitivity indices of the Ishigami function for given a and b.\n", " From https://openturns.github.io/openturns/master/examples/meta_modeling/chaos_ishigami.html\n", " '''\n", " var = 1.0/2 + a**2/8 + b*np.pi**4/5 + b**2*np.pi**8/18\n", " S1 = (1.0/2 + b*np.pi**4/5+b**2*np.pi**8/50)/var\n", " S2 = (a**2/8)/var\n", " S3 = 0\n", " S13 = b**2*np.pi**8/2*(1.0/9-1.0/25)/var\n", " exact = {\n", " 'expectation' : a/2,\n", " 'variance' : var,\n", " 'S1' : (1.0/2 + b*np.pi**4/5+b**2*np.pi**8.0/50)/var,\n", " 'S2' : (a**2/8)/var,\n", " 'S3' : 0,\n", " 'S12' : 0,\n", " 'S23' : 0,\n", " 'S13' : S13,\n", " 'S123' : 0,\n", " 'ST1' : S1 + S13,\n", " 'ST2' : S2,\n", " 'ST3' : S3 + S13\n", " }\n", " return exact\n", "\n", "Ishigami_a = 7.0\n", "Ishigami_b = 0.1\n", "exact = ishigamiSA(Ishigami_a, Ishigami_b)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.257741Z", "start_time": "2021-06-07T14:42:46.255954Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:34:12.278321Z", "iopub.status.busy": "2025-07-18T11:34:12.277837Z", "iopub.status.idle": "2025-07-18T11:34:12.281917Z", "shell.execute_reply": "2025-07-18T11:34:12.281131Z", "shell.execute_reply.started": "2025-07-18T11:34:12.278301Z" } }, "outputs": [], "source": [ "# define a model to run the Ishigami code directly from python, expecting a dictionary and returning a dictionary\n", "def run_ishigami_model(input):\n", " import Ishigami\n", " qois = [\"Ishigami\"]\n", " del input['out_file']\n", " return {qois[0]: Ishigami.evaluate(**input)}" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.261995Z", "start_time": "2021-06-07T14:42:46.258868Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:34:12.283083Z", "iopub.status.busy": "2025-07-18T11:34:12.282933Z", "iopub.status.idle": "2025-07-18T11:34:12.286417Z", "shell.execute_reply": "2025-07-18T11:34:12.285844Z", "shell.execute_reply.started": "2025-07-18T11:34:12.283069Z" } }, "outputs": [], "source": [ "# Define parameter space\n", "def define_params():\n", " return {\n", " \"x1\": {\"type\": \"float\", \"min\": -np.pi, \"max\": np.pi, \"default\": 0.0},\n", " \"x2\": {\"type\": \"float\", \"min\": -np.pi, \"max\": np.pi, \"default\": 0.0},\n", " \"x3\": {\"type\": \"float\", \"min\": -np.pi, \"max\": np.pi, \"default\": 0.0},\n", " \"a\": {\"type\": \"float\", \"min\": Ishigami_a, \"max\": Ishigami_a, \"default\": Ishigami_a},\n", " \"b\": {\"type\": \"float\", \"min\": Ishigami_b, \"max\": Ishigami_b, \"default\": Ishigami_b},\n", " \"out_file\": {\"type\": \"string\", \"default\": \"output.csv\"}\n", " }" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.265476Z", "start_time": "2021-06-07T14:42:46.263562Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:34:12.287070Z", "iopub.status.busy": "2025-07-18T11:34:12.286934Z", "iopub.status.idle": "2025-07-18T11:34:12.289744Z", "shell.execute_reply": "2025-07-18T11:34:12.289337Z", "shell.execute_reply.started": "2025-07-18T11:34:12.287056Z" } }, "outputs": [], "source": [ "# Define parameter space\n", "def define_vary():\n", " return {\n", " \"x1\": cp.Uniform(-np.pi, np.pi),\n", " \"x2\": cp.Uniform(-np.pi, np.pi),\n", " \"x3\": cp.Uniform(-np.pi, np.pi)\n", " }" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T14:42:46.272337Z", "start_time": "2021-06-07T14:42:46.266543Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:34:12.290613Z", "iopub.status.busy": "2025-07-18T11:34:12.290351Z", "iopub.status.idle": "2025-07-18T11:34:12.296274Z", "shell.execute_reply": "2025-07-18T11:34:12.295894Z", "shell.execute_reply.started": "2025-07-18T11:34:12.290597Z" } }, "outputs": [], "source": [ "# Set up and run a campaign\n", "def run_campaign(pce_order=2, use_files=False):\n", "\n", " times = np.zeros(7)\n", "\n", " time_start = time.time()\n", " time_start_whole = time_start\n", "\n", " # Set up a fresh campaign called \"Ishigami_pce.\"\n", " my_campaign = uq.Campaign(name='Ishigami_pce.')\n", "\n", " # Create an encoder and decoder for PCE test app\n", " if use_files:\n", " encoder = uq.encoders.GenericEncoder(template_fname='Ishigami.template',\n", " delimiter='$',\n", " target_filename='Ishigami_in.json')\n", "\n", " decoder = uq.decoders.SimpleCSV(target_filename=\"output.csv\",\n", " output_columns=[\"Ishigami\"])\n", "\n", " execute = uq.actions.ExecuteLocal('python3 %s/Ishigami.py Ishigami_in.json' % (os.getcwd()))\n", "\n", " actions = uq.actions.Actions(uq.actions.CreateRunDirectory('/tmp'), \n", " uq.actions.Encode(encoder), execute, uq.actions.Decode(decoder))\n", " else:\n", " actions = uq.actions.Actions(uq.actions.ExecutePython(run_ishigami_model))\n", "\n", " # Add the app (automatically set as current app)\n", " my_campaign.add_app(name=\"Ishigami\", params=define_params(), actions=actions)\n", "\n", " # Create the sampler\n", " time_end = time.time()\n", " times[1] = time_end-time_start\n", " print('Time for phase 1 = %.3f' % (times[1]))\n", "\n", " time_start = time.time()\n", " # Associate a sampler with the campaign\n", " my_campaign.set_sampler(uq.sampling.PCESampler(vary=define_vary(), polynomial_order=pce_order))\n", "\n", " # Will draw all (of the finite set of samples)\n", " my_campaign.draw_samples()\n", " print('Number of samples = %s' % my_campaign.get_active_sampler().count)\n", "\n", " time_end = time.time()\n", " times[2] = time_end-time_start\n", " print('Time for phase 2 = %.3f' % (times[2]))\n", "\n", " time_start = time.time()\n", " # Run the cases\n", " my_campaign.execute(sequential=True).collate(progress_bar=True)\n", "\n", " time_end = time.time()\n", " times[3] = time_end-time_start\n", " print('Time for phase 3 = %.3f' % (times[3]))\n", "\n", " time_start = time.time()\n", " # Get the results\n", " results_df = my_campaign.get_collation_result()\n", "\n", " time_end = time.time()\n", " times[4] = time_end-time_start\n", " print('Time for phase 4 = %.3f' % (times[4]))\n", "\n", " time_start = time.time()\n", " # Post-processing analysis\n", " results = my_campaign.analyse(qoi_cols=[\"Ishigami\"])\n", " \n", " time_end = time.time()\n", " times[5] = time_end-time_start\n", " print('Time for phase 5 = %.3f' % (times[5]))\n", "\n", " time_start = time.time()\n", " # Save the results\n", " pickle.dump(results, open('Ishigami_results.pickle','bw'))\n", " time_end = time.time()\n", " times[6] = time_end-time_start\n", " print('Time for phase 6 = %.3f' % (times[6]))\n", "\n", " times[0] = time_end - time_start_whole\n", "\n", " return results_df, results, times, pce_order, my_campaign.get_active_sampler().count" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T15:00:53.564255Z", "start_time": "2021-06-07T14:42:46.274613Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:34:12.296950Z", "iopub.status.busy": "2025-07-18T11:34:12.296810Z", "iopub.status.idle": "2025-07-18T11:53:51.802386Z", "shell.execute_reply": "2025-07-18T11:53:51.801981Z", "shell.execute_reply.started": "2025-07-18T11:34:12.296931Z" }, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 1 = 0.035\n", "Number of samples = 8\n", "Time for phase 2 = 0.042\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|███████████████████████████████████████████| 8/8 [00:00<00:00, 2215.40it/s]\n", "Traceback (most recent call last):\n", " File \"/Volumes/UserData/dpc/GIT/EasyVVUQ/env_3.12/lib/python3.12/site-packages/easyvvuq/analysis/pce_analysis.py\", line 495, in analyse\n", " dY_hat = build_surrogate_der(fit, verbose=False)\n", " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", " File \"/Volumes/UserData/dpc/GIT/EasyVVUQ/env_3.12/lib/python3.12/site-packages/easyvvuq/analysis/pce_analysis.py\", line 347, in build_surrogate_der\n", " assert(sum(sum(np.array(Y_hat[t].exponents))) == 0)\n", " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", "AssertionError\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.023\n", "Time for phase 4 = 0.003\n", "Time for phase 5 = 0.031\n", "Time for phase 6 = 0.002\n", "Time for phase 1 = 0.010\n", "Number of samples = 27\n", "Time for phase 2 = 0.059\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████████| 27/27 [00:00<00:00, 5205.29it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.010\n", "Time for phase 4 = 0.002\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 5 = 0.102\n", "Time for phase 6 = 0.001\n", "Time for phase 1 = 0.006\n", "Number of samples = 64\n", "Time for phase 2 = 0.091\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████████| 64/64 [00:00<00:00, 5930.44it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.016\n", "Time for phase 4 = 0.002\n", "Time for phase 5 = 0.167\n", "Time for phase 6 = 0.001\n", "Time for phase 1 = 0.006\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Number of samples = 125\n", "Time for phase 2 = 0.147\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|███████████████████████████████████████| 125/125 [00:00<00:00, 6213.12it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.027\n", "Time for phase 4 = 0.003\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 5 = 0.305\n", "Time for phase 6 = 0.001\n", "Time for phase 1 = 0.006\n", "Number of samples = 216\n", "Time for phase 2 = 0.192\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|███████████████████████████████████████| 216/216 [00:00<00:00, 6028.10it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.046\n", "Time for phase 4 = 0.006\n", "Time for phase 5 = 0.485\n", "Time for phase 6 = 0.001\n", "Time for phase 1 = 0.006\n", "Number of samples = 343\n", "Time for phase 2 = 0.240\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|███████████████████████████████████████| 343/343 [00:00<00:00, 2419.45it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.154\n", "Time for phase 4 = 0.006\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 5 = 0.766\n", "Time for phase 6 = 0.001\n", "Time for phase 1 = 0.006\n", "Number of samples = 512\n", "Time for phase 2 = 0.319\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|███████████████████████████████████████| 512/512 [00:00<00:00, 6729.86it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.093\n", "Time for phase 4 = 0.007\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 5 = 1.293\n", "Time for phase 6 = 0.004\n", "Time for phase 1 = 0.007\n", "Number of samples = 729\n", "Time for phase 2 = 0.414\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|███████████████████████████████████████| 729/729 [00:00<00:00, 6692.38it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.131\n", "Time for phase 4 = 0.009\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 5 = 2.202\n", "Time for phase 6 = 0.001\n", "Time for phase 1 = 0.007\n", "Number of samples = 1000\n", "Time for phase 2 = 0.561\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 1000/1000 [00:00<00:00, 6859.50it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.172\n", "Time for phase 4 = 0.011\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 5 = 3.796\n", "Time for phase 6 = 0.002\n", "Time for phase 1 = 0.025\n", "Number of samples = 1331\n", "Time for phase 2 = 0.813\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 1331/1331 [00:00<00:00, 6505.47it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.240\n", "Time for phase 4 = 0.015\n", "Time for phase 5 = 6.412\n", "Time for phase 6 = 0.002\n", "Time for phase 1 = 0.008\n", "Number of samples = 1728\n", "Time for phase 2 = 0.850\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 1728/1728 [00:00<00:00, 6791.62it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.299\n", "Time for phase 4 = 0.094\n", "Time for phase 5 = 10.218\n", "Time for phase 6 = 0.009\n", "Time for phase 1 = 0.015\n", "Number of samples = 2197\n", "Time for phase 2 = 1.097\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 2197/2197 [00:00<00:00, 6577.30it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.396\n", "Time for phase 4 = 0.140\n", "Time for phase 5 = 17.613\n", "Time for phase 6 = 0.016\n", "Time for phase 1 = 0.011\n", "Number of samples = 2744\n", "Time for phase 2 = 1.335\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 2744/2744 [00:00<00:00, 6627.28it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.602\n", "Time for phase 4 = 0.028\n", "Time for phase 5 = 25.524\n", "Time for phase 6 = 0.012\n", "Time for phase 1 = 0.022\n", "Number of samples = 3375\n", "Time for phase 2 = 1.766\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 3375/3375 [00:00<00:00, 6642.32it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.594\n", "Time for phase 4 = 0.099\n", "Time for phase 5 = 38.722\n", "Time for phase 6 = 0.005\n", "Time for phase 1 = 0.014\n", "Number of samples = 4096\n", "Time for phase 2 = 2.180\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 4096/4096 [00:00<00:00, 6635.85it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.727\n", "Time for phase 4 = 0.043\n", "Time for phase 5 = 58.738\n", "Time for phase 6 = 0.006\n", "Time for phase 1 = 0.012\n", "Number of samples = 4913\n", "Time for phase 2 = 2.675\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 4913/4913 [00:00<00:00, 6714.53it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 0.942\n", "Time for phase 4 = 0.047\n", "Time for phase 5 = 85.127\n", "Time for phase 6 = 0.005\n", "Time for phase 1 = 0.018\n", "Number of samples = 5832\n", "Time for phase 2 = 3.358\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 5832/5832 [00:00<00:00, 6390.76it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 1.097\n", "Time for phase 4 = 0.133\n", "Time for phase 5 = 121.527\n", "Time for phase 6 = 0.007\n", "Time for phase 1 = 0.013\n", "Number of samples = 6859\n", "Time for phase 2 = 3.828\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 6859/6859 [00:01<00:00, 6721.68it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 1.287\n", "Time for phase 4 = 0.070\n", "Time for phase 5 = 172.143\n", "Time for phase 6 = 0.017\n", "Time for phase 1 = 0.033\n", "Number of samples = 8000\n", "Time for phase 2 = 4.975\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 8000/8000 [00:01<00:00, 6451.04it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 1.556\n", "Time for phase 4 = 0.085\n", "Time for phase 5 = 250.738\n", "Time for phase 6 = 0.012\n", "Time for phase 1 = 0.034\n", "Number of samples = 9261\n", "Time for phase 2 = 6.199\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "100%|█████████████████████████████████████| 9261/9261 [00:01<00:00, 6093.26it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time for phase 3 = 1.871\n", "Time for phase 4 = 0.099\n", "Time for phase 5 = 340.794\n", "Time for phase 6 = 0.015\n" ] } ], "source": [ "# Calculate the polynomial chaos expansion for a range of orders\n", "\n", "R = {}\n", "for pce_order in range(1, 21):\n", " R[pce_order] = {}\n", " (R[pce_order]['results_df'], \n", " R[pce_order]['results'], \n", " R[pce_order]['times'], \n", " R[pce_order]['order'], \n", " R[pce_order]['number_of_samples']) = run_campaign(pce_order=pce_order, use_files=False)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T15:00:53.741252Z", "start_time": "2021-06-07T15:00:53.565998Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:53:51.803988Z", "iopub.status.busy": "2025-07-18T11:53:51.803600Z", "iopub.status.idle": "2025-07-18T11:53:51.919314Z", "shell.execute_reply": "2025-07-18T11:53:51.918997Z", "shell.execute_reply.started": "2025-07-18T11:53:51.803972Z" } }, "outputs": [], "source": [ "# save the results\n", "\n", "pickle.dump(R, open('collected_results.pickle','bw'))" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "ExecuteTime": { "end_time": "2021-06-07T15:00:53.767105Z", "start_time": "2021-06-07T15:00:53.742000Z" }, "code_folding": [ 0 ], "execution": { "iopub.execute_input": "2025-07-18T11:53:51.920136Z", "iopub.status.busy": "2025-07-18T11:53:51.920044Z", "iopub.status.idle": "2025-07-18T11:53:51.968542Z", "shell.execute_reply": "2025-07-18T11:53:51.968312Z", "shell.execute_reply.started": "2025-07-18T11:53:51.920127Z" } }, "outputs": [ { "data": { "text/html": [ "
| \n", " | Total | \n", "Phase 1 | \n", "Phase 2 | \n", "Phase 3 | \n", "Phase 4 | \n", "Phase 5 | \n", "Phase 6 | \n", "
|---|---|---|---|---|---|---|---|
| 1 | \n", "0.136015 | \n", "0.035234 | \n", "0.042051 | \n", "0.022817 | \n", "0.002804 | \n", "0.031306 | \n", "0.001599 | \n", "
| 2 | \n", "0.183633 | \n", "0.009532 | \n", "0.059000 | \n", "0.009928 | \n", "0.002095 | \n", "0.102321 | \n", "0.000598 | \n", "
| 3 | \n", "0.283654 | \n", "0.006476 | \n", "0.091341 | \n", "0.015623 | \n", "0.002103 | \n", "0.167288 | \n", "0.000655 | \n", "
| 4 | \n", "0.489075 | \n", "0.006287 | \n", "0.146644 | \n", "0.027074 | \n", "0.003282 | \n", "0.304970 | \n", "0.000645 | \n", "
| 5 | \n", "0.734818 | \n", "0.006247 | \n", "0.191741 | \n", "0.045707 | \n", "0.005522 | \n", "0.484538 | \n", "0.000784 | \n", "
| 6 | \n", "1.172222 | \n", "0.005645 | \n", "0.240188 | \n", "0.153843 | \n", "0.005686 | \n", "0.765923 | \n", "0.000756 | \n", "
| 7 | \n", "1.722358 | \n", "0.005779 | \n", "0.319212 | \n", "0.092979 | \n", "0.007243 | \n", "1.292582 | \n", "0.004394 | \n", "
| 8 | \n", "2.764593 | \n", "0.006714 | \n", "0.413856 | \n", "0.130983 | \n", "0.009136 | \n", "2.202459 | \n", "0.001216 | \n", "
| 9 | \n", "4.548368 | \n", "0.007211 | \n", "0.560690 | \n", "0.171505 | \n", "0.010738 | \n", "3.795933 | \n", "0.001979 | \n", "
| 10 | \n", "7.508641 | \n", "0.025425 | \n", "0.813369 | \n", "0.240470 | \n", "0.015083 | \n", "6.411912 | \n", "0.002048 | \n", "
| 11 | \n", "11.479659 | \n", "0.008179 | \n", "0.849865 | \n", "0.299316 | \n", "0.093911 | \n", "10.218461 | \n", "0.009438 | \n", "
| 12 | \n", "19.279597 | \n", "0.014593 | \n", "1.096601 | \n", "0.395720 | \n", "0.139500 | \n", "17.612834 | \n", "0.016208 | \n", "
| 13 | \n", "27.512393 | \n", "0.011029 | \n", "1.335461 | \n", "0.601954 | \n", "0.027602 | \n", "25.524038 | \n", "0.011818 | \n", "
| 14 | \n", "41.208407 | \n", "0.021860 | \n", "1.766254 | \n", "0.594309 | \n", "0.098854 | \n", "38.721792 | \n", "0.004774 | \n", "
| 15 | \n", "61.707634 | \n", "0.014210 | \n", "2.179576 | \n", "0.727041 | \n", "0.042867 | \n", "58.737626 | \n", "0.005689 | \n", "
| 16 | \n", "88.810914 | \n", "0.011573 | \n", "2.674999 | \n", "0.942351 | \n", "0.047150 | \n", "85.127170 | \n", "0.005375 | \n", "
| 17 | \n", "126.140729 | \n", "0.018024 | \n", "3.357794 | \n", "1.096967 | \n", "0.133123 | \n", "121.527227 | \n", "0.007013 | \n", "
| 18 | \n", "177.369814 | \n", "0.012838 | \n", "3.828274 | \n", "1.286765 | \n", "0.070440 | \n", "172.143392 | \n", "0.016534 | \n", "
| 19 | \n", "257.401974 | \n", "0.032902 | \n", "4.975153 | \n", "1.555708 | \n", "0.084697 | \n", "250.738268 | \n", "0.012211 | \n", "
| 20 | \n", "349.016879 | \n", "0.033758 | \n", "6.199063 | \n", "1.871499 | \n", "0.098941 | \n", "340.793901 | \n", "0.014523 | \n", "