{
"cells": [
{
"cell_type": "markdown",
"id": "49bcb5b0-f19d-4b96-a5f1-e0ae30f66d8f",
"metadata": {},
"source": [
"## Exploration of variable time steps in the simulation of the 2 coupled reactions:\n",
"### `2 S <-> U` and `S <-> X` \n",
"Both mostly forward. 1st-order kinetics throughout. \n",
"\n",
"Based on the reactions and initial conditions of the experiment `up_regulate_3`\n",
"\n",
"This experiment gets repeated, with very fine _fixed_ steps (as a proxy for the \"exact value\"), in `variable_steps_2`\n",
"\n",
"LAST REVISED: May 5, 2024"
]
},
{
"cell_type": "markdown",
"id": "cdbeee8e-b67b-4462-9486-13a271636e9f",
"metadata": {},
"source": [
""
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "d545a787-f84c-4d63-97a1-36a29f6c5dd6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Added 'D:\\Docs\\- MY CODE\\BioSimulations\\life123-Win7' to sys.path\n"
]
}
],
"source": [
"import set_path # Importing this module will add the project's home directory to sys.path"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "386fc233",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from experiments.get_notebook_info import get_notebook_basename\n",
"\n",
"from src.modules.chemicals.chem_data import ChemData as chem\n",
"from src.modules.reactions.reaction_dynamics import ReactionDynamics\n",
"\n",
"import numpy as np\n",
"from src.modules.visualization.graphic_log import GraphicLog"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "cc53849f-351d-49e0-bfa8-22f8d8e22f8e",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-> Output will be LOGGED into the file 'variable_steps_1.log.htm'\n"
]
}
],
"source": [
"# Initialize the HTML logging\n",
"log_file = get_notebook_basename() + \".log.htm\" # Use the notebook base filename for the log file\n",
"\n",
"# Set up the use of some specified graphic (Vue) components\n",
"GraphicLog.config(filename=log_file,\n",
" components=[\"vue_cytoscape_2\"],\n",
" extra_js=\"https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.21.2/cytoscape.umd.js\")"
]
},
{
"cell_type": "markdown",
"id": "d6d3ca49-589d-49b7-8424-37c7b01bcacf",
"metadata": {},
"source": [
"### Initialize the system"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "23c15e66-52e4-495b-aa3d-ecddd8d16942",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Number of reactions: 2 (at temp. 25 C)\n",
"0: 2 S <-> U (kF = 8 / kR = 2 / delta_G = -3,436.6 / K = 4) | 1st order in all reactants & products\n",
"1: S <-> X (kF = 6 / kR = 3 / delta_G = -1,718.3 / K = 2) | 1st order in all reactants & products\n",
"Set of chemicals involved in the above reactions: {'X', 'S', 'U'}\n",
"[GRAPHIC ELEMENT SENT TO LOG FILE `variable_steps_1.log.htm`]\n"
]
}
],
"source": [
"# Initialize the system\n",
"chem_data = chem(names=[\"U\", \"X\", \"S\"])\n",
"\n",
"# Reaction 2 S <-> U , with 1st-order kinetics for all species (mostly forward)\n",
"chem_data.add_reaction(reactants=[(2, \"S\", 1)], products=\"U\",\n",
" forward_rate=8., reverse_rate=2.)\n",
"\n",
"# Reaction S <-> X , with 1st-order kinetics for all species (mostly forward)\n",
"chem_data.add_reaction(reactants=\"S\", products=\"X\",\n",
" forward_rate=6., reverse_rate=3.)\n",
"\n",
"chem_data.describe_reactions()\n",
"\n",
"# Send the plot of the reaction network to the HTML log file\n",
"chem_data.plot_reaction_network(\"vue_cytoscape_2\")"
]
},
{
"cell_type": "markdown",
"id": "d1d0eabb-b5b1-4e15-846d-5e483a5a24a7",
"metadata": {},
"source": [
"### Set the initial concentrations of all the chemicals"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "e80645d6-eb5b-4c78-8b46-ae126d2cb2cf",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"SYSTEM STATE at Time t = 0:\n",
"3 species:\n",
" Species 0 (U). Conc: 50.0\n",
" Species 1 (X). Conc: 100.0\n",
" Species 2 (S). Conc: 0.0\n",
"Set of chemicals involved in reactions: {'X', 'S', 'U'}\n"
]
}
],
"source": [
"dynamics = ReactionDynamics(chem_data=chem_data)\n",
"dynamics.set_conc(conc={\"U\": 50., \"X\": 100., \"S\": 0.})\n",
"dynamics.describe_state()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "bcf652b8-e0dc-438e-bdbe-02216c1d52a0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"(STEP 0) ANALYSIS: Examining Conc. Changes from System Time 0 due to tentative step of 0.01:\n",
" Baseline: [ 50. 100. 0.]\n",
" Deltas: [-1. -3. 5.]\n",
" Norms: {'norm_A': 3.888888888888889}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | abort 1.44 | (VALUE 3.8889)\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'ABORT' (with step size factor of 0.5)\n",
"* INFO: the tentative time step (0.01) leads to a least one norm value > its ABORT threshold:\n",
" -> will backtrack, and re-do step with a SMALLER delta time, multiplied by 0.5 (set to 0.005) [Step started at t=0, and will rewind there]\n",
"\n",
"(STEP 0) ANALYSIS: Examining Conc. Changes from System Time 0 due to tentative step of 0.005:\n",
" Baseline: [ 50. 100. 0.]\n",
" Deltas: [-0.5 -1.5 2.5]\n",
" Norms: {'norm_A': 0.9722222222222222}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.97222) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.0025) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0, and will continue to 0.005]\n",
"\n",
"(STEP 1) ANALYSIS: Examining Conc. Changes from System Time 0.005 due to tentative step of 0.0025:\n",
" Baseline: [49.5 98.5 2.5]\n",
" Deltas: [-0.1975 -0.70125 1.09625]\n",
" Norms: {'norm_A': 0.19250243055555555}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.1925) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.0025) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.005) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.005, and will continue to 0.0075]\n",
"\n",
"(STEP 2) ANALYSIS: Examining Conc. Changes from System Time 0.0075 due to tentative step of 0.005:\n",
" Baseline: [49.3025 97.79875 3.59625]\n",
" Deltas: [-0.349175 -1.35909375 2.05744375]\n",
" Norms: {'norm_A': 0.6891259762586809}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.68913) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.0025) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0.0075, and will continue to 0.0125]\n",
"\n",
"(STEP 3) ANALYSIS: Examining Conc. Changes from System Time 0.0125 due to tentative step of 0.0025:\n",
" Baseline: [48.953325 96.43965625 5.65369375]\n",
" Deltas: [-0.13169275 -0.63849202 0.90187752]\n",
" Norms: {'norm_A': 0.1375997875121511}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.1376) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.0025) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.005) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.0125, and will continue to 0.015]\n",
"\n",
"(STEP 4) ANALYSIS: Examining Conc. Changes from System Time 0.015 due to tentative step of 0.005:\n",
" Baseline: [48.82163225 95.80116423 6.55557127]\n",
" Deltas: [-0.22599347 -1.24035033 1.69233727]\n",
" Norms: {'norm_A': 0.494838601385062}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.49484) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.015, and will continue to 0.02]\n",
"\n",
"(STEP 5) ANALYSIS: Examining Conc. Changes from System Time 0.02 due to tentative step of 0.005:\n",
" Baseline: [48.59563878 94.56081391 8.24790853]\n",
" Deltas: [-0.15604005 -1.17097495 1.48305505]\n",
" Norms: {'norm_A': 0.3994425670227834}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.39944) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.02, and will continue to 0.025]\n",
"\n",
"(STEP 6) ANALYSIS: Examining Conc. Changes from System Time 0.025 due to tentative step of 0.005:\n",
" Baseline: [48.43959873 93.38983896 9.73096358]\n",
" Deltas: [-0.09515744 -1.10891868 1.29923357]\n",
" Norms: {'norm_A': 0.32519593644806855}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.3252) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.025, and will continue to 0.03]\n",
"\n",
"(STEP 7) ANALYSIS: Examining Conc. Changes from System Time 0.03 due to tentative step of 0.005:\n",
" Baseline: [48.34444129 92.28092028 11.03019715]\n",
" Deltas: [-0.04223653 -1.05330789 1.13778094]\n",
" Norms: {'norm_A': 0.2673096568217399}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.26731) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.03, and will continue to 0.035]\n",
"\n",
"(STEP 8) ANALYSIS: Examining Conc. Changes from System Time 0.035 due to tentative step of 0.005:\n",
" Baseline: [48.30220476 91.22761239 12.16797809]\n",
" Deltas: [ 0.00369708 -1.00337484 0.99598069]\n",
" Norms: {'norm_A': 0.22208358683873192}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.22208) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.01) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.035, and will continue to 0.04]\n",
"\n",
"(STEP 9) ANALYSIS: Examining Conc. Changes from System Time 0.04 due to tentative step of 0.01:\n",
" Baseline: [48.30590184 90.22423755 13.16395878]\n",
" Deltas: [ 0.08699867 -1.9168896 1.74289227]\n",
" Norms: {'norm_A': 0.7466342181101149}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.74663) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.005) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0.04, and will continue to 0.05]\n",
"\n",
"(STEP 10) ANALYSIS: Examining Conc. Changes from System Time 0.05 due to tentative step of 0.005:\n",
" Baseline: [48.3929005 88.30734795 14.90685105]\n",
" Deltas: [ 0.11234504 -0.87740469 0.65271461]\n",
" Norms: {'norm_A': 0.13427741784149083}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.13428) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.005) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.01) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.05, and will continue to 0.055]\n",
"\n",
"(STEP 11) ANALYSIS: Examining Conc. Changes from System Time 0.055 due to tentative step of 0.01:\n",
" Baseline: [48.50524554 87.42994326 15.55956566]\n",
" Deltas: [ 0.27466034 -1.68932436 1.14000367]\n",
" Norms: {'norm_A': 0.4698737184351335}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.46987) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.055, and will continue to 0.065]\n",
"\n",
"(STEP 12) ANALYSIS: Examining Conc. Changes from System Time 0.065 due to tentative step of 0.01:\n",
" Baseline: [48.77990588 85.7406189 16.69956934]\n",
" Deltas: [ 0.36036743 -1.57024441 0.84950955]\n",
" Norms: {'norm_A': 0.3685776282283221}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.36858) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.065, and will continue to 0.075]\n",
"\n",
"(STEP 13) ANALYSIS: Examining Conc. Changes from System Time 0.075 due to tentative step of 0.01:\n",
" Baseline: [49.14027331 84.17037449 17.54907888]\n",
" Deltas: [ 0.42112084 -1.4721665 0.62992481]\n",
" Norms: {'norm_A': 0.3046024715786003}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.3046) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.075, and will continue to 0.085]\n",
"\n",
"(STEP 14) ANALYSIS: Examining Conc. Changes from System Time 0.085 due to tentative step of 0.01:\n",
" Baseline: [49.56139416 82.69820799 18.1790037 ]\n",
" Deltas: [ 0.46309241 -1.39020602 0.46402119]\n",
" Norms: {'norm_A': 0.2624936691312418}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.26249) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.085, and will continue to 0.095]\n",
"\n",
"(STEP 15) ANALYSIS: Examining Conc. Changes from System Time 0.095 due to tentative step of 0.01:\n",
" Baseline: [50.02448657 81.30800197 18.64302489]\n",
" Deltas: [ 0.49095226 -1.32065857 0.33875405]\n",
" Norms: {'norm_A': 0.23332527475445466}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.23333) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.02) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.095, and will continue to 0.105]\n",
"\n",
"(STEP 16) ANALYSIS: Examining Conc. Changes from System Time 0.105 due to tentative step of 0.02:\n",
" Baseline: [50.51543883 79.98734341 18.98177894]\n",
" Deltas: [ 1.01646708 -2.52142713 0.48849298]\n",
" Norms: {'norm_A': 0.847713943482735}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.84771) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.01) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0.105, and will continue to 0.125]\n",
"\n",
"(STEP 17) ANALYSIS: Examining Conc. Changes from System Time 0.125 due to tentative step of 0.01:\n",
" Baseline: [51.5319059 77.46591628 19.47027191]\n",
" Deltas: [ 0.52698364 -1.15576117 0.1017939 ]\n",
" Norms: {'norm_A': 0.18042862670354223}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.18043) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.02) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.125, and will continue to 0.135]\n",
"\n",
"(STEP 18) ANALYSIS: Examining Conc. Changes from System Time 0.135 due to tentative step of 0.02:\n",
" Baseline: [52.05888954 76.3101551 19.57206582]\n",
" Deltas: [ 1.04917495 -2.22996141 0.13161151]\n",
" Norms: {'norm_A': 0.676757504987934}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.67676) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.01) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0.135, and will continue to 0.155]\n",
"\n",
"(STEP 19) ANALYSIS: Examining Conc. Changes from System Time 0.155 due to tentative step of 0.01:\n",
" Baseline: [53.10806449 74.08019369 19.70367733]\n",
" Deltas: [ 0.5141329 -1.04018517 0.01191938]\n",
" Norms: {'norm_A': 0.149606655239135}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.14961) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.01) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.02) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.155, and will continue to 0.165]\n",
"\n",
"(STEP 20) ANALYSIS: Examining Conc. Changes from System Time 0.165 due to tentative step of 0.02:\n",
" Baseline: [53.62219739 73.04000852 19.71559671]\n",
" Deltas: [ 1.00960758 -2.01652891 -0.00268625]\n",
" Norms: {'norm_A': 0.5650781675774635}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.56508) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.165, and will continue to 0.185]\n",
"\n",
"(STEP 21) ANALYSIS: Examining Conc. Changes from System Time 0.185 due to tentative step of 0.02:\n",
" Baseline: [54.63180496 71.02347962 19.71291046]\n",
" Deltas: [ 0.96879347 -1.89585952 -0.04172743]\n",
" Norms: {'norm_A': 0.5038428113796767}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.50384) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.185, and will continue to 0.205]\n",
"\n",
"(STEP 22) ANALYSIS: Examining Conc. Changes from System Time 0.205 due to tentative step of 0.02:\n",
" Baseline: [55.60059844 69.12762009 19.67118303]\n",
" Deltas: [ 0.92336535 -1.78711524 -0.05961545]\n",
" Norms: {'norm_A': 0.4499931616991674}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.44999) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.205, and will continue to 0.225]\n",
"\n",
"(STEP 23) ANALYSIS: Examining Conc. Changes from System Time 0.225 due to tentative step of 0.02:\n",
" Baseline: [56.52396378 67.34050485 19.61156758]\n",
" Deltas: [ 0.87689226 -1.68704218 -0.06674234]\n",
" Norms: {'norm_A': 0.4021673223106198}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.40217) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.225, and will continue to 0.245]\n",
"\n",
"(STEP 24) ANALYSIS: Examining Conc. Changes from System Time 0.245 due to tentative step of 0.02:\n",
" Baseline: [57.40085605 65.65346267 19.54482524]\n",
" Deltas: [ 0.8311378 -1.59382873 -0.06844686]\n",
" Norms: {'norm_A': 0.3595294483481833}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.35953) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.245, and will continue to 0.265]\n",
"\n",
"(STEP 25) ANALYSIS: Examining Conc. Changes from System Time 0.265 due to tentative step of 0.02:\n",
" Baseline: [58.23199384 64.05963394 19.47637838]\n",
" Deltas: [ 0.78694079 -1.50641263 -0.06746894]\n",
" Norms: {'norm_A': 0.32145631944741265}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.32146) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.265, and will continue to 0.285]\n",
"\n",
"(STEP 26) ANALYSIS: Examining Conc. Changes from System Time 0.285 due to tentative step of 0.02:\n",
" Baseline: [59.01893463 62.55322131 19.40890943]\n",
" Deltas: [ 0.74466812 -1.42412415 -0.0652121 ]\n",
" Norms: {'norm_A': 0.2874347575511702}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.28743) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.285, and will continue to 0.305]\n",
"\n",
"(STEP 27) ANALYSIS: Examining Conc. Changes from System Time 0.305 due to tentative step of 0.02:\n",
" Baseline: [59.76360275 61.12909716 19.34369733]\n",
" Deltas: [ 0.70444746 -1.34650215 -0.06239278]\n",
" Norms: {'norm_A': 0.25702301402562294}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.25702) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.305, and will continue to 0.325]\n",
"\n",
"(STEP 28) ANALYSIS: Examining Conc. Changes from System Time 0.325 due to tentative step of 0.02:\n",
" Baseline: [60.46805022 59.78259501 19.28130456]\n",
" Deltas: [ 0.66628672 -1.27319915 -0.05937429]\n",
" Norms: {'norm_A': 0.22983326503644058}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.22983) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.04) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.325, and will continue to 0.345]\n",
"\n",
"(STEP 29) ANALYSIS: Examining Conc. Changes from System Time 0.345 due to tentative step of 0.04:\n",
" Baseline: [61.13433694 58.50939586 19.22193027]\n",
" Deltas: [ 1.26027073 -2.40786424 -0.11267722]\n",
" Norms: {'norm_A': 0.8220876292375117}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.82209) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.02) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0.345, and will continue to 0.385]\n",
"\n",
"(STEP 30) ANALYSIS: Examining Conc. Changes from System Time 0.385 due to tentative step of 0.02:\n",
" Baseline: [62.39460767 56.10153162 19.10925305]\n",
" Deltas: [ 0.56169618 -1.07298153 -0.05041083]\n",
" Norms: {'norm_A': 0.16325924649115092}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.16326) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.02) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.04) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.385, and will continue to 0.405]\n",
"\n",
"(STEP 31) ANALYSIS: Examining Conc. Changes from System Time 0.405 due to tentative step of 0.04:\n",
" Baseline: [62.95630385 55.02855009 19.05884222]\n",
" Deltas: [ 1.0623252 -2.02930388 -0.09534652]\n",
" Norms: {'norm_A': 0.5839666694455721}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.58397) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.405, and will continue to 0.445]\n",
"\n",
"(STEP 32) ANALYSIS: Examining Conc. Changes from System Time 0.445 due to tentative step of 0.04:\n",
" Baseline: [64.01862905 52.99924621 18.96349569]\n",
" Deltas: [ 0.9468283 -1.80867058 -0.08498602]\n",
" Norms: {'norm_A': 0.4638884123583411}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.46389) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.445, and will continue to 0.485]\n",
"\n",
"(STEP 33) ANALYSIS: Examining Conc. Changes from System Time 0.485 due to tentative step of 0.04:\n",
" Baseline: [64.96545735 51.19057563 18.87850968]\n",
" Deltas: [ 0.84388651 -1.61202675 -0.07574626]\n",
" Norms: {'norm_A': 0.36850135438022225}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.3685) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.485, and will continue to 0.525]\n",
"\n",
"(STEP 34) ANALYSIS: Examining Conc. Changes from System Time 0.525 due to tentative step of 0.04:\n",
" Baseline: [65.80934386 49.57854888 18.80276341]\n",
" Deltas: [ 0.75213678 -1.43676265 -0.06751092]\n",
" Norms: {'norm_A': 0.29272826302332505}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.29273) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.525, and will continue to 0.565]\n",
"\n",
"(STEP 35) ANALYSIS: Examining Conc. Changes from System Time 0.565 due to tentative step of 0.04:\n",
" Baseline: [66.56148064 48.14178623 18.73525249]\n",
" Deltas: [ 0.67036235 -1.28055375 -0.06017094]\n",
" Norms: {'norm_A': 0.23253601370675195}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.23254) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.08) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.565, and will continue to 0.605]\n",
"\n",
"(STEP 36) ANALYSIS: Examining Conc. Changes from System Time 0.605 due to tentative step of 0.08:\n",
" Baseline: [67.23184299 46.86123248 18.67508155]\n",
" Deltas: [ 1.19495731 -2.28265665 -0.10725798]\n",
" Norms: {'norm_A': 0.7388831828204337}\n",
" Thresholds: \n",
" norm_A : low 0.25 | high 0.64 | (VALUE 0.73888) | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'HIGH' (with step size factor of 0.5)\n",
"NOTICE: the tentative time step (0.08) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER, multiplied by 0.5 (set to 0.04) at the next round, because at least one norm is high\n",
" [The current step started at System Time: 0.605, and will continue to 0.685]\n",
"\n",
"(STEP 37) ANALYSIS: Examining Conc. Changes from System Time 0.685 due to tentative step of 0.04:\n",
" Baseline: [68.4268003 44.57857583 18.56782357]\n",
" Deltas: [ 0.46755952 -0.89315144 -0.0419676 ]\n",
" Norms: {'norm_A': 0.11312140907262146}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.11312) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.04) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.08) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.685, and will continue to 0.725]\n",
"\n",
"(STEP 38) ANALYSIS: Examining Conc. Changes from System Time 0.725 due to tentative step of 0.08:\n",
" Baseline: [68.89435982 43.68542439 18.52585598]\n",
" Deltas: [ 0.83345025 -1.59209098 -0.07480952]\n",
" Norms: {'norm_A': 0.3594432769718806}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.35944) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.08) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.725, and will continue to 0.805]\n",
"\n",
"(STEP 39) ANALYSIS: Examining Conc. Changes from System Time 0.805 due to tentative step of 0.08:\n",
" Baseline: [69.72781007 42.0933334 18.45104645]\n",
" Deltas: [ 0.65222012 -1.24589772 -0.05854252]\n",
" Norms: {'norm_A': 0.2201199373223358}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.22012) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.08) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.16) at the next round, because all norms are low\n",
" [The current step started at System Time: 0.805, and will continue to 0.885]\n",
"\n",
"(STEP 40) ANALYSIS: Examining Conc. Changes from System Time 0.885 due to tentative step of 0.16:\n",
" Baseline: [70.38003019 40.84743568 18.39250394]\n",
" Deltas: [ 1.02079538 -1.94996535 -0.0916254 ]\n",
" Norms: {'norm_A': 0.5391981423603522}\n",
" Thresholds: \n",
" norm_A : low 0.25 | (VALUE 0.5392) | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'STAY' (with step size factor of 1)\n",
"NOTICE: the tentative time step (0.16) results in norm values that leads to the following:\n",
"ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size.\n",
" [The current step started at System Time: 0.885, and will continue to 1.045]\n",
"\n",
"(STEP 41) ANALYSIS: Examining Conc. Changes from System Time 1.045 due to tentative step of 0.16:\n",
" Baseline: [71.40082557 38.89747033 18.30087853]\n",
" Deltas: [ 0.57686034 -1.10194237 -0.05177831]\n",
" Norms: {'norm_A': 0.17219175887655633}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.17219) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.16) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.32) at the next round, because all norms are low\n",
" [The current step started at System Time: 1.045, and will continue to 1.205]\n",
"\n",
"(STEP 42) ANALYSIS: Examining Conc. Changes from System Time 1.205 due to tentative step of 0.32:\n",
" Baseline: [71.97768591 37.79552796 18.24910022]\n",
" Deltas: [ 0.65197758 -1.24543442 -0.05852075]\n",
" Norms: {'norm_A': 0.21995626094117085}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.21996) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.32) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 0.64) at the next round, because all norms are low\n",
" [The current step started at System Time: 1.205, and will continue to 1.525]\n",
"\n",
"(STEP 43) ANALYSIS: Examining Conc. Changes from System Time 1.525 due to tentative step of 0.64:\n",
" Baseline: [72.62966349 36.55009354 18.19057947]\n",
" Deltas: [ 0.16979763 -0.32435443 -0.01524084]\n",
" Norms: {'norm_A': 0.01491881249157113}\n",
" Thresholds: \n",
" norm_A : (VALUE 0.014919) | low 0.25 | high 0.64 | abort 1.44\n",
" Step Factors: {'upshift': 2.0, 'downshift': 0.5, 'abort': 0.5}\n",
" => Action: 'LOW' (with step size factor of 2.0)\n",
"NOTICE: the tentative time step (0.64) results in norm values that leads to the following:\n",
"ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER, multiplied by 2.0 (set to 1.28) at the next round, because all norms are low\n",
" [The current step started at System Time: 1.525, and will continue to 2.165]\n",
"44 total step(s) taken\n"
]
}
],
"source": [
"dynamics.set_diagnostics() # To save diagnostic information about the call to single_compartment_react()\n",
"\n",
"# All of these settings are currently close to the default values... but subject to change; set for repeatability\n",
"dynamics.set_thresholds(norm=\"norm_A\", low=0.25, high=0.64, abort=1.44)\n",
"dynamics.set_thresholds(norm=\"norm_B\") # We are disabling norm_B (to conform to the original run)\n",
"dynamics.set_step_factors(upshift=2.0, downshift=0.5, abort=0.5) # Note: upshift=2.0 seems to often be excessive. About 1.4 is currently recommended\n",
"dynamics.set_error_step_factor(0.5)\n",
"\n",
"dynamics.single_compartment_react(initial_step=0.01, target_end_time=2.0, \n",
" variable_steps=True, explain_variable_steps=True)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "8a57c6d4-32cc-4351-8ad8-2e8b30e9fecf",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" SYSTEM TIME | \n",
" U | \n",
" X | \n",
" S | \n",
" caption | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0.0000 | \n",
" 50.000000 | \n",
" 100.000000 | \n",
" 0.000000 | \n",
" Initial state | \n",
"
\n",
" \n",
" | 1 | \n",
" 0.0050 | \n",
" 49.500000 | \n",
" 98.500000 | \n",
" 2.500000 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 0.0075 | \n",
" 49.302500 | \n",
" 97.798750 | \n",
" 3.596250 | \n",
" | \n",
"
\n",
" \n",
" | 3 | \n",
" 0.0125 | \n",
" 48.953325 | \n",
" 96.439656 | \n",
" 5.653694 | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" 0.0150 | \n",
" 48.821632 | \n",
" 95.801164 | \n",
" 6.555571 | \n",
" | \n",
"
\n",
" \n",
" | 5 | \n",
" 0.0200 | \n",
" 48.595639 | \n",
" 94.560814 | \n",
" 8.247909 | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" 0.0250 | \n",
" 48.439599 | \n",
" 93.389839 | \n",
" 9.730964 | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" 0.0300 | \n",
" 48.344441 | \n",
" 92.280920 | \n",
" 11.030197 | \n",
" | \n",
"
\n",
" \n",
" | 8 | \n",
" 0.0350 | \n",
" 48.302205 | \n",
" 91.227612 | \n",
" 12.167978 | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" 0.0400 | \n",
" 48.305902 | \n",
" 90.224238 | \n",
" 13.163959 | \n",
" | \n",
"
\n",
" \n",
" | 10 | \n",
" 0.0500 | \n",
" 48.392901 | \n",
" 88.307348 | \n",
" 14.906851 | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" 0.0550 | \n",
" 48.505246 | \n",
" 87.429943 | \n",
" 15.559566 | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" 0.0650 | \n",
" 48.779906 | \n",
" 85.740619 | \n",
" 16.699569 | \n",
" | \n",
"
\n",
" \n",
" | 13 | \n",
" 0.0750 | \n",
" 49.140273 | \n",
" 84.170374 | \n",
" 17.549079 | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" 0.0850 | \n",
" 49.561394 | \n",
" 82.698208 | \n",
" 18.179004 | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" 0.0950 | \n",
" 50.024487 | \n",
" 81.308002 | \n",
" 18.643025 | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" 0.1050 | \n",
" 50.515439 | \n",
" 79.987343 | \n",
" 18.981779 | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" 0.1250 | \n",
" 51.531906 | \n",
" 77.465916 | \n",
" 19.470272 | \n",
" | \n",
"
\n",
" \n",
" | 18 | \n",
" 0.1350 | \n",
" 52.058890 | \n",
" 76.310155 | \n",
" 19.572066 | \n",
" | \n",
"
\n",
" \n",
" | 19 | \n",
" 0.1550 | \n",
" 53.108064 | \n",
" 74.080194 | \n",
" 19.703677 | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" 0.1650 | \n",
" 53.622197 | \n",
" 73.040009 | \n",
" 19.715597 | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" 0.1850 | \n",
" 54.631805 | \n",
" 71.023480 | \n",
" 19.712910 | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" 0.2050 | \n",
" 55.600598 | \n",
" 69.127620 | \n",
" 19.671183 | \n",
" | \n",
"
\n",
" \n",
" | 23 | \n",
" 0.2250 | \n",
" 56.523964 | \n",
" 67.340505 | \n",
" 19.611568 | \n",
" | \n",
"
\n",
" \n",
" | 24 | \n",
" 0.2450 | \n",
" 57.400856 | \n",
" 65.653463 | \n",
" 19.544825 | \n",
" | \n",
"
\n",
" \n",
" | 25 | \n",
" 0.2650 | \n",
" 58.231994 | \n",
" 64.059634 | \n",
" 19.476378 | \n",
" | \n",
"
\n",
" \n",
" | 26 | \n",
" 0.2850 | \n",
" 59.018935 | \n",
" 62.553221 | \n",
" 19.408909 | \n",
" | \n",
"
\n",
" \n",
" | 27 | \n",
" 0.3050 | \n",
" 59.763603 | \n",
" 61.129097 | \n",
" 19.343697 | \n",
" | \n",
"
\n",
" \n",
" | 28 | \n",
" 0.3250 | \n",
" 60.468050 | \n",
" 59.782595 | \n",
" 19.281305 | \n",
" | \n",
"
\n",
" \n",
" | 29 | \n",
" 0.3450 | \n",
" 61.134337 | \n",
" 58.509396 | \n",
" 19.221930 | \n",
" | \n",
"
\n",
" \n",
" | 30 | \n",
" 0.3850 | \n",
" 62.394608 | \n",
" 56.101532 | \n",
" 19.109253 | \n",
" | \n",
"
\n",
" \n",
" | 31 | \n",
" 0.4050 | \n",
" 62.956304 | \n",
" 55.028550 | \n",
" 19.058842 | \n",
" | \n",
"
\n",
" \n",
" | 32 | \n",
" 0.4450 | \n",
" 64.018629 | \n",
" 52.999246 | \n",
" 18.963496 | \n",
" | \n",
"
\n",
" \n",
" | 33 | \n",
" 0.4850 | \n",
" 64.965457 | \n",
" 51.190576 | \n",
" 18.878510 | \n",
" | \n",
"
\n",
" \n",
" | 34 | \n",
" 0.5250 | \n",
" 65.809344 | \n",
" 49.578549 | \n",
" 18.802763 | \n",
" | \n",
"
\n",
" \n",
" | 35 | \n",
" 0.5650 | \n",
" 66.561481 | \n",
" 48.141786 | \n",
" 18.735252 | \n",
" | \n",
"
\n",
" \n",
" | 36 | \n",
" 0.6050 | \n",
" 67.231843 | \n",
" 46.861232 | \n",
" 18.675082 | \n",
" | \n",
"
\n",
" \n",
" | 37 | \n",
" 0.6850 | \n",
" 68.426800 | \n",
" 44.578576 | \n",
" 18.567824 | \n",
" | \n",
"
\n",
" \n",
" | 38 | \n",
" 0.7250 | \n",
" 68.894360 | \n",
" 43.685424 | \n",
" 18.525856 | \n",
" | \n",
"
\n",
" \n",
" | 39 | \n",
" 0.8050 | \n",
" 69.727810 | \n",
" 42.093333 | \n",
" 18.451046 | \n",
" | \n",
"
\n",
" \n",
" | 40 | \n",
" 0.8850 | \n",
" 70.380030 | \n",
" 40.847436 | \n",
" 18.392504 | \n",
" | \n",
"
\n",
" \n",
" | 41 | \n",
" 1.0450 | \n",
" 71.400826 | \n",
" 38.897470 | \n",
" 18.300879 | \n",
" | \n",
"
\n",
" \n",
" | 42 | \n",
" 1.2050 | \n",
" 71.977686 | \n",
" 37.795528 | \n",
" 18.249100 | \n",
" | \n",
"
\n",
" \n",
" | 43 | \n",
" 1.5250 | \n",
" 72.629663 | \n",
" 36.550094 | \n",
" 18.190579 | \n",
" | \n",
"
\n",
" \n",
" | 44 | \n",
" 2.1650 | \n",
" 72.799461 | \n",
" 36.225739 | \n",
" 18.175339 | \n",
" | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" SYSTEM TIME U X S caption\n",
"0 0.0000 50.000000 100.000000 0.000000 Initial state\n",
"1 0.0050 49.500000 98.500000 2.500000 \n",
"2 0.0075 49.302500 97.798750 3.596250 \n",
"3 0.0125 48.953325 96.439656 5.653694 \n",
"4 0.0150 48.821632 95.801164 6.555571 \n",
"5 0.0200 48.595639 94.560814 8.247909 \n",
"6 0.0250 48.439599 93.389839 9.730964 \n",
"7 0.0300 48.344441 92.280920 11.030197 \n",
"8 0.0350 48.302205 91.227612 12.167978 \n",
"9 0.0400 48.305902 90.224238 13.163959 \n",
"10 0.0500 48.392901 88.307348 14.906851 \n",
"11 0.0550 48.505246 87.429943 15.559566 \n",
"12 0.0650 48.779906 85.740619 16.699569 \n",
"13 0.0750 49.140273 84.170374 17.549079 \n",
"14 0.0850 49.561394 82.698208 18.179004 \n",
"15 0.0950 50.024487 81.308002 18.643025 \n",
"16 0.1050 50.515439 79.987343 18.981779 \n",
"17 0.1250 51.531906 77.465916 19.470272 \n",
"18 0.1350 52.058890 76.310155 19.572066 \n",
"19 0.1550 53.108064 74.080194 19.703677 \n",
"20 0.1650 53.622197 73.040009 19.715597 \n",
"21 0.1850 54.631805 71.023480 19.712910 \n",
"22 0.2050 55.600598 69.127620 19.671183 \n",
"23 0.2250 56.523964 67.340505 19.611568 \n",
"24 0.2450 57.400856 65.653463 19.544825 \n",
"25 0.2650 58.231994 64.059634 19.476378 \n",
"26 0.2850 59.018935 62.553221 19.408909 \n",
"27 0.3050 59.763603 61.129097 19.343697 \n",
"28 0.3250 60.468050 59.782595 19.281305 \n",
"29 0.3450 61.134337 58.509396 19.221930 \n",
"30 0.3850 62.394608 56.101532 19.109253 \n",
"31 0.4050 62.956304 55.028550 19.058842 \n",
"32 0.4450 64.018629 52.999246 18.963496 \n",
"33 0.4850 64.965457 51.190576 18.878510 \n",
"34 0.5250 65.809344 49.578549 18.802763 \n",
"35 0.5650 66.561481 48.141786 18.735252 \n",
"36 0.6050 67.231843 46.861232 18.675082 \n",
"37 0.6850 68.426800 44.578576 18.567824 \n",
"38 0.7250 68.894360 43.685424 18.525856 \n",
"39 0.8050 69.727810 42.093333 18.451046 \n",
"40 0.8850 70.380030 40.847436 18.392504 \n",
"41 1.0450 71.400826 38.897470 18.300879 \n",
"42 1.2050 71.977686 37.795528 18.249100 \n",
"43 1.5250 72.629663 36.550094 18.190579 \n",
"44 2.1650 72.799461 36.225739 18.175339 "
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.get_history()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "12da63da-9b3b-4c43-a68b-7dfb6585b9d0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"From time 0 to 0.005, in 1 step of 0.005\n",
"From time 0.005 to 0.0075, in 1 step of 0.0025\n",
"From time 0.0075 to 0.0125, in 1 step of 0.005\n",
"From time 0.0125 to 0.015, in 1 step of 0.0025\n",
"From time 0.015 to 0.04, in 5 steps of 0.005\n",
"From time 0.04 to 0.05, in 1 step of 0.01\n",
"From time 0.05 to 0.055, in 1 step of 0.005\n",
"From time 0.055 to 0.105, in 5 steps of 0.01\n",
"From time 0.105 to 0.125, in 1 step of 0.02\n",
"From time 0.125 to 0.135, in 1 step of 0.01\n",
"From time 0.135 to 0.155, in 1 step of 0.02\n",
"From time 0.155 to 0.165, in 1 step of 0.01\n",
"From time 0.165 to 0.345, in 9 steps of 0.02\n",
"From time 0.345 to 0.385, in 1 step of 0.04\n",
"From time 0.385 to 0.405, in 1 step of 0.02\n",
"From time 0.405 to 0.605, in 5 steps of 0.04\n",
"From time 0.605 to 0.685, in 1 step of 0.08\n",
"From time 0.685 to 0.725, in 1 step of 0.04\n",
"From time 0.725 to 0.885, in 2 steps of 0.08\n",
"From time 0.885 to 1.205, in 2 steps of 0.16\n",
"From time 1.205 to 1.525, in 1 step of 0.32\n",
"From time 1.525 to 2.165, in 1 step of 0.64\n",
"(44 steps total)\n"
]
}
],
"source": [
"(transition_times, step_sizes) = dynamics.explain_time_advance(return_times=True)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "438e4ec0-44f7-4c0d-b6a6-4a435da6e683",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0.005 , 0.0025, 0.005 , 0.0025, 0.005 , 0.01 , 0.005 , 0.01 ,\n",
" 0.02 , 0.01 , 0.02 , 0.01 , 0.02 , 0.04 , 0.02 , 0.04 ,\n",
" 0.08 , 0.04 , 0.08 , 0.16 , 0.32 , 0.64 ])"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.array(step_sizes)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "74d500e5-0b59-419c-90ae-4948eb7c8611",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0. , 0.005 , 0.0075, 0.0125, 0.015 , 0.04 , 0.05 , 0.055 ,\n",
" 0.105 , 0.125 , 0.135 , 0.155 , 0.165 , 0.345 , 0.385 , 0.405 ,\n",
" 0.605 , 0.685 , 0.725 , 0.885 , 1.205 , 1.525 , 2.165 ])"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.array(transition_times) # Note: there will be one more transition time (the end time) than step sizes"
]
},
{
"cell_type": "markdown",
"id": "cbf6c9c7-8cec-400f-9e70-49ff1a9f485c",
"metadata": {
"tags": []
},
"source": [
"## Plots of changes of concentration with time"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "c388dae7-c4a6-4644-a390-958e3862d102",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "Chemical=U
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "U",
"line": {
"color": "green",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "U",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
50,
49.5,
49.3025,
48.953325,
48.82163225,
48.595638778125,
48.439598731740624,
48.34444128763423,
48.30220476057483,
48.30590183654385,
48.39290050226037,
48.5052455391863,
48.7799058814107,
49.14027331067588,
49.56139415522215,
50.02448656789047,
50.51543882771388,
51.5319059043599,
52.05888953946266,
53.10806448877514,
53.6221973851961,
54.631804962718874,
55.60059843741017,
56.52396378475239,
57.400856045782184,
58.231993841938426,
59.018934628561645,
59.76360275298115,
60.468050216020096,
61.13433693633931,
62.39460766762712,
62.95630384813689,
64.01862904935517,
64.96545734689445,
65.8093438554794,
66.56148063896055,
67.23184298514343,
68.4268002988057,
68.89435981841929,
69.72781007217334,
70.38003019051833,
71.40082556698592,
71.97768590721373,
72.62966349214221,
72.7994611238083
],
"yaxis": "y"
},
{
"hovertemplate": "Chemical=X
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "X",
"line": {
"color": "orange",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "X",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
100,
98.5,
97.79875,
96.43965625,
95.801164234375,
94.56081390882812,
93.38983895624335,
92.28092027930796,
91.22761238948105,
90.22423754631991,
88.30734794676586,
87.42994325902578,
85.7406189010111,
84.17037449415082,
82.69820799239614,
81.30800197445382,
79.98734340860611,
77.46591627640568,
76.31015510300598,
74.08019369499387,
73.0400085237914,
71.02347961706188,
69.12762009493821,
67.34050485287088,
65.65346267101354,
64.05963393924337,
62.55322130811434,
61.12909716179896,
59.782595011959664,
58.5093958579621,
56.10153161965286,
55.02855008788483,
52.99924620914057,
51.19057563015947,
49.578548876792716,
48.14178623051722,
46.86123248082995,
44.57857582889467,
43.685424387065844,
42.0933334026959,
40.84743568346842,
38.897470333478665,
37.79552796465638,
36.5500935427452,
36.2257391168805
],
"yaxis": "y"
},
{
"hovertemplate": "Chemical=S
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "S",
"line": {
"color": "blue",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "S",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
0,
2.5,
3.59625,
5.65369375,
6.555571265625001,
8.247908534921876,
9.730963580275391,
11.03019714542356,
12.167978089369273,
13.163958780592365,
14.906851048713396,
15.559565662601617,
16.699569336167485,
17.5490788844974,
18.179003697159533,
18.643024889765208,
18.981778935966094,
19.470271914874488,
19.572065818068666,
19.703677327455825,
19.715596705816367,
19.712910457500335,
19.671183030241412,
19.611567577624296,
19.54482523742205,
19.476378376879737,
19.40890943476233,
19.343697332238698,
19.2813045560001,
19.221930269359245,
19.10925304509285,
19.058842215841338,
18.963495692149042,
18.878509676051582,
18.80276341224844,
18.735252491561642,
18.67508154888315,
18.56782357349389,
18.52585597609554,
18.451046452957367,
18.392503935494886,
18.300878532549454,
18.24910022091612,
18.190579472970335,
18.17533863550288
],
"yaxis": "y"
}
],
"layout": {
"autosize": true,
"legend": {
"title": {
"text": "Chemical"
},
"tracegroupgap": 0
},
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Changes in concentration for `2 S <-> U` and `S <-> X`"
},
"xaxis": {
"anchor": "y",
"autorange": true,
"domain": [
0,
1
],
"range": [
0,
2.165
],
"title": {
"text": "SYSTEM TIME"
},
"type": "linear"
},
"yaxis": {
"anchor": "x",
"autorange": true,
"domain": [
0,
1
],
"range": [
-5.555555555555555,
105.55555555555556
],
"title": {
"text": "concentration"
},
"type": "linear"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dynamics.plot_history(colors=['green', 'orange', 'blue'])"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "2f07ad6b-a1c9-4d99-8108-72b16727303d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Min abs distance found at data row: 28\n"
]
},
{
"data": {
"text/plain": [
"(0.3183157284824908, 60.23261431038145)"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.curve_intersection(\"U\", \"X\", t_start=0.3, t_end=0.35) # Compare with the value from experiment \"variable_steps_2\""
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "a264d96b-31de-493d-9e92-742a84b4a453",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "Chemical=U
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "U",
"line": {
"color": "green",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "U",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
50,
49.5,
49.3025,
48.953325,
48.82163225,
48.595638778125,
48.439598731740624,
48.34444128763423,
48.30220476057483,
48.30590183654385,
48.39290050226037,
48.5052455391863,
48.7799058814107,
49.14027331067588,
49.56139415522215,
50.02448656789047,
50.51543882771388,
51.5319059043599,
52.05888953946266,
53.10806448877514,
53.6221973851961,
54.631804962718874,
55.60059843741017,
56.52396378475239,
57.400856045782184,
58.231993841938426,
59.018934628561645,
59.76360275298115,
60.468050216020096,
61.13433693633931,
62.39460766762712,
62.95630384813689,
64.01862904935517,
64.96545734689445,
65.8093438554794,
66.56148063896055,
67.23184298514343,
68.4268002988057,
68.89435981841929,
69.72781007217334,
70.38003019051833,
71.40082556698592,
71.97768590721373,
72.62966349214221,
72.7994611238083
],
"yaxis": "y"
},
{
"hovertemplate": "Chemical=X
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "X",
"line": {
"color": "orange",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "X",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
100,
98.5,
97.79875,
96.43965625,
95.801164234375,
94.56081390882812,
93.38983895624335,
92.28092027930796,
91.22761238948105,
90.22423754631991,
88.30734794676586,
87.42994325902578,
85.7406189010111,
84.17037449415082,
82.69820799239614,
81.30800197445382,
79.98734340860611,
77.46591627640568,
76.31015510300598,
74.08019369499387,
73.0400085237914,
71.02347961706188,
69.12762009493821,
67.34050485287088,
65.65346267101354,
64.05963393924337,
62.55322130811434,
61.12909716179896,
59.782595011959664,
58.5093958579621,
56.10153161965286,
55.02855008788483,
52.99924620914057,
51.19057563015947,
49.578548876792716,
48.14178623051722,
46.86123248082995,
44.57857582889467,
43.685424387065844,
42.0933334026959,
40.84743568346842,
38.897470333478665,
37.79552796465638,
36.5500935427452,
36.2257391168805
],
"yaxis": "y"
},
{
"hovertemplate": "Chemical=S
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "S",
"line": {
"color": "blue",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "S",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
0,
2.5,
3.59625,
5.65369375,
6.555571265625001,
8.247908534921876,
9.730963580275391,
11.03019714542356,
12.167978089369273,
13.163958780592365,
14.906851048713396,
15.559565662601617,
16.699569336167485,
17.5490788844974,
18.179003697159533,
18.643024889765208,
18.981778935966094,
19.470271914874488,
19.572065818068666,
19.703677327455825,
19.715596705816367,
19.712910457500335,
19.671183030241412,
19.611567577624296,
19.54482523742205,
19.476378376879737,
19.40890943476233,
19.343697332238698,
19.2813045560001,
19.221930269359245,
19.10925304509285,
19.058842215841338,
18.963495692149042,
18.878509676051582,
18.80276341224844,
18.735252491561642,
18.67508154888315,
18.56782357349389,
18.52585597609554,
18.451046452957367,
18.392503935494886,
18.300878532549454,
18.24910022091612,
18.190579472970335,
18.17533863550288
],
"yaxis": "y"
}
],
"layout": {
"autosize": true,
"legend": {
"title": {
"text": "Chemical"
},
"tracegroupgap": 0
},
"shapes": [
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0,
"x1": 0,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.005,
"x1": 0.005,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.0075,
"x1": 0.0075,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.0125,
"x1": 0.0125,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.015000000000000001,
"x1": 0.015000000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.02,
"x1": 0.02,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.025,
"x1": 0.025,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.030000000000000002,
"x1": 0.030000000000000002,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.035,
"x1": 0.035,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.04,
"x1": 0.04,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.05,
"x1": 0.05,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.055,
"x1": 0.055,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.065,
"x1": 0.065,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.075,
"x1": 0.075,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.08499999999999999,
"x1": 0.08499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.09499999999999999,
"x1": 0.09499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.10499999999999998,
"x1": 0.10499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.12499999999999999,
"x1": 0.12499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.13499999999999998,
"x1": 0.13499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.15499999999999997,
"x1": 0.15499999999999997,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.16499999999999998,
"x1": 0.16499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.18499999999999997,
"x1": 0.18499999999999997,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.20499999999999996,
"x1": 0.20499999999999996,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.22499999999999995,
"x1": 0.22499999999999995,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.24499999999999994,
"x1": 0.24499999999999994,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.26499999999999996,
"x1": 0.26499999999999996,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.285,
"x1": 0.285,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.305,
"x1": 0.305,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.325,
"x1": 0.325,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.34500000000000003,
"x1": 0.34500000000000003,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.385,
"x1": 0.385,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.405,
"x1": 0.405,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.445,
"x1": 0.445,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.485,
"x1": 0.485,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.525,
"x1": 0.525,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.5650000000000001,
"x1": 0.5650000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.6050000000000001,
"x1": 0.6050000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.685,
"x1": 0.685,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.7250000000000001,
"x1": 0.7250000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.805,
"x1": 0.805,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.885,
"x1": 0.885,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.045,
"x1": 1.045,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.2049999999999998,
"x1": 1.2049999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.525,
"x1": 1.525,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 2.165,
"x1": 2.165,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
}
],
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Changes in concentration for `2 S <-> U` and `S <-> X` (time steps shown in dashed lines)"
},
"xaxis": {
"anchor": "y",
"autorange": true,
"domain": [
0,
1
],
"range": [
-0.0009058577405857741,
2.1659058577405856
],
"title": {
"text": "SYSTEM TIME"
},
"type": "linear"
},
"yaxis": {
"anchor": "x",
"autorange": true,
"domain": [
0,
1
],
"range": [
-5.555555555555555,
105.55555555555556
],
"title": {
"text": "concentration"
},
"type": "linear"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dynamics.plot_history(colors=['green', 'orange', 'blue'], show_intervals=True)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "75866674-1a8a-40a6-bdc4-ee52eb94a823",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "Chemical=U
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "U",
"line": {
"color": "green",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "U",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
50,
49.5,
49.3025,
48.953325,
48.82163225,
48.595638778125,
48.439598731740624,
48.34444128763423,
48.30220476057483,
48.30590183654385,
48.39290050226037,
48.5052455391863,
48.7799058814107,
49.14027331067588,
49.56139415522215,
50.02448656789047,
50.51543882771388,
51.5319059043599,
52.05888953946266,
53.10806448877514,
53.6221973851961,
54.631804962718874,
55.60059843741017,
56.52396378475239,
57.400856045782184,
58.231993841938426,
59.018934628561645,
59.76360275298115,
60.468050216020096,
61.13433693633931,
62.39460766762712,
62.95630384813689,
64.01862904935517,
64.96545734689445,
65.8093438554794,
66.56148063896055,
67.23184298514343,
68.4268002988057,
68.89435981841929,
69.72781007217334,
70.38003019051833,
71.40082556698592,
71.97768590721373,
72.62966349214221,
72.7994611238083
],
"yaxis": "y"
},
{
"hovertemplate": "Chemical=X
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "X",
"line": {
"color": "orange",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "X",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
100,
98.5,
97.79875,
96.43965625,
95.801164234375,
94.56081390882812,
93.38983895624335,
92.28092027930796,
91.22761238948105,
90.22423754631991,
88.30734794676586,
87.42994325902578,
85.7406189010111,
84.17037449415082,
82.69820799239614,
81.30800197445382,
79.98734340860611,
77.46591627640568,
76.31015510300598,
74.08019369499387,
73.0400085237914,
71.02347961706188,
69.12762009493821,
67.34050485287088,
65.65346267101354,
64.05963393924337,
62.55322130811434,
61.12909716179896,
59.782595011959664,
58.5093958579621,
56.10153161965286,
55.02855008788483,
52.99924620914057,
51.19057563015947,
49.578548876792716,
48.14178623051722,
46.86123248082995,
44.57857582889467,
43.685424387065844,
42.0933334026959,
40.84743568346842,
38.897470333478665,
37.79552796465638,
36.5500935427452,
36.2257391168805
],
"yaxis": "y"
},
{
"hovertemplate": "Chemical=S
SYSTEM TIME=%{x}
concentration=%{y}",
"legendgroup": "S",
"line": {
"color": "blue",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "S",
"orientation": "v",
"showlegend": true,
"type": "scatter",
"x": [
0,
0.005,
0.0075,
0.0125,
0.015000000000000001,
0.02,
0.025,
0.030000000000000002,
0.035,
0.04,
0.05,
0.055,
0.065,
0.075,
0.08499999999999999,
0.09499999999999999,
0.10499999999999998,
0.12499999999999999,
0.13499999999999998,
0.15499999999999997,
0.16499999999999998,
0.18499999999999997,
0.20499999999999996,
0.22499999999999995,
0.24499999999999994,
0.26499999999999996,
0.285,
0.305,
0.325,
0.34500000000000003,
0.385,
0.405,
0.445,
0.485,
0.525,
0.5650000000000001,
0.6050000000000001,
0.685,
0.7250000000000001,
0.805,
0.885,
1.045,
1.2049999999999998,
1.525,
2.165
],
"xaxis": "x",
"y": [
0,
2.5,
3.59625,
5.65369375,
6.555571265625001,
8.247908534921876,
9.730963580275391,
11.03019714542356,
12.167978089369273,
13.163958780592365,
14.906851048713396,
15.559565662601617,
16.699569336167485,
17.5490788844974,
18.179003697159533,
18.643024889765208,
18.981778935966094,
19.470271914874488,
19.572065818068666,
19.703677327455825,
19.715596705816367,
19.712910457500335,
19.671183030241412,
19.611567577624296,
19.54482523742205,
19.476378376879737,
19.40890943476233,
19.343697332238698,
19.2813045560001,
19.221930269359245,
19.10925304509285,
19.058842215841338,
18.963495692149042,
18.878509676051582,
18.80276341224844,
18.735252491561642,
18.67508154888315,
18.56782357349389,
18.52585597609554,
18.451046452957367,
18.392503935494886,
18.300878532549454,
18.24910022091612,
18.190579472970335,
18.17533863550288
],
"yaxis": "y"
}
],
"layout": {
"autosize": true,
"legend": {
"title": {
"text": "Chemical"
},
"tracegroupgap": 0
},
"shapes": [
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0,
"x1": 0,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.005,
"x1": 0.005,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.0075,
"x1": 0.0075,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.0125,
"x1": 0.0125,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.015000000000000001,
"x1": 0.015000000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.04,
"x1": 0.04,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.05,
"x1": 0.05,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.055,
"x1": 0.055,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.10499999999999998,
"x1": 0.10499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.12499999999999999,
"x1": 0.12499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.13499999999999998,
"x1": 0.13499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.15499999999999997,
"x1": 0.15499999999999997,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.16499999999999998,
"x1": 0.16499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.34500000000000003,
"x1": 0.34500000000000003,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.385,
"x1": 0.385,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.405,
"x1": 0.405,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.6050000000000001,
"x1": 0.6050000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.685,
"x1": 0.685,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.7250000000000001,
"x1": 0.7250000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.885,
"x1": 0.885,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.2049999999999998,
"x1": 1.2049999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.525,
"x1": 1.525,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 2.165,
"x1": 2.165,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
}
],
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Critical values of time-step changes for reactions `2 S <-> U` and `S <-> X`"
},
"xaxis": {
"anchor": "y",
"autorange": true,
"domain": [
0,
1
],
"range": [
-0.0009058577405857741,
2.1659058577405856
],
"title": {
"text": "SYSTEM TIME"
},
"type": "linear"
},
"yaxis": {
"anchor": "x",
"autorange": true,
"domain": [
0,
1
],
"range": [
-5.555555555555555,
105.55555555555556
],
"title": {
"text": "concentration"
},
"type": "linear"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Show the \"critical values\", i.e. times when the step size changes\n",
"dynamics.plot_history(colors=['green', 'orange', 'blue'], vertical_lines=transition_times,\n",
" title=\"Critical values of time-step changes for reactions `2 S <-> U` and `S <-> X`\")"
]
},
{
"cell_type": "markdown",
"id": "73277ff6-78f4-4b3c-9304-c22e4873c566",
"metadata": {},
"source": [
"## Note: the dashed lines in the plots immediatly above are NOT the steps; they are the \"critical values\", i.e. times when the step size changes. \n",
"The time steps were shown in an earlier plots"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "ca14a2d7-5916-4144-a909-bfc3cf89c02c",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "x=%{x}
y=%{y}",
"legendgroup": "",
"line": {
"color": "#636efa",
"dash": "solid"
},
"marker": {
"symbol": "circle"
},
"mode": "lines",
"name": "",
"orientation": "v",
"showlegend": false,
"type": "scatter",
"x": [
0,
0.005,
0.005,
0.0075,
0.0075,
0.0125,
0.0125,
0.015000000000000001,
0.015000000000000001,
0.04,
0.04,
0.05,
0.05,
0.055,
0.055,
0.10499999999999998,
0.10499999999999998,
0.12499999999999999,
0.12499999999999999,
0.13499999999999998,
0.13499999999999998,
0.15499999999999997,
0.15499999999999997,
0.16499999999999998,
0.16499999999999998,
0.34500000000000003,
0.34500000000000003,
0.385,
0.385,
0.405,
0.405,
0.6050000000000001,
0.6050000000000001,
0.685,
0.685,
0.7250000000000001,
0.7250000000000001,
0.885,
0.885,
1.2049999999999998,
1.2049999999999998,
1.525,
1.525,
2.165
],
"xaxis": "x",
"y": [
0.005,
0.005,
0.0024999999999999996,
0.0024999999999999996,
0.005000000000000001,
0.005000000000000001,
0.0025000000000000005,
0.0025000000000000005,
0.0049999999999999975,
0.0049999999999999975,
0.010000000000000002,
0.010000000000000002,
0.0049999999999999975,
0.0049999999999999975,
0.009999999999999995,
0.009999999999999995,
0.020000000000000004,
0.020000000000000004,
0.009999999999999995,
0.009999999999999995,
0.01999999999999999,
0.01999999999999999,
0.010000000000000009,
0.010000000000000009,
0.020000000000000018,
0.020000000000000018,
0.03999999999999998,
0.03999999999999998,
0.020000000000000018,
0.020000000000000018,
0.040000000000000036,
0.040000000000000036,
0.07999999999999996,
0.07999999999999996,
0.040000000000000036,
0.040000000000000036,
0.07999999999999996,
0.07999999999999996,
0.15999999999999992,
0.15999999999999992,
0.32000000000000006,
0.32000000000000006,
0.6400000000000001,
0.6400000000000001
],
"yaxis": "y"
}
],
"layout": {
"autosize": true,
"legend": {
"tracegroupgap": 0
},
"margin": {
"t": 60
},
"shapes": [
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0,
"x1": 0,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.005,
"x1": 0.005,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.0075,
"x1": 0.0075,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.0125,
"x1": 0.0125,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.015000000000000001,
"x1": 0.015000000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.02,
"x1": 0.02,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.025,
"x1": 0.025,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.030000000000000002,
"x1": 0.030000000000000002,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.035,
"x1": 0.035,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.04,
"x1": 0.04,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.05,
"x1": 0.05,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.055,
"x1": 0.055,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.065,
"x1": 0.065,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.075,
"x1": 0.075,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.08499999999999999,
"x1": 0.08499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.09499999999999999,
"x1": 0.09499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.10499999999999998,
"x1": 0.10499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.12499999999999999,
"x1": 0.12499999999999999,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.13499999999999998,
"x1": 0.13499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.15499999999999997,
"x1": 0.15499999999999997,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.16499999999999998,
"x1": 0.16499999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.18499999999999997,
"x1": 0.18499999999999997,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.20499999999999996,
"x1": 0.20499999999999996,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.22499999999999995,
"x1": 0.22499999999999995,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.24499999999999994,
"x1": 0.24499999999999994,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.26499999999999996,
"x1": 0.26499999999999996,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.285,
"x1": 0.285,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.305,
"x1": 0.305,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.325,
"x1": 0.325,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.34500000000000003,
"x1": 0.34500000000000003,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.385,
"x1": 0.385,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.405,
"x1": 0.405,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.445,
"x1": 0.445,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.485,
"x1": 0.485,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.525,
"x1": 0.525,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.5650000000000001,
"x1": 0.5650000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.6050000000000001,
"x1": 0.6050000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.685,
"x1": 0.685,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.7250000000000001,
"x1": 0.7250000000000001,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.805,
"x1": 0.805,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 0.885,
"x1": 0.885,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.045,
"x1": 1.045,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.2049999999999998,
"x1": 1.2049999999999998,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 1.525,
"x1": 1.525,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
},
{
"line": {
"color": "gray",
"dash": "dot",
"width": 1
},
"type": "line",
"x0": 2.165,
"x1": 2.165,
"xref": "x",
"y0": 0,
"y1": 1,
"yref": "y domain"
}
],
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"contour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "contour"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"heatmap": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmap"
}
],
"heatmapgl": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "heatmapgl"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"histogram2d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2d"
}
],
"histogram2dcontour": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "histogram2dcontour"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"scatter3d": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatter3d"
}
],
"scattercarpet": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattercarpet"
}
],
"scattergeo": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergeo"
}
],
"scattergl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattergl"
}
],
"scattermapbox": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scattermapbox"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"scatterternary": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterternary"
}
],
"surface": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"colorscale": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"type": "surface"
}
],
"table": [
{
"cells": {
"fill": {
"color": "#EBF0F8"
},
"line": {
"color": "white"
}
},
"header": {
"fill": {
"color": "#C8D4E3"
},
"line": {
"color": "white"
}
},
"type": "table"
}
]
},
"layout": {
"annotationdefaults": {
"arrowcolor": "#2a3f5f",
"arrowhead": 0,
"arrowwidth": 1
},
"autotypenumbers": "strict",
"coloraxis": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"colorscale": {
"diverging": [
[
0,
"#8e0152"
],
[
0.1,
"#c51b7d"
],
[
0.2,
"#de77ae"
],
[
0.3,
"#f1b6da"
],
[
0.4,
"#fde0ef"
],
[
0.5,
"#f7f7f7"
],
[
0.6,
"#e6f5d0"
],
[
0.7,
"#b8e186"
],
[
0.8,
"#7fbc41"
],
[
0.9,
"#4d9221"
],
[
1,
"#276419"
]
],
"sequential": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
],
"sequentialminus": [
[
0,
"#0d0887"
],
[
0.1111111111111111,
"#46039f"
],
[
0.2222222222222222,
"#7201a8"
],
[
0.3333333333333333,
"#9c179e"
],
[
0.4444444444444444,
"#bd3786"
],
[
0.5555555555555556,
"#d8576b"
],
[
0.6666666666666666,
"#ed7953"
],
[
0.7777777777777778,
"#fb9f3a"
],
[
0.8888888888888888,
"#fdca26"
],
[
1,
"#f0f921"
]
]
},
"colorway": [
"#636efa",
"#EF553B",
"#00cc96",
"#ab63fa",
"#FFA15A",
"#19d3f3",
"#FF6692",
"#B6E880",
"#FF97FF",
"#FECB52"
],
"font": {
"color": "#2a3f5f"
},
"geo": {
"bgcolor": "white",
"lakecolor": "white",
"landcolor": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Simulation step sizes"
},
"xaxis": {
"anchor": "y",
"autorange": true,
"domain": [
0,
1
],
"range": [
-0.0008880229696472518,
2.1658880229696473
],
"title": {
"text": "SYSTEM TIME"
},
"type": "linear"
},
"yaxis": {
"anchor": "x",
"autorange": true,
"domain": [
0,
1
],
"range": [
-0.03291666666666667,
0.6754166666666668
],
"title": {
"text": "Step size"
},
"type": "linear"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dynamics.plot_step_sizes(show_intervals=True)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "3d012f8e-4066-40b6-9b9a-d1e9dd7532c7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0: 2 S <-> U\n",
"Final concentrations: [U] = 72.8 ; [S] = 18.18\n",
"1. Ratio of reactant/product concentrations, adjusted for reaction orders: 4.0054\n",
" Formula used: [U] / [S]\n",
"2. Ratio of forward/reverse reaction rates: 4.0\n",
"Discrepancy between the two values: 0.1349 %\n",
"Reaction IS in equilibrium (within 1% tolerance)\n",
"\n",
"1: S <-> X\n",
"Final concentrations: [X] = 36.23 ; [S] = 18.18\n",
"1. Ratio of reactant/product concentrations, adjusted for reaction orders: 1.99313\n",
" Formula used: [X] / [S]\n",
"2. Ratio of forward/reverse reaction rates: 2.0\n",
"Discrepancy between the two values: 0.3437 %\n",
"Reaction IS in equilibrium (within 1% tolerance)\n",
"\n"
]
},
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.is_in_equilibrium()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "9dd856c0-58e6-4048-8b03-90f68e725232",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reaction: 2 S <-> U\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" START_TIME | \n",
" Delta U | \n",
" Delta X | \n",
" Delta S | \n",
" time_step | \n",
" caption | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0.0000 | \n",
" -1.000000 | \n",
" 0.0 | \n",
" 2.000000 | \n",
" 0.0100 | \n",
" aborted: excessive norm value(s) | \n",
"
\n",
" \n",
" | 1 | \n",
" 0.0000 | \n",
" -0.500000 | \n",
" 0.0 | \n",
" 1.000000 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 0.0050 | \n",
" -0.197500 | \n",
" 0.0 | \n",
" 0.395000 | \n",
" 0.0025 | \n",
" | \n",
"
\n",
" \n",
" | 3 | \n",
" 0.0075 | \n",
" -0.349175 | \n",
" 0.0 | \n",
" 0.698350 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" 0.0125 | \n",
" -0.131693 | \n",
" 0.0 | \n",
" 0.263385 | \n",
" 0.0025 | \n",
" | \n",
"
\n",
" \n",
" | 5 | \n",
" 0.0150 | \n",
" -0.225993 | \n",
" 0.0 | \n",
" 0.451987 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" 0.0200 | \n",
" -0.156040 | \n",
" 0.0 | \n",
" 0.312080 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" 0.0250 | \n",
" -0.095157 | \n",
" 0.0 | \n",
" 0.190315 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 8 | \n",
" 0.0300 | \n",
" -0.042237 | \n",
" 0.0 | \n",
" 0.084473 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" 0.0350 | \n",
" 0.003697 | \n",
" 0.0 | \n",
" -0.007394 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 10 | \n",
" 0.0400 | \n",
" 0.086999 | \n",
" 0.0 | \n",
" -0.173997 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" 0.0500 | \n",
" 0.112345 | \n",
" 0.0 | \n",
" -0.224690 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" 0.0550 | \n",
" 0.274660 | \n",
" 0.0 | \n",
" -0.549321 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 13 | \n",
" 0.0650 | \n",
" 0.360367 | \n",
" 0.0 | \n",
" -0.720735 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" 0.0750 | \n",
" 0.421121 | \n",
" 0.0 | \n",
" -0.842242 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" 0.0850 | \n",
" 0.463092 | \n",
" 0.0 | \n",
" -0.926185 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" 0.0950 | \n",
" 0.490952 | \n",
" 0.0 | \n",
" -0.981905 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" 0.1050 | \n",
" 1.016467 | \n",
" 0.0 | \n",
" -2.032934 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 18 | \n",
" 0.1250 | \n",
" 0.526984 | \n",
" 0.0 | \n",
" -1.053967 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 19 | \n",
" 0.1350 | \n",
" 1.049175 | \n",
" 0.0 | \n",
" -2.098350 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" 0.1550 | \n",
" 0.514133 | \n",
" 0.0 | \n",
" -1.028266 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" 0.1650 | \n",
" 1.009608 | \n",
" 0.0 | \n",
" -2.019215 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" 0.1850 | \n",
" 0.968793 | \n",
" 0.0 | \n",
" -1.937587 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 23 | \n",
" 0.2050 | \n",
" 0.923365 | \n",
" 0.0 | \n",
" -1.846731 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 24 | \n",
" 0.2250 | \n",
" 0.876892 | \n",
" 0.0 | \n",
" -1.753785 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 25 | \n",
" 0.2450 | \n",
" 0.831138 | \n",
" 0.0 | \n",
" -1.662276 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 26 | \n",
" 0.2650 | \n",
" 0.786941 | \n",
" 0.0 | \n",
" -1.573882 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 27 | \n",
" 0.2850 | \n",
" 0.744668 | \n",
" 0.0 | \n",
" -1.489336 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 28 | \n",
" 0.3050 | \n",
" 0.704447 | \n",
" 0.0 | \n",
" -1.408895 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 29 | \n",
" 0.3250 | \n",
" 0.666287 | \n",
" 0.0 | \n",
" -1.332573 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 30 | \n",
" 0.3450 | \n",
" 1.260271 | \n",
" 0.0 | \n",
" -2.520541 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 31 | \n",
" 0.3850 | \n",
" 0.561696 | \n",
" 0.0 | \n",
" -1.123392 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 32 | \n",
" 0.4050 | \n",
" 1.062325 | \n",
" 0.0 | \n",
" -2.124650 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 33 | \n",
" 0.4450 | \n",
" 0.946828 | \n",
" 0.0 | \n",
" -1.893657 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 34 | \n",
" 0.4850 | \n",
" 0.843887 | \n",
" 0.0 | \n",
" -1.687773 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 35 | \n",
" 0.5250 | \n",
" 0.752137 | \n",
" 0.0 | \n",
" -1.504274 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 36 | \n",
" 0.5650 | \n",
" 0.670362 | \n",
" 0.0 | \n",
" -1.340725 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 37 | \n",
" 0.6050 | \n",
" 1.194957 | \n",
" 0.0 | \n",
" -2.389915 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 38 | \n",
" 0.6850 | \n",
" 0.467560 | \n",
" 0.0 | \n",
" -0.935119 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 39 | \n",
" 0.7250 | \n",
" 0.833450 | \n",
" 0.0 | \n",
" -1.666901 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 40 | \n",
" 0.8050 | \n",
" 0.652220 | \n",
" 0.0 | \n",
" -1.304440 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 41 | \n",
" 0.8850 | \n",
" 1.020795 | \n",
" 0.0 | \n",
" -2.041591 | \n",
" 0.1600 | \n",
" | \n",
"
\n",
" \n",
" | 42 | \n",
" 1.0450 | \n",
" 0.576860 | \n",
" 0.0 | \n",
" -1.153721 | \n",
" 0.1600 | \n",
" | \n",
"
\n",
" \n",
" | 43 | \n",
" 1.2050 | \n",
" 0.651978 | \n",
" 0.0 | \n",
" -1.303955 | \n",
" 0.3200 | \n",
" | \n",
"
\n",
" \n",
" | 44 | \n",
" 1.5250 | \n",
" 0.169798 | \n",
" 0.0 | \n",
" -0.339595 | \n",
" 0.6400 | \n",
" | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" START_TIME Delta U Delta X Delta S time_step \\\n",
"0 0.0000 -1.000000 0.0 2.000000 0.0100 \n",
"1 0.0000 -0.500000 0.0 1.000000 0.0050 \n",
"2 0.0050 -0.197500 0.0 0.395000 0.0025 \n",
"3 0.0075 -0.349175 0.0 0.698350 0.0050 \n",
"4 0.0125 -0.131693 0.0 0.263385 0.0025 \n",
"5 0.0150 -0.225993 0.0 0.451987 0.0050 \n",
"6 0.0200 -0.156040 0.0 0.312080 0.0050 \n",
"7 0.0250 -0.095157 0.0 0.190315 0.0050 \n",
"8 0.0300 -0.042237 0.0 0.084473 0.0050 \n",
"9 0.0350 0.003697 0.0 -0.007394 0.0050 \n",
"10 0.0400 0.086999 0.0 -0.173997 0.0100 \n",
"11 0.0500 0.112345 0.0 -0.224690 0.0050 \n",
"12 0.0550 0.274660 0.0 -0.549321 0.0100 \n",
"13 0.0650 0.360367 0.0 -0.720735 0.0100 \n",
"14 0.0750 0.421121 0.0 -0.842242 0.0100 \n",
"15 0.0850 0.463092 0.0 -0.926185 0.0100 \n",
"16 0.0950 0.490952 0.0 -0.981905 0.0100 \n",
"17 0.1050 1.016467 0.0 -2.032934 0.0200 \n",
"18 0.1250 0.526984 0.0 -1.053967 0.0100 \n",
"19 0.1350 1.049175 0.0 -2.098350 0.0200 \n",
"20 0.1550 0.514133 0.0 -1.028266 0.0100 \n",
"21 0.1650 1.009608 0.0 -2.019215 0.0200 \n",
"22 0.1850 0.968793 0.0 -1.937587 0.0200 \n",
"23 0.2050 0.923365 0.0 -1.846731 0.0200 \n",
"24 0.2250 0.876892 0.0 -1.753785 0.0200 \n",
"25 0.2450 0.831138 0.0 -1.662276 0.0200 \n",
"26 0.2650 0.786941 0.0 -1.573882 0.0200 \n",
"27 0.2850 0.744668 0.0 -1.489336 0.0200 \n",
"28 0.3050 0.704447 0.0 -1.408895 0.0200 \n",
"29 0.3250 0.666287 0.0 -1.332573 0.0200 \n",
"30 0.3450 1.260271 0.0 -2.520541 0.0400 \n",
"31 0.3850 0.561696 0.0 -1.123392 0.0200 \n",
"32 0.4050 1.062325 0.0 -2.124650 0.0400 \n",
"33 0.4450 0.946828 0.0 -1.893657 0.0400 \n",
"34 0.4850 0.843887 0.0 -1.687773 0.0400 \n",
"35 0.5250 0.752137 0.0 -1.504274 0.0400 \n",
"36 0.5650 0.670362 0.0 -1.340725 0.0400 \n",
"37 0.6050 1.194957 0.0 -2.389915 0.0800 \n",
"38 0.6850 0.467560 0.0 -0.935119 0.0400 \n",
"39 0.7250 0.833450 0.0 -1.666901 0.0800 \n",
"40 0.8050 0.652220 0.0 -1.304440 0.0800 \n",
"41 0.8850 1.020795 0.0 -2.041591 0.1600 \n",
"42 1.0450 0.576860 0.0 -1.153721 0.1600 \n",
"43 1.2050 0.651978 0.0 -1.303955 0.3200 \n",
"44 1.5250 0.169798 0.0 -0.339595 0.6400 \n",
"\n",
" caption \n",
"0 aborted: excessive norm value(s) \n",
"1 \n",
"2 \n",
"3 \n",
"4 \n",
"5 \n",
"6 \n",
"7 \n",
"8 \n",
"9 \n",
"10 \n",
"11 \n",
"12 \n",
"13 \n",
"14 \n",
"15 \n",
"16 \n",
"17 \n",
"18 \n",
"19 \n",
"20 \n",
"21 \n",
"22 \n",
"23 \n",
"24 \n",
"25 \n",
"26 \n",
"27 \n",
"28 \n",
"29 \n",
"30 \n",
"31 \n",
"32 \n",
"33 \n",
"34 \n",
"35 \n",
"36 \n",
"37 \n",
"38 \n",
"39 \n",
"40 \n",
"41 \n",
"42 \n",
"43 \n",
"44 "
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.get_diagnostic_rxn_data(rxn_index=0)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "5ff51045-dfa3-4f04-94f4-5d66f1352d4a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Reaction: S <-> X\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" START_TIME | \n",
" Delta U | \n",
" Delta X | \n",
" Delta S | \n",
" time_step | \n",
" caption | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0.0000 | \n",
" 0.0 | \n",
" -3.000000 | \n",
" 3.000000 | \n",
" 0.0100 | \n",
" aborted: excessive norm value(s) | \n",
"
\n",
" \n",
" | 1 | \n",
" 0.0000 | \n",
" 0.0 | \n",
" -1.500000 | \n",
" 1.500000 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 0.0050 | \n",
" 0.0 | \n",
" -0.701250 | \n",
" 0.701250 | \n",
" 0.0025 | \n",
" | \n",
"
\n",
" \n",
" | 3 | \n",
" 0.0075 | \n",
" 0.0 | \n",
" -1.359094 | \n",
" 1.359094 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" 0.0125 | \n",
" 0.0 | \n",
" -0.638492 | \n",
" 0.638492 | \n",
" 0.0025 | \n",
" | \n",
"
\n",
" \n",
" | 5 | \n",
" 0.0150 | \n",
" 0.0 | \n",
" -1.240350 | \n",
" 1.240350 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" 0.0200 | \n",
" 0.0 | \n",
" -1.170975 | \n",
" 1.170975 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" 0.0250 | \n",
" 0.0 | \n",
" -1.108919 | \n",
" 1.108919 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 8 | \n",
" 0.0300 | \n",
" 0.0 | \n",
" -1.053308 | \n",
" 1.053308 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" 0.0350 | \n",
" 0.0 | \n",
" -1.003375 | \n",
" 1.003375 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 10 | \n",
" 0.0400 | \n",
" 0.0 | \n",
" -1.916890 | \n",
" 1.916890 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" 0.0500 | \n",
" 0.0 | \n",
" -0.877405 | \n",
" 0.877405 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" 0.0550 | \n",
" 0.0 | \n",
" -1.689324 | \n",
" 1.689324 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 13 | \n",
" 0.0650 | \n",
" 0.0 | \n",
" -1.570244 | \n",
" 1.570244 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" 0.0750 | \n",
" 0.0 | \n",
" -1.472167 | \n",
" 1.472167 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" 0.0850 | \n",
" 0.0 | \n",
" -1.390206 | \n",
" 1.390206 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" 0.0950 | \n",
" 0.0 | \n",
" -1.320659 | \n",
" 1.320659 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" 0.1050 | \n",
" 0.0 | \n",
" -2.521427 | \n",
" 2.521427 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 18 | \n",
" 0.1250 | \n",
" 0.0 | \n",
" -1.155761 | \n",
" 1.155761 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 19 | \n",
" 0.1350 | \n",
" 0.0 | \n",
" -2.229961 | \n",
" 2.229961 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" 0.1550 | \n",
" 0.0 | \n",
" -1.040185 | \n",
" 1.040185 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" 0.1650 | \n",
" 0.0 | \n",
" -2.016529 | \n",
" 2.016529 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" 0.1850 | \n",
" 0.0 | \n",
" -1.895860 | \n",
" 1.895860 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 23 | \n",
" 0.2050 | \n",
" 0.0 | \n",
" -1.787115 | \n",
" 1.787115 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 24 | \n",
" 0.2250 | \n",
" 0.0 | \n",
" -1.687042 | \n",
" 1.687042 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 25 | \n",
" 0.2450 | \n",
" 0.0 | \n",
" -1.593829 | \n",
" 1.593829 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 26 | \n",
" 0.2650 | \n",
" 0.0 | \n",
" -1.506413 | \n",
" 1.506413 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 27 | \n",
" 0.2850 | \n",
" 0.0 | \n",
" -1.424124 | \n",
" 1.424124 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 28 | \n",
" 0.3050 | \n",
" 0.0 | \n",
" -1.346502 | \n",
" 1.346502 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 29 | \n",
" 0.3250 | \n",
" 0.0 | \n",
" -1.273199 | \n",
" 1.273199 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 30 | \n",
" 0.3450 | \n",
" 0.0 | \n",
" -2.407864 | \n",
" 2.407864 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 31 | \n",
" 0.3850 | \n",
" 0.0 | \n",
" -1.072982 | \n",
" 1.072982 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 32 | \n",
" 0.4050 | \n",
" 0.0 | \n",
" -2.029304 | \n",
" 2.029304 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 33 | \n",
" 0.4450 | \n",
" 0.0 | \n",
" -1.808671 | \n",
" 1.808671 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 34 | \n",
" 0.4850 | \n",
" 0.0 | \n",
" -1.612027 | \n",
" 1.612027 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 35 | \n",
" 0.5250 | \n",
" 0.0 | \n",
" -1.436763 | \n",
" 1.436763 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 36 | \n",
" 0.5650 | \n",
" 0.0 | \n",
" -1.280554 | \n",
" 1.280554 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 37 | \n",
" 0.6050 | \n",
" 0.0 | \n",
" -2.282657 | \n",
" 2.282657 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 38 | \n",
" 0.6850 | \n",
" 0.0 | \n",
" -0.893151 | \n",
" 0.893151 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 39 | \n",
" 0.7250 | \n",
" 0.0 | \n",
" -1.592091 | \n",
" 1.592091 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 40 | \n",
" 0.8050 | \n",
" 0.0 | \n",
" -1.245898 | \n",
" 1.245898 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 41 | \n",
" 0.8850 | \n",
" 0.0 | \n",
" -1.949965 | \n",
" 1.949965 | \n",
" 0.1600 | \n",
" | \n",
"
\n",
" \n",
" | 42 | \n",
" 1.0450 | \n",
" 0.0 | \n",
" -1.101942 | \n",
" 1.101942 | \n",
" 0.1600 | \n",
" | \n",
"
\n",
" \n",
" | 43 | \n",
" 1.2050 | \n",
" 0.0 | \n",
" -1.245434 | \n",
" 1.245434 | \n",
" 0.3200 | \n",
" | \n",
"
\n",
" \n",
" | 44 | \n",
" 1.5250 | \n",
" 0.0 | \n",
" -0.324354 | \n",
" 0.324354 | \n",
" 0.6400 | \n",
" | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" START_TIME Delta U Delta X Delta S time_step \\\n",
"0 0.0000 0.0 -3.000000 3.000000 0.0100 \n",
"1 0.0000 0.0 -1.500000 1.500000 0.0050 \n",
"2 0.0050 0.0 -0.701250 0.701250 0.0025 \n",
"3 0.0075 0.0 -1.359094 1.359094 0.0050 \n",
"4 0.0125 0.0 -0.638492 0.638492 0.0025 \n",
"5 0.0150 0.0 -1.240350 1.240350 0.0050 \n",
"6 0.0200 0.0 -1.170975 1.170975 0.0050 \n",
"7 0.0250 0.0 -1.108919 1.108919 0.0050 \n",
"8 0.0300 0.0 -1.053308 1.053308 0.0050 \n",
"9 0.0350 0.0 -1.003375 1.003375 0.0050 \n",
"10 0.0400 0.0 -1.916890 1.916890 0.0100 \n",
"11 0.0500 0.0 -0.877405 0.877405 0.0050 \n",
"12 0.0550 0.0 -1.689324 1.689324 0.0100 \n",
"13 0.0650 0.0 -1.570244 1.570244 0.0100 \n",
"14 0.0750 0.0 -1.472167 1.472167 0.0100 \n",
"15 0.0850 0.0 -1.390206 1.390206 0.0100 \n",
"16 0.0950 0.0 -1.320659 1.320659 0.0100 \n",
"17 0.1050 0.0 -2.521427 2.521427 0.0200 \n",
"18 0.1250 0.0 -1.155761 1.155761 0.0100 \n",
"19 0.1350 0.0 -2.229961 2.229961 0.0200 \n",
"20 0.1550 0.0 -1.040185 1.040185 0.0100 \n",
"21 0.1650 0.0 -2.016529 2.016529 0.0200 \n",
"22 0.1850 0.0 -1.895860 1.895860 0.0200 \n",
"23 0.2050 0.0 -1.787115 1.787115 0.0200 \n",
"24 0.2250 0.0 -1.687042 1.687042 0.0200 \n",
"25 0.2450 0.0 -1.593829 1.593829 0.0200 \n",
"26 0.2650 0.0 -1.506413 1.506413 0.0200 \n",
"27 0.2850 0.0 -1.424124 1.424124 0.0200 \n",
"28 0.3050 0.0 -1.346502 1.346502 0.0200 \n",
"29 0.3250 0.0 -1.273199 1.273199 0.0200 \n",
"30 0.3450 0.0 -2.407864 2.407864 0.0400 \n",
"31 0.3850 0.0 -1.072982 1.072982 0.0200 \n",
"32 0.4050 0.0 -2.029304 2.029304 0.0400 \n",
"33 0.4450 0.0 -1.808671 1.808671 0.0400 \n",
"34 0.4850 0.0 -1.612027 1.612027 0.0400 \n",
"35 0.5250 0.0 -1.436763 1.436763 0.0400 \n",
"36 0.5650 0.0 -1.280554 1.280554 0.0400 \n",
"37 0.6050 0.0 -2.282657 2.282657 0.0800 \n",
"38 0.6850 0.0 -0.893151 0.893151 0.0400 \n",
"39 0.7250 0.0 -1.592091 1.592091 0.0800 \n",
"40 0.8050 0.0 -1.245898 1.245898 0.0800 \n",
"41 0.8850 0.0 -1.949965 1.949965 0.1600 \n",
"42 1.0450 0.0 -1.101942 1.101942 0.1600 \n",
"43 1.2050 0.0 -1.245434 1.245434 0.3200 \n",
"44 1.5250 0.0 -0.324354 0.324354 0.6400 \n",
"\n",
" caption \n",
"0 aborted: excessive norm value(s) \n",
"1 \n",
"2 \n",
"3 \n",
"4 \n",
"5 \n",
"6 \n",
"7 \n",
"8 \n",
"9 \n",
"10 \n",
"11 \n",
"12 \n",
"13 \n",
"14 \n",
"15 \n",
"16 \n",
"17 \n",
"18 \n",
"19 \n",
"20 \n",
"21 \n",
"22 \n",
"23 \n",
"24 \n",
"25 \n",
"26 \n",
"27 \n",
"28 \n",
"29 \n",
"30 \n",
"31 \n",
"32 \n",
"33 \n",
"34 \n",
"35 \n",
"36 \n",
"37 \n",
"38 \n",
"39 \n",
"40 \n",
"41 \n",
"42 \n",
"43 \n",
"44 "
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.get_diagnostic_rxn_data(rxn_index=1)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "03eec482-0b4a-4a15-ba33-1788f63fc60f",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" TIME | \n",
" U | \n",
" X | \n",
" S | \n",
" caption | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0.0000 | \n",
" 50.000000 | \n",
" 100.000000 | \n",
" 0.000000 | \n",
" | \n",
"
\n",
" \n",
" | 1 | \n",
" 0.0050 | \n",
" 49.500000 | \n",
" 98.500000 | \n",
" 2.500000 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 0.0075 | \n",
" 49.302500 | \n",
" 97.798750 | \n",
" 3.596250 | \n",
" | \n",
"
\n",
" \n",
" | 3 | \n",
" 0.0125 | \n",
" 48.953325 | \n",
" 96.439656 | \n",
" 5.653694 | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" 0.0150 | \n",
" 48.821632 | \n",
" 95.801164 | \n",
" 6.555571 | \n",
" | \n",
"
\n",
" \n",
" | 5 | \n",
" 0.0200 | \n",
" 48.595639 | \n",
" 94.560814 | \n",
" 8.247909 | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" 0.0250 | \n",
" 48.439599 | \n",
" 93.389839 | \n",
" 9.730964 | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" 0.0300 | \n",
" 48.344441 | \n",
" 92.280920 | \n",
" 11.030197 | \n",
" | \n",
"
\n",
" \n",
" | 8 | \n",
" 0.0350 | \n",
" 48.302205 | \n",
" 91.227612 | \n",
" 12.167978 | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" 0.0400 | \n",
" 48.305902 | \n",
" 90.224238 | \n",
" 13.163959 | \n",
" | \n",
"
\n",
" \n",
" | 10 | \n",
" 0.0500 | \n",
" 48.392901 | \n",
" 88.307348 | \n",
" 14.906851 | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" 0.0550 | \n",
" 48.505246 | \n",
" 87.429943 | \n",
" 15.559566 | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" 0.0650 | \n",
" 48.779906 | \n",
" 85.740619 | \n",
" 16.699569 | \n",
" | \n",
"
\n",
" \n",
" | 13 | \n",
" 0.0750 | \n",
" 49.140273 | \n",
" 84.170374 | \n",
" 17.549079 | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" 0.0850 | \n",
" 49.561394 | \n",
" 82.698208 | \n",
" 18.179004 | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" 0.0950 | \n",
" 50.024487 | \n",
" 81.308002 | \n",
" 18.643025 | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" 0.1050 | \n",
" 50.515439 | \n",
" 79.987343 | \n",
" 18.981779 | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" 0.1250 | \n",
" 51.531906 | \n",
" 77.465916 | \n",
" 19.470272 | \n",
" | \n",
"
\n",
" \n",
" | 18 | \n",
" 0.1350 | \n",
" 52.058890 | \n",
" 76.310155 | \n",
" 19.572066 | \n",
" | \n",
"
\n",
" \n",
" | 19 | \n",
" 0.1550 | \n",
" 53.108064 | \n",
" 74.080194 | \n",
" 19.703677 | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" 0.1650 | \n",
" 53.622197 | \n",
" 73.040009 | \n",
" 19.715597 | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" 0.1850 | \n",
" 54.631805 | \n",
" 71.023480 | \n",
" 19.712910 | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" 0.2050 | \n",
" 55.600598 | \n",
" 69.127620 | \n",
" 19.671183 | \n",
" | \n",
"
\n",
" \n",
" | 23 | \n",
" 0.2250 | \n",
" 56.523964 | \n",
" 67.340505 | \n",
" 19.611568 | \n",
" | \n",
"
\n",
" \n",
" | 24 | \n",
" 0.2450 | \n",
" 57.400856 | \n",
" 65.653463 | \n",
" 19.544825 | \n",
" | \n",
"
\n",
" \n",
" | 25 | \n",
" 0.2650 | \n",
" 58.231994 | \n",
" 64.059634 | \n",
" 19.476378 | \n",
" | \n",
"
\n",
" \n",
" | 26 | \n",
" 0.2850 | \n",
" 59.018935 | \n",
" 62.553221 | \n",
" 19.408909 | \n",
" | \n",
"
\n",
" \n",
" | 27 | \n",
" 0.3050 | \n",
" 59.763603 | \n",
" 61.129097 | \n",
" 19.343697 | \n",
" | \n",
"
\n",
" \n",
" | 28 | \n",
" 0.3250 | \n",
" 60.468050 | \n",
" 59.782595 | \n",
" 19.281305 | \n",
" | \n",
"
\n",
" \n",
" | 29 | \n",
" 0.3450 | \n",
" 61.134337 | \n",
" 58.509396 | \n",
" 19.221930 | \n",
" | \n",
"
\n",
" \n",
" | 30 | \n",
" 0.3850 | \n",
" 62.394608 | \n",
" 56.101532 | \n",
" 19.109253 | \n",
" | \n",
"
\n",
" \n",
" | 31 | \n",
" 0.4050 | \n",
" 62.956304 | \n",
" 55.028550 | \n",
" 19.058842 | \n",
" | \n",
"
\n",
" \n",
" | 32 | \n",
" 0.4450 | \n",
" 64.018629 | \n",
" 52.999246 | \n",
" 18.963496 | \n",
" | \n",
"
\n",
" \n",
" | 33 | \n",
" 0.4850 | \n",
" 64.965457 | \n",
" 51.190576 | \n",
" 18.878510 | \n",
" | \n",
"
\n",
" \n",
" | 34 | \n",
" 0.5250 | \n",
" 65.809344 | \n",
" 49.578549 | \n",
" 18.802763 | \n",
" | \n",
"
\n",
" \n",
" | 35 | \n",
" 0.5650 | \n",
" 66.561481 | \n",
" 48.141786 | \n",
" 18.735252 | \n",
" | \n",
"
\n",
" \n",
" | 36 | \n",
" 0.6050 | \n",
" 67.231843 | \n",
" 46.861232 | \n",
" 18.675082 | \n",
" | \n",
"
\n",
" \n",
" | 37 | \n",
" 0.6850 | \n",
" 68.426800 | \n",
" 44.578576 | \n",
" 18.567824 | \n",
" | \n",
"
\n",
" \n",
" | 38 | \n",
" 0.7250 | \n",
" 68.894360 | \n",
" 43.685424 | \n",
" 18.525856 | \n",
" | \n",
"
\n",
" \n",
" | 39 | \n",
" 0.8050 | \n",
" 69.727810 | \n",
" 42.093333 | \n",
" 18.451046 | \n",
" | \n",
"
\n",
" \n",
" | 40 | \n",
" 0.8850 | \n",
" 70.380030 | \n",
" 40.847436 | \n",
" 18.392504 | \n",
" | \n",
"
\n",
" \n",
" | 41 | \n",
" 1.0450 | \n",
" 71.400826 | \n",
" 38.897470 | \n",
" 18.300879 | \n",
" | \n",
"
\n",
" \n",
" | 42 | \n",
" 1.2050 | \n",
" 71.977686 | \n",
" 37.795528 | \n",
" 18.249100 | \n",
" | \n",
"
\n",
" \n",
" | 43 | \n",
" 1.5250 | \n",
" 72.629663 | \n",
" 36.550094 | \n",
" 18.190579 | \n",
" | \n",
"
\n",
" \n",
" | 44 | \n",
" 2.1650 | \n",
" 72.799461 | \n",
" 36.225739 | \n",
" 18.175339 | \n",
" | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" TIME U X S caption\n",
"0 0.0000 50.000000 100.000000 0.000000 \n",
"1 0.0050 49.500000 98.500000 2.500000 \n",
"2 0.0075 49.302500 97.798750 3.596250 \n",
"3 0.0125 48.953325 96.439656 5.653694 \n",
"4 0.0150 48.821632 95.801164 6.555571 \n",
"5 0.0200 48.595639 94.560814 8.247909 \n",
"6 0.0250 48.439599 93.389839 9.730964 \n",
"7 0.0300 48.344441 92.280920 11.030197 \n",
"8 0.0350 48.302205 91.227612 12.167978 \n",
"9 0.0400 48.305902 90.224238 13.163959 \n",
"10 0.0500 48.392901 88.307348 14.906851 \n",
"11 0.0550 48.505246 87.429943 15.559566 \n",
"12 0.0650 48.779906 85.740619 16.699569 \n",
"13 0.0750 49.140273 84.170374 17.549079 \n",
"14 0.0850 49.561394 82.698208 18.179004 \n",
"15 0.0950 50.024487 81.308002 18.643025 \n",
"16 0.1050 50.515439 79.987343 18.981779 \n",
"17 0.1250 51.531906 77.465916 19.470272 \n",
"18 0.1350 52.058890 76.310155 19.572066 \n",
"19 0.1550 53.108064 74.080194 19.703677 \n",
"20 0.1650 53.622197 73.040009 19.715597 \n",
"21 0.1850 54.631805 71.023480 19.712910 \n",
"22 0.2050 55.600598 69.127620 19.671183 \n",
"23 0.2250 56.523964 67.340505 19.611568 \n",
"24 0.2450 57.400856 65.653463 19.544825 \n",
"25 0.2650 58.231994 64.059634 19.476378 \n",
"26 0.2850 59.018935 62.553221 19.408909 \n",
"27 0.3050 59.763603 61.129097 19.343697 \n",
"28 0.3250 60.468050 59.782595 19.281305 \n",
"29 0.3450 61.134337 58.509396 19.221930 \n",
"30 0.3850 62.394608 56.101532 19.109253 \n",
"31 0.4050 62.956304 55.028550 19.058842 \n",
"32 0.4450 64.018629 52.999246 18.963496 \n",
"33 0.4850 64.965457 51.190576 18.878510 \n",
"34 0.5250 65.809344 49.578549 18.802763 \n",
"35 0.5650 66.561481 48.141786 18.735252 \n",
"36 0.6050 67.231843 46.861232 18.675082 \n",
"37 0.6850 68.426800 44.578576 18.567824 \n",
"38 0.7250 68.894360 43.685424 18.525856 \n",
"39 0.8050 69.727810 42.093333 18.451046 \n",
"40 0.8850 70.380030 40.847436 18.392504 \n",
"41 1.0450 71.400826 38.897470 18.300879 \n",
"42 1.2050 71.977686 37.795528 18.249100 \n",
"43 1.5250 72.629663 36.550094 18.190579 \n",
"44 2.1650 72.799461 36.225739 18.175339 "
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.get_diagnostic_conc_data()"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "703eae06-0fbe-42be-a5d1-562b5b8c3772",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" START_TIME | \n",
" Delta U | \n",
" Delta X | \n",
" Delta S | \n",
" norm_A | \n",
" norm_B | \n",
" action | \n",
" step_factor | \n",
" time_step | \n",
" caption | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0.0000 | \n",
" -1.000000 | \n",
" -3.000000 | \n",
" 5.000000 | \n",
" 3.888889 | \n",
" None | \n",
" ABORT | \n",
" 0.5 | \n",
" 0.0100 | \n",
" excessive norm value(s) | \n",
"
\n",
" \n",
" | 1 | \n",
" 0.0000 | \n",
" -0.500000 | \n",
" -1.500000 | \n",
" 2.500000 | \n",
" 0.972222 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 0.0050 | \n",
" -0.197500 | \n",
" -0.701250 | \n",
" 1.096250 | \n",
" 0.192502 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0025 | \n",
" | \n",
"
\n",
" \n",
" | 3 | \n",
" 0.0075 | \n",
" -0.349175 | \n",
" -1.359094 | \n",
" 2.057444 | \n",
" 0.689126 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" 0.0125 | \n",
" -0.131693 | \n",
" -0.638492 | \n",
" 0.901878 | \n",
" 0.137600 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0025 | \n",
" | \n",
"
\n",
" \n",
" | 5 | \n",
" 0.0150 | \n",
" -0.225993 | \n",
" -1.240350 | \n",
" 1.692337 | \n",
" 0.494839 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" 0.0200 | \n",
" -0.156040 | \n",
" -1.170975 | \n",
" 1.483055 | \n",
" 0.399443 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" 0.0250 | \n",
" -0.095157 | \n",
" -1.108919 | \n",
" 1.299234 | \n",
" 0.325196 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 8 | \n",
" 0.0300 | \n",
" -0.042237 | \n",
" -1.053308 | \n",
" 1.137781 | \n",
" 0.267310 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" 0.0350 | \n",
" 0.003697 | \n",
" -1.003375 | \n",
" 0.995981 | \n",
" 0.222084 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 10 | \n",
" 0.0400 | \n",
" 0.086999 | \n",
" -1.916890 | \n",
" 1.742892 | \n",
" 0.746634 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" 0.0500 | \n",
" 0.112345 | \n",
" -0.877405 | \n",
" 0.652715 | \n",
" 0.134277 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0050 | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" 0.0550 | \n",
" 0.274660 | \n",
" -1.689324 | \n",
" 1.140004 | \n",
" 0.469874 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 13 | \n",
" 0.0650 | \n",
" 0.360367 | \n",
" -1.570244 | \n",
" 0.849510 | \n",
" 0.368578 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" 0.0750 | \n",
" 0.421121 | \n",
" -1.472167 | \n",
" 0.629925 | \n",
" 0.304602 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" 0.0850 | \n",
" 0.463092 | \n",
" -1.390206 | \n",
" 0.464021 | \n",
" 0.262494 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" 0.0950 | \n",
" 0.490952 | \n",
" -1.320659 | \n",
" 0.338754 | \n",
" 0.233325 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" 0.1050 | \n",
" 1.016467 | \n",
" -2.521427 | \n",
" 0.488493 | \n",
" 0.847714 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 18 | \n",
" 0.1250 | \n",
" 0.526984 | \n",
" -1.155761 | \n",
" 0.101794 | \n",
" 0.180429 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 19 | \n",
" 0.1350 | \n",
" 1.049175 | \n",
" -2.229961 | \n",
" 0.131612 | \n",
" 0.676758 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" 0.1550 | \n",
" 0.514133 | \n",
" -1.040185 | \n",
" 0.011919 | \n",
" 0.149607 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0100 | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" 0.1650 | \n",
" 1.009608 | \n",
" -2.016529 | \n",
" -0.002686 | \n",
" 0.565078 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" 0.1850 | \n",
" 0.968793 | \n",
" -1.895860 | \n",
" -0.041727 | \n",
" 0.503843 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 23 | \n",
" 0.2050 | \n",
" 0.923365 | \n",
" -1.787115 | \n",
" -0.059615 | \n",
" 0.449993 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 24 | \n",
" 0.2250 | \n",
" 0.876892 | \n",
" -1.687042 | \n",
" -0.066742 | \n",
" 0.402167 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 25 | \n",
" 0.2450 | \n",
" 0.831138 | \n",
" -1.593829 | \n",
" -0.068447 | \n",
" 0.359529 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 26 | \n",
" 0.2650 | \n",
" 0.786941 | \n",
" -1.506413 | \n",
" -0.067469 | \n",
" 0.321456 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 27 | \n",
" 0.2850 | \n",
" 0.744668 | \n",
" -1.424124 | \n",
" -0.065212 | \n",
" 0.287435 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 28 | \n",
" 0.3050 | \n",
" 0.704447 | \n",
" -1.346502 | \n",
" -0.062393 | \n",
" 0.257023 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 29 | \n",
" 0.3250 | \n",
" 0.666287 | \n",
" -1.273199 | \n",
" -0.059374 | \n",
" 0.229833 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 30 | \n",
" 0.3450 | \n",
" 1.260271 | \n",
" -2.407864 | \n",
" -0.112677 | \n",
" 0.822088 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 31 | \n",
" 0.3850 | \n",
" 0.561696 | \n",
" -1.072982 | \n",
" -0.050411 | \n",
" 0.163259 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0200 | \n",
" | \n",
"
\n",
" \n",
" | 32 | \n",
" 0.4050 | \n",
" 1.062325 | \n",
" -2.029304 | \n",
" -0.095347 | \n",
" 0.583967 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 33 | \n",
" 0.4450 | \n",
" 0.946828 | \n",
" -1.808671 | \n",
" -0.084986 | \n",
" 0.463888 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 34 | \n",
" 0.4850 | \n",
" 0.843887 | \n",
" -1.612027 | \n",
" -0.075746 | \n",
" 0.368501 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 35 | \n",
" 0.5250 | \n",
" 0.752137 | \n",
" -1.436763 | \n",
" -0.067511 | \n",
" 0.292728 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 36 | \n",
" 0.5650 | \n",
" 0.670362 | \n",
" -1.280554 | \n",
" -0.060171 | \n",
" 0.232536 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 37 | \n",
" 0.6050 | \n",
" 1.194957 | \n",
" -2.282657 | \n",
" -0.107258 | \n",
" 0.738883 | \n",
" None | \n",
" OK (high) | \n",
" 0.5 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 38 | \n",
" 0.6850 | \n",
" 0.467560 | \n",
" -0.893151 | \n",
" -0.041968 | \n",
" 0.113121 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0400 | \n",
" | \n",
"
\n",
" \n",
" | 39 | \n",
" 0.7250 | \n",
" 0.833450 | \n",
" -1.592091 | \n",
" -0.074810 | \n",
" 0.359443 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 40 | \n",
" 0.8050 | \n",
" 0.652220 | \n",
" -1.245898 | \n",
" -0.058543 | \n",
" 0.220120 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.0800 | \n",
" | \n",
"
\n",
" \n",
" | 41 | \n",
" 0.8850 | \n",
" 1.020795 | \n",
" -1.949965 | \n",
" -0.091625 | \n",
" 0.539198 | \n",
" None | \n",
" OK (stay) | \n",
" 1.0 | \n",
" 0.1600 | \n",
" | \n",
"
\n",
" \n",
" | 42 | \n",
" 1.0450 | \n",
" 0.576860 | \n",
" -1.101942 | \n",
" -0.051778 | \n",
" 0.172192 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.1600 | \n",
" | \n",
"
\n",
" \n",
" | 43 | \n",
" 1.2050 | \n",
" 0.651978 | \n",
" -1.245434 | \n",
" -0.058521 | \n",
" 0.219956 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.3200 | \n",
" | \n",
"
\n",
" \n",
" | 44 | \n",
" 1.5250 | \n",
" 0.169798 | \n",
" -0.324354 | \n",
" -0.015241 | \n",
" 0.014919 | \n",
" None | \n",
" OK (low) | \n",
" 2.0 | \n",
" 0.6400 | \n",
" | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" START_TIME Delta U Delta X Delta S norm_A norm_B action \\\n",
"0 0.0000 -1.000000 -3.000000 5.000000 3.888889 None ABORT \n",
"1 0.0000 -0.500000 -1.500000 2.500000 0.972222 None OK (high) \n",
"2 0.0050 -0.197500 -0.701250 1.096250 0.192502 None OK (low) \n",
"3 0.0075 -0.349175 -1.359094 2.057444 0.689126 None OK (high) \n",
"4 0.0125 -0.131693 -0.638492 0.901878 0.137600 None OK (low) \n",
"5 0.0150 -0.225993 -1.240350 1.692337 0.494839 None OK (stay) \n",
"6 0.0200 -0.156040 -1.170975 1.483055 0.399443 None OK (stay) \n",
"7 0.0250 -0.095157 -1.108919 1.299234 0.325196 None OK (stay) \n",
"8 0.0300 -0.042237 -1.053308 1.137781 0.267310 None OK (stay) \n",
"9 0.0350 0.003697 -1.003375 0.995981 0.222084 None OK (low) \n",
"10 0.0400 0.086999 -1.916890 1.742892 0.746634 None OK (high) \n",
"11 0.0500 0.112345 -0.877405 0.652715 0.134277 None OK (low) \n",
"12 0.0550 0.274660 -1.689324 1.140004 0.469874 None OK (stay) \n",
"13 0.0650 0.360367 -1.570244 0.849510 0.368578 None OK (stay) \n",
"14 0.0750 0.421121 -1.472167 0.629925 0.304602 None OK (stay) \n",
"15 0.0850 0.463092 -1.390206 0.464021 0.262494 None OK (stay) \n",
"16 0.0950 0.490952 -1.320659 0.338754 0.233325 None OK (low) \n",
"17 0.1050 1.016467 -2.521427 0.488493 0.847714 None OK (high) \n",
"18 0.1250 0.526984 -1.155761 0.101794 0.180429 None OK (low) \n",
"19 0.1350 1.049175 -2.229961 0.131612 0.676758 None OK (high) \n",
"20 0.1550 0.514133 -1.040185 0.011919 0.149607 None OK (low) \n",
"21 0.1650 1.009608 -2.016529 -0.002686 0.565078 None OK (stay) \n",
"22 0.1850 0.968793 -1.895860 -0.041727 0.503843 None OK (stay) \n",
"23 0.2050 0.923365 -1.787115 -0.059615 0.449993 None OK (stay) \n",
"24 0.2250 0.876892 -1.687042 -0.066742 0.402167 None OK (stay) \n",
"25 0.2450 0.831138 -1.593829 -0.068447 0.359529 None OK (stay) \n",
"26 0.2650 0.786941 -1.506413 -0.067469 0.321456 None OK (stay) \n",
"27 0.2850 0.744668 -1.424124 -0.065212 0.287435 None OK (stay) \n",
"28 0.3050 0.704447 -1.346502 -0.062393 0.257023 None OK (stay) \n",
"29 0.3250 0.666287 -1.273199 -0.059374 0.229833 None OK (low) \n",
"30 0.3450 1.260271 -2.407864 -0.112677 0.822088 None OK (high) \n",
"31 0.3850 0.561696 -1.072982 -0.050411 0.163259 None OK (low) \n",
"32 0.4050 1.062325 -2.029304 -0.095347 0.583967 None OK (stay) \n",
"33 0.4450 0.946828 -1.808671 -0.084986 0.463888 None OK (stay) \n",
"34 0.4850 0.843887 -1.612027 -0.075746 0.368501 None OK (stay) \n",
"35 0.5250 0.752137 -1.436763 -0.067511 0.292728 None OK (stay) \n",
"36 0.5650 0.670362 -1.280554 -0.060171 0.232536 None OK (low) \n",
"37 0.6050 1.194957 -2.282657 -0.107258 0.738883 None OK (high) \n",
"38 0.6850 0.467560 -0.893151 -0.041968 0.113121 None OK (low) \n",
"39 0.7250 0.833450 -1.592091 -0.074810 0.359443 None OK (stay) \n",
"40 0.8050 0.652220 -1.245898 -0.058543 0.220120 None OK (low) \n",
"41 0.8850 1.020795 -1.949965 -0.091625 0.539198 None OK (stay) \n",
"42 1.0450 0.576860 -1.101942 -0.051778 0.172192 None OK (low) \n",
"43 1.2050 0.651978 -1.245434 -0.058521 0.219956 None OK (low) \n",
"44 1.5250 0.169798 -0.324354 -0.015241 0.014919 None OK (low) \n",
"\n",
" step_factor time_step caption \n",
"0 0.5 0.0100 excessive norm value(s) \n",
"1 0.5 0.0050 \n",
"2 2.0 0.0025 \n",
"3 0.5 0.0050 \n",
"4 2.0 0.0025 \n",
"5 1.0 0.0050 \n",
"6 1.0 0.0050 \n",
"7 1.0 0.0050 \n",
"8 1.0 0.0050 \n",
"9 2.0 0.0050 \n",
"10 0.5 0.0100 \n",
"11 2.0 0.0050 \n",
"12 1.0 0.0100 \n",
"13 1.0 0.0100 \n",
"14 1.0 0.0100 \n",
"15 1.0 0.0100 \n",
"16 2.0 0.0100 \n",
"17 0.5 0.0200 \n",
"18 2.0 0.0100 \n",
"19 0.5 0.0200 \n",
"20 2.0 0.0100 \n",
"21 1.0 0.0200 \n",
"22 1.0 0.0200 \n",
"23 1.0 0.0200 \n",
"24 1.0 0.0200 \n",
"25 1.0 0.0200 \n",
"26 1.0 0.0200 \n",
"27 1.0 0.0200 \n",
"28 1.0 0.0200 \n",
"29 2.0 0.0200 \n",
"30 0.5 0.0400 \n",
"31 2.0 0.0200 \n",
"32 1.0 0.0400 \n",
"33 1.0 0.0400 \n",
"34 1.0 0.0400 \n",
"35 1.0 0.0400 \n",
"36 2.0 0.0400 \n",
"37 0.5 0.0800 \n",
"38 2.0 0.0400 \n",
"39 1.0 0.0800 \n",
"40 2.0 0.0800 \n",
"41 1.0 0.1600 \n",
"42 2.0 0.1600 \n",
"43 2.0 0.3200 \n",
"44 2.0 0.6400 "
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.get_diagnostic_decisions_data()"
]
},
{
"cell_type": "markdown",
"id": "376ac947-fee3-467e-9dc5-b9c96b3b2a36",
"metadata": {},
"source": [
"#### Notice how the first step got aborted, and re-run, because of the large value of `norm_A`"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c9469a67-c513-492a-8bff-a20d0958ba39",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 21,
"id": "a479c269-4740-4866-9ec3-e736b8b09cb6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" START_TIME | \n",
" Delta U | \n",
" Delta X | \n",
" Delta S | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 0.0000 | \n",
" -1.000000 | \n",
" -3.000000 | \n",
" 5.000000 | \n",
"
\n",
" \n",
" | 1 | \n",
" 0.0000 | \n",
" -0.500000 | \n",
" -1.500000 | \n",
" 2.500000 | \n",
"
\n",
" \n",
" | 2 | \n",
" 0.0050 | \n",
" -0.197500 | \n",
" -0.701250 | \n",
" 1.096250 | \n",
"
\n",
" \n",
" | 3 | \n",
" 0.0075 | \n",
" -0.349175 | \n",
" -1.359094 | \n",
" 2.057444 | \n",
"
\n",
" \n",
" | 4 | \n",
" 0.0125 | \n",
" -0.131693 | \n",
" -0.638492 | \n",
" 0.901878 | \n",
"
\n",
" \n",
" | 5 | \n",
" 0.0150 | \n",
" -0.225993 | \n",
" -1.240350 | \n",
" 1.692337 | \n",
"
\n",
" \n",
" | 6 | \n",
" 0.0200 | \n",
" -0.156040 | \n",
" -1.170975 | \n",
" 1.483055 | \n",
"
\n",
" \n",
" | 7 | \n",
" 0.0250 | \n",
" -0.095157 | \n",
" -1.108919 | \n",
" 1.299234 | \n",
"
\n",
" \n",
" | 8 | \n",
" 0.0300 | \n",
" -0.042237 | \n",
" -1.053308 | \n",
" 1.137781 | \n",
"
\n",
" \n",
" | 9 | \n",
" 0.0350 | \n",
" 0.003697 | \n",
" -1.003375 | \n",
" 0.995981 | \n",
"
\n",
" \n",
" | 10 | \n",
" 0.0400 | \n",
" 0.086999 | \n",
" -1.916890 | \n",
" 1.742892 | \n",
"
\n",
" \n",
" | 11 | \n",
" 0.0500 | \n",
" 0.112345 | \n",
" -0.877405 | \n",
" 0.652715 | \n",
"
\n",
" \n",
" | 12 | \n",
" 0.0550 | \n",
" 0.274660 | \n",
" -1.689324 | \n",
" 1.140004 | \n",
"
\n",
" \n",
" | 13 | \n",
" 0.0650 | \n",
" 0.360367 | \n",
" -1.570244 | \n",
" 0.849510 | \n",
"
\n",
" \n",
" | 14 | \n",
" 0.0750 | \n",
" 0.421121 | \n",
" -1.472167 | \n",
" 0.629925 | \n",
"
\n",
" \n",
" | 15 | \n",
" 0.0850 | \n",
" 0.463092 | \n",
" -1.390206 | \n",
" 0.464021 | \n",
"
\n",
" \n",
" | 16 | \n",
" 0.0950 | \n",
" 0.490952 | \n",
" -1.320659 | \n",
" 0.338754 | \n",
"
\n",
" \n",
" | 17 | \n",
" 0.1050 | \n",
" 1.016467 | \n",
" -2.521427 | \n",
" 0.488493 | \n",
"
\n",
" \n",
" | 18 | \n",
" 0.1250 | \n",
" 0.526984 | \n",
" -1.155761 | \n",
" 0.101794 | \n",
"
\n",
" \n",
" | 19 | \n",
" 0.1350 | \n",
" 1.049175 | \n",
" -2.229961 | \n",
" 0.131612 | \n",
"
\n",
" \n",
" | 20 | \n",
" 0.1550 | \n",
" 0.514133 | \n",
" -1.040185 | \n",
" 0.011919 | \n",
"
\n",
" \n",
" | 21 | \n",
" 0.1650 | \n",
" 1.009608 | \n",
" -2.016529 | \n",
" -0.002686 | \n",
"
\n",
" \n",
" | 22 | \n",
" 0.1850 | \n",
" 0.968793 | \n",
" -1.895860 | \n",
" -0.041727 | \n",
"
\n",
" \n",
" | 23 | \n",
" 0.2050 | \n",
" 0.923365 | \n",
" -1.787115 | \n",
" -0.059615 | \n",
"
\n",
" \n",
" | 24 | \n",
" 0.2250 | \n",
" 0.876892 | \n",
" -1.687042 | \n",
" -0.066742 | \n",
"
\n",
" \n",
" | 25 | \n",
" 0.2450 | \n",
" 0.831138 | \n",
" -1.593829 | \n",
" -0.068447 | \n",
"
\n",
" \n",
" | 26 | \n",
" 0.2650 | \n",
" 0.786941 | \n",
" -1.506413 | \n",
" -0.067469 | \n",
"
\n",
" \n",
" | 27 | \n",
" 0.2850 | \n",
" 0.744668 | \n",
" -1.424124 | \n",
" -0.065212 | \n",
"
\n",
" \n",
" | 28 | \n",
" 0.3050 | \n",
" 0.704447 | \n",
" -1.346502 | \n",
" -0.062393 | \n",
"
\n",
" \n",
" | 29 | \n",
" 0.3250 | \n",
" 0.666287 | \n",
" -1.273199 | \n",
" -0.059374 | \n",
"
\n",
" \n",
" | 30 | \n",
" 0.3450 | \n",
" 1.260271 | \n",
" -2.407864 | \n",
" -0.112677 | \n",
"
\n",
" \n",
" | 31 | \n",
" 0.3850 | \n",
" 0.561696 | \n",
" -1.072982 | \n",
" -0.050411 | \n",
"
\n",
" \n",
" | 32 | \n",
" 0.4050 | \n",
" 1.062325 | \n",
" -2.029304 | \n",
" -0.095347 | \n",
"
\n",
" \n",
" | 33 | \n",
" 0.4450 | \n",
" 0.946828 | \n",
" -1.808671 | \n",
" -0.084986 | \n",
"
\n",
" \n",
" | 34 | \n",
" 0.4850 | \n",
" 0.843887 | \n",
" -1.612027 | \n",
" -0.075746 | \n",
"
\n",
" \n",
" | 35 | \n",
" 0.5250 | \n",
" 0.752137 | \n",
" -1.436763 | \n",
" -0.067511 | \n",
"
\n",
" \n",
" | 36 | \n",
" 0.5650 | \n",
" 0.670362 | \n",
" -1.280554 | \n",
" -0.060171 | \n",
"
\n",
" \n",
" | 37 | \n",
" 0.6050 | \n",
" 1.194957 | \n",
" -2.282657 | \n",
" -0.107258 | \n",
"
\n",
" \n",
" | 38 | \n",
" 0.6850 | \n",
" 0.467560 | \n",
" -0.893151 | \n",
" -0.041968 | \n",
"
\n",
" \n",
" | 39 | \n",
" 0.7250 | \n",
" 0.833450 | \n",
" -1.592091 | \n",
" -0.074810 | \n",
"
\n",
" \n",
" | 40 | \n",
" 0.8050 | \n",
" 0.652220 | \n",
" -1.245898 | \n",
" -0.058543 | \n",
"
\n",
" \n",
" | 41 | \n",
" 0.8850 | \n",
" 1.020795 | \n",
" -1.949965 | \n",
" -0.091625 | \n",
"
\n",
" \n",
" | 42 | \n",
" 1.0450 | \n",
" 0.576860 | \n",
" -1.101942 | \n",
" -0.051778 | \n",
"
\n",
" \n",
" | 43 | \n",
" 1.2050 | \n",
" 0.651978 | \n",
" -1.245434 | \n",
" -0.058521 | \n",
"
\n",
" \n",
" | 44 | \n",
" 1.5250 | \n",
" 0.169798 | \n",
" -0.324354 | \n",
" -0.015241 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" START_TIME Delta U Delta X Delta S\n",
"0 0.0000 -1.000000 -3.000000 5.000000\n",
"1 0.0000 -0.500000 -1.500000 2.500000\n",
"2 0.0050 -0.197500 -0.701250 1.096250\n",
"3 0.0075 -0.349175 -1.359094 2.057444\n",
"4 0.0125 -0.131693 -0.638492 0.901878\n",
"5 0.0150 -0.225993 -1.240350 1.692337\n",
"6 0.0200 -0.156040 -1.170975 1.483055\n",
"7 0.0250 -0.095157 -1.108919 1.299234\n",
"8 0.0300 -0.042237 -1.053308 1.137781\n",
"9 0.0350 0.003697 -1.003375 0.995981\n",
"10 0.0400 0.086999 -1.916890 1.742892\n",
"11 0.0500 0.112345 -0.877405 0.652715\n",
"12 0.0550 0.274660 -1.689324 1.140004\n",
"13 0.0650 0.360367 -1.570244 0.849510\n",
"14 0.0750 0.421121 -1.472167 0.629925\n",
"15 0.0850 0.463092 -1.390206 0.464021\n",
"16 0.0950 0.490952 -1.320659 0.338754\n",
"17 0.1050 1.016467 -2.521427 0.488493\n",
"18 0.1250 0.526984 -1.155761 0.101794\n",
"19 0.1350 1.049175 -2.229961 0.131612\n",
"20 0.1550 0.514133 -1.040185 0.011919\n",
"21 0.1650 1.009608 -2.016529 -0.002686\n",
"22 0.1850 0.968793 -1.895860 -0.041727\n",
"23 0.2050 0.923365 -1.787115 -0.059615\n",
"24 0.2250 0.876892 -1.687042 -0.066742\n",
"25 0.2450 0.831138 -1.593829 -0.068447\n",
"26 0.2650 0.786941 -1.506413 -0.067469\n",
"27 0.2850 0.744668 -1.424124 -0.065212\n",
"28 0.3050 0.704447 -1.346502 -0.062393\n",
"29 0.3250 0.666287 -1.273199 -0.059374\n",
"30 0.3450 1.260271 -2.407864 -0.112677\n",
"31 0.3850 0.561696 -1.072982 -0.050411\n",
"32 0.4050 1.062325 -2.029304 -0.095347\n",
"33 0.4450 0.946828 -1.808671 -0.084986\n",
"34 0.4850 0.843887 -1.612027 -0.075746\n",
"35 0.5250 0.752137 -1.436763 -0.067511\n",
"36 0.5650 0.670362 -1.280554 -0.060171\n",
"37 0.6050 1.194957 -2.282657 -0.107258\n",
"38 0.6850 0.467560 -0.893151 -0.041968\n",
"39 0.7250 0.833450 -1.592091 -0.074810\n",
"40 0.8050 0.652220 -1.245898 -0.058543\n",
"41 0.8850 1.020795 -1.949965 -0.091625\n",
"42 1.0450 0.576860 -1.101942 -0.051778\n",
"43 1.2050 0.651978 -1.245434 -0.058521\n",
"44 1.5250 0.169798 -0.324354 -0.015241"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dynamics.get_diagnostic_decisions_data_ALT() # TODO: OBSOLETE!"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "94832b6d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,py:percent"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}