{ "cells": [ { "cell_type": "markdown", "id": "0a25101c-0921-4492-b920-db2698b0c4fb", "metadata": {}, "source": [ "# Compute exponential growth from SPARK3D\n", "This script showcases how the exponential growth factor from a bunch of SPARK3D simulations can be calculated.\n", "The original data can be manually exported from SPARK3D, or automatically generated (command line SPARK3D)." ] }, { "cell_type": "markdown", "id": "b8208fa8-5339-472e-9c8e-80e819d010b8", "metadata": {}, "source": [ "## Pre-requisites\n", "Import some objects:" ] }, { "cell_type": "code", "execution_count": 1, "id": "92d8869a-06f9-4459-9561-e585636d9284", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0;37m[INFO ] [log_manager.py ]\u001b[0m Starting log for Simultipac - Version: 2.0.1.dev22+g1f37471.d20250203, Commit: 28c1c760d62f7c4764c2f184225d1fd6853764bb\n" ] } ], "source": [ "from pathlib import Path\n", "\n", "import numpy as np\n", "\n", "from simultipac.simulation_results.simulations_results import (\n", " SimulationsResults,\n", " SimulationsResultsFactory,\n", ")" ] }, { "cell_type": "markdown", "id": "384e3874-2795-4b13-b5fc-620d6f5c0a89", "metadata": {}, "source": [ "## Loading the data\n", "The factory is used to create the SimulationsResults objects. You will need to provide the RF frequency in GHz." ] }, { "cell_type": "code", "execution_count": 2, "id": "630d875b-c953-4695-a38b-755d5b00a3bf", "metadata": {}, "outputs": [], "source": [ "factory = SimulationsResultsFactory(\"SPARK3D\", freq_ghz=1.30145)" ] }, { "cell_type": "markdown", "id": "97e8f7e4-45ab-435b-b5fb-7daba033fb77", "metadata": {}, "source": [ "The SimulationsResults object will hold all the data. You must provide:\n", "1. The path to the file holding the results. Check [dedicated documentation](https://simultipac.readthedocs.io/en/latest/simultipac/simultipac.spark3d.simulation_results.html#simultipac.spark3d.simulation_results.Spark3DResultsFactory.from_file) for the format of the results file.\n", "2. The accelerating fields in V/m.\n", "\n", "