2 S <-> U and S <-> X¶Both mostly forward. 1st-order kinetics throughout.
Same as variable_steps_1, but with substeps.
LAST REVISED: Dec. 3, 2023 THIS IS AN ARCHIVED EXPERIMENT
(current versions don't contain this implementation of substeps.) If you bypass the execution exit in the first cell, and run the other cells, you WILL NOT REPLICATE the results below!
# To stop the current and subsequent cells: USED TO PREVENT ACCIDENTAL RUNS OF THIS NOTEBOOK!
class StopExecution(Exception):
def _render_traceback_(self):
return []
raise StopExecution # See: https://stackoverflow.com/a/56953105/5478830
from experiments.get_notebook_info import get_notebook_basename
from src.modules.chemicals.chem_data import ChemData as chem
from src.modules.reactions.reaction_dynamics import ReactionDynamics
import numpy as np
from src.modules.visualization.graphic_log import GraphicLog
# Initialize the HTML logging
log_file = get_notebook_basename() + ".log.htm" # Use the notebook base filename for the log file
# Set up the use of some specified graphic (Vue) components
GraphicLog.config(filename=log_file,
components=["vue_cytoscape_1"],
extra_js="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.21.2/cytoscape.umd.js")
-> Output will be LOGGED into the file 'substeps_1.log.htm'
# Initialize the system
chem_data = chem(names=["U", "X", "S"])
# Reaction 2 S <-> U , with 1st-order kinetics for all species (mostly forward)
chem_data.add_reaction(reactants=[(2, "S")], products="U",
forward_rate=8., reverse_rate=2.)
# Reaction S <-> X , with 1st-order kinetics for all species (mostly forward)
chem_data.add_reaction(reactants="S", products="X",
forward_rate=6., reverse_rate=3.)
chem_data.describe_reactions()
# Send the plot of the reaction network to the HTML log file
graph_data = chem_data.prepare_graph_network()
GraphicLog.export_plot(graph_data, "vue_cytoscape_1")
Number of reactions: 2 (at temp. 25 C) 0: 2 S <-> U (kF = 8 / kR = 2 / Delta_G = -3,436.56 / K = 4) | 1st order in all reactants & products 1: S <-> X (kF = 6 / kR = 3 / Delta_G = -1,718.28 / K = 2) | 1st order in all reactants & products [GRAPHIC ELEMENT SENT TO LOG FILE `substeps_1.log.htm`]
dynamics = ReactionDynamics(chem_data=chem_data)
dynamics.set_conc(conc={"U": 50., "X": 100., "S": 0.})
dynamics.describe_state()
SYSTEM STATE at Time t = 0: 3 species: Species 0 (U). Conc: 50.0 Species 1 (X). Conc: 100.0 Species 2 (S). Conc: 0.0
dynamics.set_diagnostics() # To save diagnostic information about the call to single_compartment_react()
dynamics.verbose_list = ["substeps", "variable_steps"]
dynamics.single_compartment_react(time_step=0.01, stop_time=0.3,
variable_steps=True, thresholds={"low": 0.25, "high": 0.64},
dynamic_substeps=2, abs_fast_threshold=100.)
df = dynamics.get_history()
df
single_compartment_react(): setting rel_fast_threshold to 100.0
reaction_step_orchestrator(): entering WHILE loop at System Time=0 with delta_time_full=0.01. Processing interval [0 - 0.01]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.005
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of 0.79 (rel. to baseline of 2.5) for the conc. of `S`: abs(31.6%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.4025 (rel. to baseline of 98.5) for the conc. of `X`: abs(-1.42%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0 from the upcoming single step (for all rxns):
Baseline: [ 50. 100. 0.]
Deltas: [-0.895 -2.9025 4.6925]
Adjusted L2 norm: 3.4716763888888886
The current time step (0.01) leads to an 'L2 rate' (3.472) that is higher than the specified HIGH threshold (1.44):
ACTION: IMMEDIATE ABORT. Will abort this step, and re-do it with a SMALLER time interval. [The current step started at System Time: 0, and will rewind there]
reaction_step_orchestrator(): RE-DOING THE LAST REACTION STEP with the smaller time interval of 0.005
reaction_step_orchestrator(): entering WHILE loop at System Time=0 with delta_time_full=0.005. Processing interval [0 - 0.005]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.0025
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.22375 0.4475 ] (rel. to baseline of [49.75 1.25]) :
elements of abs([-0.44974874 35.79999997]%) are all < (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.72562 (rel. to baseline of 99.25) for the conc. of `X`: abs(-0.731%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0 from the upcoming single step (for all rxns):
Baseline: [ 50. 100. 0.]
Deltas: [-0.47375 -1.475625 2.423125]
Adjusted L2 norm: 0.919271440972222
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.9193) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER by a factor 2.0 (set to 0.0025) at the next round! [The current step started at System Time: 0, and will continue to 0.005]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.005 with delta_time_full=0.0025. Processing interval [0.005 - 0.0075]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.19916875 0.3983375 ] (rel. to baseline of [49.52625 2.423125]) :
elements of abs([-0.40214785 16.43899922]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.005
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.00625
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 left tagged as 'S', based on a change of [-0.34584716 0.34584716] (rel. to baseline of [98.17308203 2.97358672]) :
elements of abs([-0.35228308 11.63063969]%) are all < (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.005 from the upcoming single step (for all rxns):
Baseline: [49.52625 98.524375 2.423125]
Deltas: [-0.19916875 -0.69714013 1.09547763]
Adjusted L2 norm: 0.19174930835982507
NOTICE: The chosen time step (0.0025) results in an 'L2 rate' (0.1917) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.005) at the next round! [The current step started at System Time: 0.005, and will continue to 0.0075]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.0075 with delta_time_full=0.005. Processing interval [0.0075 - 0.0125]
All the reactions are SLOW
Processing ALL the 2 reaction(s)
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.35252671 0.70505341] (rel. to baseline of [49.32708125 3.51860263]) :
elements of abs([-0.71467174 20.03788122]%) are all < (100% /1)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.3619 (rel. to baseline of 97.8272) for the conc. of `X`: abs(-1.39%) > (100% /1)
EXAMINING CONCENTRATION CHANGES at System Time 0.0075 from the upcoming single step (for all rxns):
Baseline: [49.32708125 97.82723487 3.51860263]
Deltas: [-0.35252671 -1.36185044 2.06690386]
Adjusted L2 norm: 0.6945559195102885
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.6946) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER by a factor 2.0 (set to 0.0025) at the next round! [The current step started at System Time: 0.0075, and will continue to 0.0125]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.0125 with delta_time_full=0.0025. Processing interval [0.0125 - 0.015]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.13316264 0.26632529] (rel. to baseline of [48.97455454 5.58550649]) :
elements of abs([-0.27190169 4.76814926]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.0125
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.01375
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 left tagged as 'S', based on a change of [-0.31525682 0.31525682] (rel. to baseline of [96.14553054 6.03852302]) :
elements of abs([-0.32789545 5.22076037]%) are all < (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.0125 from the upcoming single step (for all rxns):
Baseline: [48.97455454 96.46538443 5.58550649]
Deltas: [-0.13316264 -0.63511071 0.901436 ]
Adjusted L2 norm: 0.13707608420309667
NOTICE: The chosen time step (0.0025) results in an 'L2 rate' (0.1371) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.005) at the next round! [The current step started at System Time: 0.0125, and will continue to 0.015]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.015 with delta_time_full=0.005. Processing interval [0.015 - 0.02]
All the reactions are SLOW
Processing ALL the 2 reaction(s)
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.22893622 0.45787244] (rel. to baseline of [48.8413919 6.48694248]) :
elements of abs([-0.46873402 7.05837058]%) are all < (100% /1)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.2428 (rel. to baseline of 95.8303) for the conc. of `X`: abs(-1.3%) > (100% /1)
EXAMINING CONCENTRATION CHANGES at System Time 0.015 from the upcoming single step (for all rxns):
Baseline: [48.8413919 95.83027372 6.48694248]
Deltas: [-0.22893622 -1.24284583 1.70071827]
Adjusted L2 norm: 0.4988355766812945
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.4988) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.015, and will continue to 0.02]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.02 with delta_time_full=0.005. Processing interval [0.02 - 0.025]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.15861813 0.31723625] (rel. to baseline of [48.61245568 8.18766075]) :
elements of abs([-0.32629112 3.87456519]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.02
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.0225
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.57101 (rel. to baseline of 94.0008) for the conc. of `X`: abs(-0.607%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.02 from the upcoming single step (for all rxns):
Baseline: [48.61245568 94.58742789 8.18766075]
Deltas: [-0.15861813 -1.15760403 1.47484028]
Adjusted L2 norm: 0.3933734074308033
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.3934) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.02, and will continue to 0.025]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.025 with delta_time_full=0.005. Processing interval [0.025 - 0.03]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.09803833 0.19607667] (rel. to baseline of [48.45383755 9.66250104]) :
elements of abs([-0.20233348 2.02925379]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.025
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.0275
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.54181 (rel. to baseline of 92.874) for the conc. of `X`: abs(-0.583%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.025 from the upcoming single step (for all rxns):
Baseline: [48.45383755 93.42982386 9.66250104]
Deltas: [-0.09803833 -1.09759656 1.29367323]
Adjusted L2 norm: 0.3208800177210416
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.3209) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.025, and will continue to 0.03]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.03 with delta_time_full=0.005. Processing interval [0.03 - 0.035]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [-0.04531102 0.09062204] (rel. to baseline of [48.35579922 10.95617427]) :
elements of abs([-0.09370339 0.82713218]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.03
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.0325
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.51559 (rel. to baseline of 91.8041) for the conc. of `X`: abs(-0.562%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.03 from the upcoming single step (for all rxns):
Baseline: [48.35579922 92.33222729 10.95617427]
Deltas: [-0.04531102 -1.04373516 1.1343572 ]
Adjusted L2 norm: 0.26424471594327414
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.2642) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.03, and will continue to 0.035]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.035 with delta_time_full=0.005. Processing interval [0.035 - 0.04]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.00051638 -0.00103275] (rel. to baseline of [48.3104882 12.09053147]) :
elements of abs([ 0.00106887 -0.00854184]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.035
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.0375
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 left tagged as 'S', based on a change of [-0.49198909 0.49198909] (rel. to baseline of [90.78518641 12.59332081]) :
elements of abs([-0.54192661 3.90674623]%) are all < (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.035 from the upcoming single step (for all rxns):
Baseline: [48.3104882 91.28849213 12.09053147]
Deltas: [ 5.16376907e-04 -9.95294805e-01 9.94262051e-01]
Adjusted L2 norm: 0.21990767124245347
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.2199) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.01) at the next round! [The current step started at System Time: 0.035, and will continue to 0.04]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.04 with delta_time_full=0.01. Processing interval [0.04 - 0.05]
All the reactions are SLOW
Processing ALL the 2 reaction(s)
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.08056339 -0.16112678] (rel. to baseline of [48.31100457 13.08479352]) :
elements of abs([ 0.16675992 -1.23140484]%) are all < (100% /1)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.9237 (rel. to baseline of 90.2932) for the conc. of `X`: abs(-2.13%) > (100% /1)
EXAMINING CONCENTRATION CHANGES at System Time 0.04 from the upcoming single step (for all rxns):
Baseline: [48.31100457 90.29319733 13.08479352]
Deltas: [ 0.08056339 -1.92370831 1.76258153]
Adjusted L2 norm: 0.757093084208906
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.7571) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER by a factor 2.0 (set to 0.005) at the next round! [The current step started at System Time: 0.04, and will continue to 0.05]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.05 with delta_time_full=0.005. Processing interval [0.05 - 0.055]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.10997932 -0.21995864] (rel. to baseline of [48.39156796 14.84737505]) :
elements of abs([ 0.2272696 -1.48146487]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.05
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.0525
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 left tagged as 'S', based on a change of [-0.43180887 0.43180887] (rel. to baseline of [87.92942848 15.17745627]) :
elements of abs([-0.49108572 2.84506746]%) are all < (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.05 from the upcoming single step (for all rxns):
Baseline: [48.39156796 88.36948902 14.84737505]
Deltas: [ 0.10997932 -0.87186941 0.65191077]
Adjusted L2 norm: 0.13302659662028024
NOTICE: The chosen time step (0.005) results in an 'L2 rate' (0.133) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.01) at the next round! [The current step started at System Time: 0.05, and will continue to 0.055]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.055 with delta_time_full=0.01. Processing interval [0.055 - 0.065]
All the reactions are SLOW
Processing ALL the 2 reaction(s)
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.26991192 -0.53982384] (rel. to baseline of [48.50154729 15.49928582]) :
elements of abs([ 0.55650167 -3.48289493]%) are all < (100% /1)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.695 (rel. to baseline of 87.4976) for the conc. of `X`: abs(-1.94%) > (100% /1)
EXAMINING CONCENTRATION CHANGES at System Time 0.055 from the upcoming single step (for all rxns):
Baseline: [48.50154729 87.49761961 15.49928582]
Deltas: [ 0.26991192 -1.69497144 1.1551476 ]
Adjusted L2 norm: 0.47557184462533697
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.4756) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.055, and will continue to 0.065]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.065 with delta_time_full=0.01. Processing interval [0.065 - 0.075]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.35692549 -0.71385098] (rel. to baseline of [48.77145921 16.65443342]) :
elements of abs([ 0.73183271 -4.28625196]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.065
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.07
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.76268 (rel. to baseline of 85.0152) for the conc. of `X`: abs(-0.897%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.065 from the upcoming single step (for all rxns):
Baseline: [48.77145921 85.80264817 16.65443342]
Deltas: [ 0.35692549 -1.5500879 0.83623692]
Adjusted L2 norm: 0.3588289447220748
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.3588) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.065, and will continue to 0.075]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.075 with delta_time_full=0.01. Processing interval [0.075 - 0.085]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.41668593 -0.83337187] (rel. to baseline of [49.1283847 17.49067034]) :
elements of abs([ 0.8481572 -4.76466511]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.075
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.08
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.71831 (rel. to baseline of 83.5135) for the conc. of `X`: abs(-0.86%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.075 from the upcoming single step (for all rxns):
Baseline: [49.1283847 84.25256027 17.49067034]
Deltas: [ 0.41668593 -1.45737909 0.62400723]
Adjusted L2 norm: 0.2985517781508984
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.2986) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.075, and will continue to 0.085]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.085 with delta_time_full=0.01. Processing interval [0.085 - 0.095]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.45827279 -0.91654559] (rel. to baseline of [49.54507063 18.11467757]) :
elements of abs([ 0.92496143 -5.05968479]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.085
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.09
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.6808 (rel. to baseline of 82.0967) for the conc. of `X`: abs(-0.829%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.085 from the upcoming single step (for all rxns):
Baseline: [49.54507063 82.79518117 18.11467757]
Deltas: [ 0.45827279 -1.37929103 0.46274545]
Adjusted L2 norm: 0.25851011704346205
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.2585) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.085, and will continue to 0.095]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.095 with delta_time_full=0.01. Processing interval [0.095 - 0.105]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.48612697 -0.97225395] (rel. to baseline of [50.00334342 18.57742301]) :
elements of abs([ 0.97218894 -5.23352429]%) are all < (100% /1)
* FAST REACTIONS: [1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.095
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [1]). 'Local' system time: 0.1
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.64862 (rel. to baseline of 80.752) for the conc. of `X`: abs(-0.803%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.095 from the upcoming single step (for all rxns):
Baseline: [50.00334342 81.41589014 18.57742301]
Deltas: [ 0.48612697 -1.31253893 0.34028498]
Adjusted L2 norm: 0.23054130444294735
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.2305) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.02) at the next round! [The current step started at System Time: 0.095, and will continue to 0.105]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.105 with delta_time_full=0.02. Processing interval [0.105 - 0.125]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of 1.0073 (rel. to baseline of 50.4895) for the conc. of `U`: abs(1.99%) > (100% /1)
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.105
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.115
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.84753 (rel. to baseline of 18.1712) for the conc. of `S`: abs(-4.66%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.2748 (rel. to baseline of 78.8353) for the conc. of `X`: abs(-1.62%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.105 from the upcoming single step (for all rxns):
Baseline: [50.48947039 80.10335121 18.917708 ]
Deltas: [ 1.93464617 -2.54282322 -1.32646911]
Adjusted L2 norm: 1.3298140056859387
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (1.33) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER by a factor 2.0 (set to 0.01) at the next round! [The current step started at System Time: 0.105, and will continue to 0.125]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.125 with delta_time_full=0.01. Processing interval [0.125 - 0.135]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.125
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.13
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.18868846 -0.37737693] (rel. to baseline of [52.60352495 17.86809286]) :
elements of abs([ 0.35869928 -2.11201572]%) are all < (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.61783 (rel. to baseline of 76.9249) for the conc. of `X`: abs(-0.803%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.125 from the upcoming single step (for all rxns):
Baseline: [52.42411656 77.56052799 17.59123888]
Deltas: [ 0.36809685 -1.25350083 0.51730712]
Adjusted L2 norm: 0.2193740298950499
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.2194) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.02) at the next round! [The current step started at System Time: 0.125, and will continue to 0.135]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.135 with delta_time_full=0.02. Processing interval [0.135 - 0.155]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -1.5714 (rel. to baseline of 18.1085) for the conc. of `S`: abs(-8.68%) > (100% /1)
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.135
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.145
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.69527 (rel. to baseline of 17.7399) for the conc. of `S`: abs(-3.92%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.1887 (rel. to baseline of 75.1043) for the conc. of `X`: abs(-1.58%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.135 from the upcoming single step (for all rxns):
Baseline: [52.79221342 76.30702716 18.108546 ]
Deltas: [ 1.5261513 -2.39143474 -0.66086786]
Adjusted L2 norm: 0.9427604737997322
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.9428) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER by a factor 2.0 (set to 0.01) at the next round! [The current step started at System Time: 0.135, and will continue to 0.155]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.155 with delta_time_full=0.01. Processing interval [0.155 - 0.165]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.155
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.16
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.16421051 -0.32842101] (rel. to baseline of [54.4730882 17.72353472]) :
elements of abs([ 0.30145254 -1.85302209]%) are all < (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.56825 (rel. to baseline of 73.3303) for the conc. of `X`: abs(-0.775%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.155 from the upcoming single step (for all rxns):
Baseline: [54.31836472 73.91559242 17.44767814]
Deltas: [ 0.31893399 -1.15355183 0.51568386]
Adjusted L2 norm: 0.18870339626754337
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.1887) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.02) at the next round! [The current step started at System Time: 0.155, and will continue to 0.165]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.165 with delta_time_full=0.02. Processing interval [0.165 - 0.185]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -1.3773 (rel. to baseline of 17.9634) for the conc. of `S`: abs(-7.67%) > (100% /1)
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.165
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.175
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.61754 (rel. to baseline of 17.6911) for the conc. of `S`: abs(-3.49%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -1.0882 (rel. to baseline of 71.657) for the conc. of `X`: abs(-1.52%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.165 from the upcoming single step (for all rxns):
Baseline: [54.63729871 72.76204059 17.963362 ]
Deltas: [ 1.34174043 -2.19330116 -0.4901797 ]
Adjusted L2 norm: 0.7612348313580994
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.7612) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL SMALLER by a factor 2.0 (set to 0.01) at the next round! [The current step started at System Time: 0.165, and will continue to 0.185]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.185 with delta_time_full=0.01. Processing interval [0.185 - 0.195]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.185
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.19
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 left tagged as 'S', based on a change of [ 0.147988 -0.29597601] (rel. to baseline of [56.11817604 17.72924412]) :
elements of abs([ 0.26370779 -1.6694226 ]%) are all < (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.51864 (rel. to baseline of 70.0344) for the conc. of `X`: abs(-0.741%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.185 from the upcoming single step (for all rxns):
Baseline: [55.97903913 70.56873943 17.4731823 ]
Deltas: [ 0.28712491 -1.05297436 0.47872455]
Adjusted L2 norm: 0.15781921064614185
NOTICE: The chosen time step (0.01) results in an 'L2 rate' (0.1578) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.02) at the next round! [The current step started at System Time: 0.185, and will continue to 0.195]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.195 with delta_time_full=0.02. Processing interval [0.195 - 0.215]
* SLOW REACTIONS: [0]
Processing SLOW reactions
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -1.2433 (rel. to baseline of 17.9519) for the conc. of `S`: abs(-6.93%) > (100% /1)
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.195
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.205
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.5592 (rel. to baseline of 17.7169) for the conc. of `S`: abs(-3.16%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.99221 (rel. to baseline of 68.5074) for the conc. of `X`: abs(-1.45%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.195 from the upcoming single step (for all rxns):
Baseline: [56.26616404 69.51576507 17.95190685]
Deltas: [ 1.21208721 -2.00056384 -0.42361059]
Adjusted L2 norm: 0.6278730022554321
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.6279) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.195, and will continue to 0.215]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.215 with delta_time_full=0.02. Processing interval [0.215 - 0.235]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.215
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.225
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.57023 (rel. to baseline of 17.9967) for the conc. of `S`: abs(-3.17%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.91644 (rel. to baseline of 66.5414) for the conc. of `X`: abs(-1.38%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.215 from the upcoming single step (for all rxns):
Baseline: [57.47825125 67.51520124 17.52829625]
Deltas: [ 0.53781225 -1.89020212 0.81457762]
Adjusted L2 norm: 0.5028491972762104
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.5028) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.215, and will continue to 0.235]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.235 with delta_time_full=0.02. Processing interval [0.235 - 0.255]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.235
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.245
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.64257 (rel. to baseline of 18.5968) for the conc. of `S`: abs(-3.46%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.82689 (rel. to baseline of 64.7568) for the conc. of `X`: abs(-1.28%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.235 from the upcoming single step (for all rxns):
Baseline: [58.0160635 65.62499911 18.34287388]
Deltas: [ 0.62839193 -1.69507214 0.43828828]
Adjusted L2 norm: 0.38447139938108577
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.3845) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.235, and will continue to 0.255]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.255 with delta_time_full=0.02. Processing interval [0.255 - 0.275]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.255
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.265
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.66711 (rel. to baseline of 18.913) for the conc. of `S`: abs(-3.53%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.75939 (rel. to baseline of 63.1389) for the conc. of `X`: abs(-1.2%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.255 from the upcoming single step (for all rxns):
Baseline: [58.64445543 63.92992697 18.78116216]
Deltas: [ 0.66316128 -1.5504161 0.22409354]
Adjusted L2 norm: 0.32153231844307784
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.3215) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.255, and will continue to 0.275]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.275 with delta_time_full=0.02. Processing interval [0.275 - 0.295]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.275
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.285
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.66517 (rel. to baseline of 19.0678) for the conc. of `S`: abs(-3.49%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.70539 (rel. to baseline of 61.6484) for the conc. of `X`: abs(-1.14%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.275 from the upcoming single step (for all rxns):
Baseline: [59.30761671 62.37951088 19.0052557 ]
Deltas: [ 0.66685358 -1.43645585 0.10274869]
Adjusted L2 norm: 0.2798507093514281
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.2799) that leads to the following:
ACTION: COMPLETE NORMALLY - we're inside the target range. No change to step size. [The current step started at System Time: 0.275, and will continue to 0.295]
reaction_step_orchestrator(): entering WHILE loop at System Time=0.295 with delta_time_full=0.02. Processing interval [0.295 - 0.315]
There are NO SLOW reactions
* FAST REACTIONS: [0, 1]
- SUBSTEP: 0 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.295
Skipping evaluation of rxn speed for all reactions because NOT at last substep (substep_number = 0, time_subdivision = 2)
- SUBSTEP: 1 (in processing of FAST reactions, i.e. [0, 1]). 'Local' system time: 0.305
(tentatively tagging rxn #0 as 'S')
For Rxn # 0, checking concentrations of chems: {0, 2}
Rxn # 0 FLIPPED TAG to 'F', based on a change of -0.6489 (rel. to baseline of 19.1315) for the conc. of `S`: abs(-3.39%) > (100% /2)
(tentatively tagging rxn #1 as 'S')
For Rxn # 1, checking concentrations of chems: {1, 2}
Rxn # 1 FLIPPED TAG to 'F', based on a change of -0.65995 (rel. to baseline of 60.2612) for the conc. of `X`: abs(-1.1%) > (100% /2)
EXAMINING CONCENTRATION CHANGES at System Time 0.295 from the upcoming single step (for all rxns):
Baseline: [59.97447029 60.94305503 19.10800438]
Deltas: [ 0.65359963 -1.34175786 0.0345586 ]
Adjusted L2 norm: 0.24763343791989711
NOTICE: The chosen time step (0.02) results in an 'L2 rate' (0.2476) that leads to the following:
ACTION: COMPLETE STEP NORMALLY and MAKE THE INTERVAL LARGER by a factor 2 (set to 0.04) at the next round! [The current step started at System Time: 0.295, and will continue to 0.315]
28 total step(s) taken
| SYSTEM TIME | U | X | S | caption | |
|---|---|---|---|---|---|
| 0 | 0.00000 | 50.000000 | 100.000000 | 0.000000 | Initial state |
| 1 | 0.00500 | 49.500000 | 98.500000 | 2.500000 | Interm. step, due to the fast rxns: [0, 1] |
| 2 | 0.00250 | 49.750000 | 99.250000 | 1.250000 | Interm. step, due to the fast rxns: [0, 1] |
| 3 | 0.00500 | 49.526250 | 98.524375 | 2.423125 | |
| 4 | 0.00625 | 49.426666 | 98.173082 | 2.973587 | Interm. step, due to the fast rxns: [1] |
| 5 | 0.00750 | 49.327081 | 97.827235 | 3.518603 | |
| 6 | 0.01250 | 48.974555 | 96.465384 | 5.585506 | |
| 7 | 0.01375 | 48.907973 | 96.145531 | 6.038523 | Interm. step, due to the fast rxns: [1] |
| 8 | 0.01500 | 48.841392 | 95.830274 | 6.486942 | |
| 9 | 0.02000 | 48.612456 | 94.587428 | 8.187661 | |
| 10 | 0.02250 | 48.533147 | 94.000837 | 8.932870 | Interm. step, due to the fast rxns: [1] |
| 11 | 0.02500 | 48.453838 | 93.429824 | 9.662501 | |
| 12 | 0.02750 | 48.404818 | 92.874038 | 10.316326 | Interm. step, due to the fast rxns: [1] |
| 13 | 0.03000 | 48.355799 | 92.332227 | 10.956174 | |
| 14 | 0.03250 | 48.333144 | 91.804078 | 11.529634 | Interm. step, due to the fast rxns: [1] |
| 15 | 0.03500 | 48.310488 | 91.288492 | 12.090531 | |
| 16 | 0.03750 | 48.310746 | 90.785186 | 12.593321 | Interm. step, due to the fast rxns: [1] |
| 17 | 0.04000 | 48.311005 | 90.293197 | 13.084794 | |
| 18 | 0.05000 | 48.391568 | 88.369489 | 14.847375 | |
| 19 | 0.05250 | 48.446558 | 87.929428 | 15.177456 | Interm. step, due to the fast rxns: [1] |
| 20 | 0.05500 | 48.501547 | 87.497620 | 15.499286 | |
| 21 | 0.06500 | 48.771459 | 85.802648 | 16.654433 | |
| 22 | 0.07000 | 48.949922 | 85.015241 | 17.084915 | Interm. step, due to the fast rxns: [1] |
| 23 | 0.07500 | 49.128385 | 84.252560 | 17.490670 | |
| 24 | 0.08000 | 49.336728 | 83.513492 | 17.813053 | Interm. step, due to the fast rxns: [1] |
| 25 | 0.08500 | 49.545071 | 82.795181 | 18.114678 | |
| 26 | 0.09000 | 49.774207 | 82.096694 | 18.354892 | Interm. step, due to the fast rxns: [1] |
| 27 | 0.09500 | 50.003343 | 81.415890 | 18.577423 | |
| 28 | 0.10000 | 50.246407 | 80.751974 | 18.755212 | Interm. step, due to the fast rxns: [1] |
| 29 | 0.10500 | 50.489470 | 80.103351 | 18.917708 | |
| 30 | 0.11500 | 51.496725 | 78.835313 | 18.171237 | Interm. step, due to the fast rxns: [0, 1] |
| 31 | 0.12500 | 52.424117 | 77.560528 | 17.591239 | |
| 32 | 0.13000 | 52.603525 | 76.924857 | 17.868093 | Interm. step, due to the fast rxns: [0, 1] |
| 33 | 0.13500 | 52.792213 | 76.307027 | 18.108546 | |
| 34 | 0.14500 | 53.577892 | 75.104329 | 17.739886 | Interm. step, due to the fast rxns: [0, 1] |
| 35 | 0.15500 | 54.318365 | 73.915592 | 17.447678 | |
| 36 | 0.16000 | 54.473088 | 73.330289 | 17.723535 | Interm. step, due to the fast rxns: [0, 1] |
| 37 | 0.16500 | 54.637299 | 72.762041 | 17.963362 | |
| 38 | 0.17500 | 55.325945 | 71.656981 | 17.691130 | Interm. step, due to the fast rxns: [0, 1] |
| 39 | 0.18500 | 55.979039 | 70.568739 | 17.473182 | |
| 40 | 0.19000 | 56.118176 | 70.034404 | 17.729244 | Interm. step, due to the fast rxns: [0, 1] |
| 41 | 0.19500 | 56.266164 | 69.515765 | 17.951907 | |
| 42 | 0.20500 | 56.887823 | 68.507407 | 17.716948 | Interm. step, due to the fast rxns: [0, 1] |
| 43 | 0.21500 | 57.478251 | 67.515201 | 17.528296 | |
| 44 | 0.22500 | 57.730950 | 66.541443 | 17.996657 | Interm. step, due to the fast rxns: [0, 1] |
| 45 | 0.23500 | 58.016064 | 65.624999 | 18.342874 | |
| 46 | 0.24500 | 58.323172 | 64.756822 | 18.596834 | Interm. step, due to the fast rxns: [0, 1] |
| 47 | 0.25500 | 58.644455 | 63.929927 | 18.781162 | |
| 48 | 0.26500 | 58.974059 | 63.138899 | 18.912983 | Interm. step, due to the fast rxns: [0, 1] |
| 49 | 0.27500 | 59.307617 | 62.379511 | 19.005256 | |
| 50 | 0.28500 | 59.641885 | 61.648441 | 19.067789 | Interm. step, due to the fast rxns: [0, 1] |
| 51 | 0.29500 | 59.974470 | 60.943055 | 19.108004 | |
| 52 | 0.30500 | 60.303621 | 60.261244 | 19.131514 | Interm. step, due to the fast rxns: [0, 1] |
| 53 | 0.31500 | 60.628070 | 59.601297 | 19.142563 |
(transition_times, step_sizes) = dynamics.explain_time_advance(return_times=True)
From time 0 to 0.005, in 1 reduced step of 0.005 (1/2 of requested step) From time 0.005 to 0.0025, in 1 reduced step of -0.0025 (1/-2 of requested step) From time 0.0025 to 0.005, in 1 reduced step of 0.0025 (1/4 of requested step) From time 0.005 to 0.0075, in 2 reduced step of 0.00125 (each 1/2 of requested step) From time 0.0075 to 0.0125, in 1 FULL step of 0.005 From time 0.0125 to 0.015, in 2 reduced step of 0.00125 (each 1/2 of requested step) From time 0.015 to 0.02, in 1 FULL step of 0.005 From time 0.02 to 0.04, in 8 reduced step of 0.0025 (each 1/2 of requested step) From time 0.04 to 0.05, in 1 FULL step of 0.01 From time 0.05 to 0.055, in 2 reduced step of 0.0025 (each 1/2 of requested step) From time 0.055 to 0.065, in 1 FULL step of 0.01 From time 0.065 to 0.105, in 8 reduced step of 0.005 (each 1/2 of requested step) From time 0.105 to 0.125, in 2 reduced step of 0.01 (each 1/2 of requested step) From time 0.125 to 0.135, in 2 reduced step of 0.005 (each 1/2 of requested step) From time 0.135 to 0.155, in 2 reduced step of 0.01 (each 1/2 of requested step) From time 0.155 to 0.165, in 2 reduced step of 0.005 (each 1/2 of requested step) From time 0.165 to 0.185, in 2 reduced step of 0.01 (each 1/2 of requested step) From time 0.185 to 0.195, in 2 reduced step of 0.005 (each 1/2 of requested step) From time 0.195 to 0.315, in 12 reduced step of 0.01 (each 1/2 of requested step)
np.array(step_sizes)
array([0.005 , 0.0025 , 0.00125, 0.005 , 0.00125, 0.005 , 0.0025 ,
0.01 , 0.0025 , 0.01 , 0.005 , 0.01 , 0.005 , 0.01 ,
0.005 , 0.01 , 0.005 , 0.01 ])
np.array(transition_times) # Note: there will be one more transition time (the end time) than step sizes
array([0. , 0.005 , 0.005 , 0.0075, 0.0125, 0.015 , 0.02 , 0.04 ,
0.05 , 0.055 , 0.065 , 0.105 , 0.125 , 0.135 , 0.155 , 0.165 ,
0.185 , 0.195 , 0.315 ])
dynamics.plot_history(colors=['green', 'orange', 'blue'])
dynamics.plot_history(colors=['green', 'orange', 'blue'], show_intervals=True)
# Show the "critical values", i.e. times when the step size changes
dynamics.plot_history(colors=['green', 'orange', 'blue'], vertical_lines=transition_times,
title="Critical values of time-step changes for reactions `2 S <-> U` and `S <-> X`")
The time steps were shown in an earlier plots
dynamics.plot_step_sizes(show_intervals=True)
dynamics.get_diagnostic_rxn_data(rxn_index=0)
Reaction: 2 S <-> U
| TIME | Delta U | Delta X | Delta S | reaction | substep | time_subdivision | delta_time | caption | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0.0000 | -0.500000 | 0.0 | 1.000000 | 0 | 0 | 2 | 0.0050 | |
| 1 | 0.0050 | -0.395000 | 0.0 | 0.790000 | 0 | 1 | 2 | 0.0050 | |
| 2 | 0.0000 | -0.250000 | 0.0 | 0.500000 | 0 | 0 | 2 | 0.0025 | |
| 3 | 0.0025 | -0.223750 | 0.0 | 0.447500 | 0 | 1 | 2 | 0.0025 | |
| 4 | 0.0050 | -0.199169 | 0.0 | 0.398337 | 0 | 0 | 1 | 0.0025 | |
| 5 | 0.0075 | -0.352527 | 0.0 | 0.705053 | 0 | 0 | 1 | 0.0050 | |
| 6 | 0.0125 | -0.133163 | 0.0 | 0.266325 | 0 | 0 | 1 | 0.0025 | |
| 7 | 0.0150 | -0.228936 | 0.0 | 0.457872 | 0 | 0 | 1 | 0.0050 | |
| 8 | 0.0200 | -0.158618 | 0.0 | 0.317236 | 0 | 0 | 1 | 0.0050 | |
| 9 | 0.0250 | -0.098038 | 0.0 | 0.196077 | 0 | 0 | 1 | 0.0050 | |
| 10 | 0.0300 | -0.045311 | 0.0 | 0.090622 | 0 | 0 | 1 | 0.0050 | |
| 11 | 0.0350 | 0.000516 | 0.0 | -0.001033 | 0 | 0 | 1 | 0.0050 | |
| 12 | 0.0400 | 0.080563 | 0.0 | -0.161127 | 0 | 0 | 1 | 0.0100 | |
| 13 | 0.0500 | 0.109979 | 0.0 | -0.219959 | 0 | 0 | 1 | 0.0050 | |
| 14 | 0.0550 | 0.269912 | 0.0 | -0.539824 | 0 | 0 | 1 | 0.0100 | |
| 15 | 0.0650 | 0.356925 | 0.0 | -0.713851 | 0 | 0 | 1 | 0.0100 | |
| 16 | 0.0750 | 0.416686 | 0.0 | -0.833372 | 0 | 0 | 1 | 0.0100 | |
| 17 | 0.0850 | 0.458273 | 0.0 | -0.916546 | 0 | 0 | 1 | 0.0100 | |
| 18 | 0.0950 | 0.486127 | 0.0 | -0.972254 | 0 | 0 | 1 | 0.0100 | |
| 19 | 0.1050 | 1.007254 | 0.0 | -2.014509 | 0 | 0 | 1 | 0.0200 | |
| 20 | 0.1050 | 0.503627 | 0.0 | -1.007254 | 0 | 0 | 2 | 0.0100 | |
| 21 | 0.1150 | 0.423764 | 0.0 | -0.847529 | 0 | 1 | 2 | 0.0100 | |
| 22 | 0.1250 | 0.179408 | 0.0 | -0.358817 | 0 | 0 | 2 | 0.0050 | |
| 23 | 0.1300 | 0.188688 | 0.0 | -0.377377 | 0 | 1 | 2 | 0.0050 | |
| 24 | 0.1350 | 0.785679 | 0.0 | -1.571358 | 0 | 0 | 1 | 0.0200 | |
| 25 | 0.1350 | 0.392839 | 0.0 | -0.785679 | 0 | 0 | 2 | 0.0100 | |
| 26 | 0.1450 | 0.347633 | 0.0 | -0.695266 | 0 | 1 | 2 | 0.0100 | |
| 27 | 0.1550 | 0.154723 | 0.0 | -0.309447 | 0 | 0 | 2 | 0.0050 | |
| 28 | 0.1600 | 0.164211 | 0.0 | -0.328421 | 0 | 1 | 2 | 0.0050 | |
| 29 | 0.1650 | 0.688646 | 0.0 | -1.377292 | 0 | 0 | 1 | 0.0200 | |
| 30 | 0.1650 | 0.344323 | 0.0 | -0.688646 | 0 | 0 | 2 | 0.0100 | |
| 31 | 0.1750 | 0.308771 | 0.0 | -0.617543 | 0 | 1 | 2 | 0.0100 | |
| 32 | 0.1850 | 0.139137 | 0.0 | -0.278274 | 0 | 0 | 2 | 0.0050 | |
| 33 | 0.1900 | 0.147988 | 0.0 | -0.295976 | 0 | 1 | 2 | 0.0050 | |
| 34 | 0.1950 | 0.621659 | 0.0 | -1.243317 | 0 | 0 | 1 | 0.0200 | |
| 35 | 0.1950 | 0.310829 | 0.0 | -0.621659 | 0 | 0 | 2 | 0.0100 | |
| 36 | 0.2050 | 0.279599 | 0.0 | -0.559199 | 0 | 1 | 2 | 0.0100 | |
| 37 | 0.2150 | 0.252699 | 0.0 | -0.505397 | 0 | 0 | 2 | 0.0100 | |
| 38 | 0.2250 | 0.285114 | 0.0 | -0.570227 | 0 | 1 | 2 | 0.0100 | |
| 39 | 0.2350 | 0.307109 | 0.0 | -0.614217 | 0 | 0 | 2 | 0.0100 | |
| 40 | 0.2450 | 0.321283 | 0.0 | -0.642567 | 0 | 1 | 2 | 0.0100 | |
| 41 | 0.2550 | 0.329604 | 0.0 | -0.659208 | 0 | 0 | 2 | 0.0100 | |
| 42 | 0.2650 | 0.333557 | 0.0 | -0.667115 | 0 | 1 | 2 | 0.0100 | |
| 43 | 0.2750 | 0.334268 | 0.0 | -0.668536 | 0 | 0 | 2 | 0.0100 | |
| 44 | 0.2850 | 0.332585 | 0.0 | -0.665171 | 0 | 1 | 2 | 0.0100 | |
| 45 | 0.2950 | 0.329151 | 0.0 | -0.658302 | 0 | 0 | 2 | 0.0100 | |
| 46 | 0.3050 | 0.324449 | 0.0 | -0.648897 | 0 | 1 | 2 | 0.0100 |
dynamics.get_diagnostic_rxn_data(rxn_index=1)
Reaction: S <-> X
| TIME | Delta U | Delta X | Delta S | reaction | substep | time_subdivision | delta_time | caption | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0.00000 | 0.0 | -1.500000 | 1.500000 | 1 | 0 | 2 | 0.00500 | |
| 1 | 0.00500 | 0.0 | -1.402500 | 1.402500 | 1 | 1 | 2 | 0.00500 | |
| 2 | 0.00000 | 0.0 | -0.750000 | 0.750000 | 1 | 0 | 2 | 0.00250 | |
| 3 | 0.00250 | 0.0 | -0.725625 | 0.725625 | 1 | 1 | 2 | 0.00250 | |
| 4 | 0.00500 | 0.0 | -0.351293 | 0.351293 | 1 | 0 | 2 | 0.00125 | |
| 5 | 0.00625 | 0.0 | -0.345847 | 0.345847 | 1 | 1 | 2 | 0.00125 | |
| 6 | 0.00750 | 0.0 | -1.361850 | 1.361850 | 1 | 0 | 1 | 0.00500 | |
| 7 | 0.01250 | 0.0 | -0.319854 | 0.319854 | 1 | 0 | 2 | 0.00125 | |
| 8 | 0.01375 | 0.0 | -0.315257 | 0.315257 | 1 | 1 | 2 | 0.00125 | |
| 9 | 0.01500 | 0.0 | -1.242846 | 1.242846 | 1 | 0 | 1 | 0.00500 | |
| 10 | 0.02000 | 0.0 | -0.586591 | 0.586591 | 1 | 0 | 2 | 0.00250 | |
| 11 | 0.02250 | 0.0 | -0.571013 | 0.571013 | 1 | 1 | 2 | 0.00250 | |
| 12 | 0.02500 | 0.0 | -0.555786 | 0.555786 | 1 | 0 | 2 | 0.00250 | |
| 13 | 0.02750 | 0.0 | -0.541810 | 0.541810 | 1 | 1 | 2 | 0.00250 | |
| 14 | 0.03000 | 0.0 | -0.528149 | 0.528149 | 1 | 0 | 2 | 0.00250 | |
| 15 | 0.03250 | 0.0 | -0.515586 | 0.515586 | 1 | 1 | 2 | 0.00250 | |
| 16 | 0.03500 | 0.0 | -0.503306 | 0.503306 | 1 | 0 | 2 | 0.00250 | |
| 17 | 0.03750 | 0.0 | -0.491989 | 0.491989 | 1 | 1 | 2 | 0.00250 | |
| 18 | 0.04000 | 0.0 | -1.923708 | 1.923708 | 1 | 0 | 1 | 0.01000 | |
| 19 | 0.05000 | 0.0 | -0.440061 | 0.440061 | 1 | 0 | 2 | 0.00250 | |
| 20 | 0.05250 | 0.0 | -0.431809 | 0.431809 | 1 | 1 | 2 | 0.00250 | |
| 21 | 0.05500 | 0.0 | -1.694971 | 1.694971 | 1 | 0 | 1 | 0.01000 | |
| 22 | 0.06500 | 0.0 | -0.787407 | 0.787407 | 1 | 0 | 2 | 0.00500 | |
| 23 | 0.07000 | 0.0 | -0.762681 | 0.762681 | 1 | 1 | 2 | 0.00500 | |
| 24 | 0.07500 | 0.0 | -0.739068 | 0.739068 | 1 | 0 | 2 | 0.00500 | |
| 25 | 0.08000 | 0.0 | -0.718311 | 0.718311 | 1 | 1 | 2 | 0.00500 | |
| 26 | 0.08500 | 0.0 | -0.698487 | 0.698487 | 1 | 0 | 2 | 0.00500 | |
| 27 | 0.09000 | 0.0 | -0.680804 | 0.680804 | 1 | 1 | 2 | 0.00500 | |
| 28 | 0.09500 | 0.0 | -0.663916 | 0.663916 | 1 | 0 | 2 | 0.00500 | |
| 29 | 0.10000 | 0.0 | -0.648623 | 0.648623 | 1 | 1 | 2 | 0.00500 | |
| 30 | 0.10500 | 0.0 | -1.268038 | 1.268038 | 1 | 0 | 2 | 0.01000 | |
| 31 | 0.11500 | 0.0 | -1.274785 | 1.274785 | 1 | 1 | 2 | 0.01000 | |
| 32 | 0.12500 | 0.0 | -0.635671 | 0.635671 | 1 | 0 | 2 | 0.00500 | |
| 33 | 0.13000 | 0.0 | -0.617830 | 0.617830 | 1 | 1 | 2 | 0.00500 | |
| 34 | 0.13500 | 0.0 | -1.202698 | 1.202698 | 1 | 0 | 2 | 0.01000 | |
| 35 | 0.14500 | 0.0 | -1.188737 | 1.188737 | 1 | 1 | 2 | 0.01000 | |
| 36 | 0.15500 | 0.0 | -0.585304 | 0.585304 | 1 | 0 | 2 | 0.00500 | |
| 37 | 0.16000 | 0.0 | -0.568248 | 0.568248 | 1 | 1 | 2 | 0.00500 | |
| 38 | 0.16500 | 0.0 | -1.105059 | 1.105059 | 1 | 0 | 2 | 0.01000 | |
| 39 | 0.17500 | 0.0 | -1.088242 | 1.088242 | 1 | 1 | 2 | 0.01000 | |
| 40 | 0.18500 | 0.0 | -0.534336 | 0.534336 | 1 | 0 | 2 | 0.00500 | |
| 41 | 0.19000 | 0.0 | -0.518639 | 0.518639 | 1 | 1 | 2 | 0.00500 | |
| 42 | 0.19500 | 0.0 | -1.008359 | 1.008359 | 1 | 0 | 2 | 0.01000 | |
| 43 | 0.20500 | 0.0 | -0.992205 | 0.992205 | 1 | 1 | 2 | 0.01000 | |
| 44 | 0.21500 | 0.0 | -0.973758 | 0.973758 | 1 | 0 | 2 | 0.01000 | |
| 45 | 0.22500 | 0.0 | -0.916444 | 0.916444 | 1 | 1 | 2 | 0.01000 | |
| 46 | 0.23500 | 0.0 | -0.868178 | 0.868178 | 1 | 0 | 2 | 0.01000 | |
| 47 | 0.24500 | 0.0 | -0.826895 | 0.826895 | 1 | 1 | 2 | 0.01000 | |
| 48 | 0.25500 | 0.0 | -0.791028 | 0.791028 | 1 | 0 | 2 | 0.01000 | |
| 49 | 0.26500 | 0.0 | -0.759388 | 0.759388 | 1 | 1 | 2 | 0.01000 | |
| 50 | 0.27500 | 0.0 | -0.731070 | 0.731070 | 1 | 0 | 2 | 0.01000 | |
| 51 | 0.28500 | 0.0 | -0.705386 | 0.705386 | 1 | 1 | 2 | 0.01000 | |
| 52 | 0.29500 | 0.0 | -0.681811 | 0.681811 | 1 | 0 | 2 | 0.01000 | |
| 53 | 0.30500 | 0.0 | -0.659946 | 0.659946 | 1 | 1 | 2 | 0.01000 |
dynamics.get_diagnostic_conc_data()
| TIME | U | X | S | is_primary | primary_timestep | n_substeps | substep_number | caption | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 0.00000 | 50.000000 | 100.000000 | 0.000000 | True | 0.0100 | 2 | 0 | |
| 1 | 0.00500 | 49.500000 | 98.500000 | 2.500000 | False | 0.0100 | 2 | 1 | |
| 2 | 0.00250 | 49.750000 | 99.250000 | 1.250000 | False | 0.0050 | 2 | 1 | |
| 3 | 0.00500 | 49.526250 | 98.524375 | 2.423125 | True | 0.0100 | 2 | 0 | |
| 4 | 0.00625 | 49.426666 | 98.173082 | 2.973587 | False | 0.0025 | 2 | 1 | |
| 5 | 0.00750 | 49.327081 | 97.827235 | 3.518603 | True | 0.0025 | 2 | 0 | |
| 6 | 0.01250 | 48.974555 | 96.465384 | 5.585506 | True | 0.0050 | 2 | 0 | |
| 7 | 0.01375 | 48.907973 | 96.145531 | 6.038523 | False | 0.0025 | 2 | 1 | |
| 8 | 0.01500 | 48.841392 | 95.830274 | 6.486942 | True | 0.0025 | 2 | 0 | |
| 9 | 0.02000 | 48.612456 | 94.587428 | 8.187661 | True | 0.0050 | 2 | 0 | |
| 10 | 0.02250 | 48.533147 | 94.000837 | 8.932870 | False | 0.0050 | 2 | 1 | |
| 11 | 0.02500 | 48.453838 | 93.429824 | 9.662501 | True | 0.0050 | 2 | 0 | |
| 12 | 0.02750 | 48.404818 | 92.874038 | 10.316326 | False | 0.0050 | 2 | 1 | |
| 13 | 0.03000 | 48.355799 | 92.332227 | 10.956174 | True | 0.0050 | 2 | 0 | |
| 14 | 0.03250 | 48.333144 | 91.804078 | 11.529634 | False | 0.0050 | 2 | 1 | |
| 15 | 0.03500 | 48.310488 | 91.288492 | 12.090531 | True | 0.0050 | 2 | 0 | |
| 16 | 0.03750 | 48.310746 | 90.785186 | 12.593321 | False | 0.0050 | 2 | 1 | |
| 17 | 0.04000 | 48.311005 | 90.293197 | 13.084794 | True | 0.0050 | 2 | 0 | |
| 18 | 0.05000 | 48.391568 | 88.369489 | 14.847375 | True | 0.0100 | 2 | 0 | |
| 19 | 0.05250 | 48.446558 | 87.929428 | 15.177456 | False | 0.0050 | 2 | 1 | |
| 20 | 0.05500 | 48.501547 | 87.497620 | 15.499286 | True | 0.0050 | 2 | 0 | |
| 21 | 0.06500 | 48.771459 | 85.802648 | 16.654433 | True | 0.0100 | 2 | 0 | |
| 22 | 0.07000 | 48.949922 | 85.015241 | 17.084915 | False | 0.0100 | 2 | 1 | |
| 23 | 0.07500 | 49.128385 | 84.252560 | 17.490670 | True | 0.0100 | 2 | 0 | |
| 24 | 0.08000 | 49.336728 | 83.513492 | 17.813053 | False | 0.0100 | 2 | 1 | |
| 25 | 0.08500 | 49.545071 | 82.795181 | 18.114678 | True | 0.0100 | 2 | 0 | |
| 26 | 0.09000 | 49.774207 | 82.096694 | 18.354892 | False | 0.0100 | 2 | 1 | |
| 27 | 0.09500 | 50.003343 | 81.415890 | 18.577423 | True | 0.0100 | 2 | 0 | |
| 28 | 0.10000 | 50.246407 | 80.751974 | 18.755212 | False | 0.0100 | 2 | 1 | |
| 29 | 0.10500 | 50.489470 | 80.103351 | 18.917708 | True | 0.0100 | 2 | 0 | |
| 30 | 0.11500 | 51.496725 | 78.835313 | 18.171237 | False | 0.0200 | 2 | 1 | |
| 31 | 0.12500 | 52.424117 | 77.560528 | 17.591239 | True | 0.0200 | 2 | 0 | |
| 32 | 0.13000 | 52.603525 | 76.924857 | 17.868093 | False | 0.0100 | 2 | 1 | |
| 33 | 0.13500 | 52.792213 | 76.307027 | 18.108546 | True | 0.0100 | 2 | 0 | |
| 34 | 0.14500 | 53.577892 | 75.104329 | 17.739886 | False | 0.0200 | 2 | 1 | |
| 35 | 0.15500 | 54.318365 | 73.915592 | 17.447678 | True | 0.0200 | 2 | 0 | |
| 36 | 0.16000 | 54.473088 | 73.330289 | 17.723535 | False | 0.0100 | 2 | 1 | |
| 37 | 0.16500 | 54.637299 | 72.762041 | 17.963362 | True | 0.0100 | 2 | 0 | |
| 38 | 0.17500 | 55.325945 | 71.656981 | 17.691130 | False | 0.0200 | 2 | 1 | |
| 39 | 0.18500 | 55.979039 | 70.568739 | 17.473182 | True | 0.0200 | 2 | 0 | |
| 40 | 0.19000 | 56.118176 | 70.034404 | 17.729244 | False | 0.0100 | 2 | 1 | |
| 41 | 0.19500 | 56.266164 | 69.515765 | 17.951907 | True | 0.0100 | 2 | 0 | |
| 42 | 0.20500 | 56.887823 | 68.507407 | 17.716948 | False | 0.0200 | 2 | 1 | |
| 43 | 0.21500 | 57.478251 | 67.515201 | 17.528296 | True | 0.0200 | 2 | 0 | |
| 44 | 0.22500 | 57.730950 | 66.541443 | 17.996657 | False | 0.0200 | 2 | 1 | |
| 45 | 0.23500 | 58.016064 | 65.624999 | 18.342874 | True | 0.0200 | 2 | 0 | |
| 46 | 0.24500 | 58.323172 | 64.756822 | 18.596834 | False | 0.0200 | 2 | 1 | |
| 47 | 0.25500 | 58.644455 | 63.929927 | 18.781162 | True | 0.0200 | 2 | 0 | |
| 48 | 0.26500 | 58.974059 | 63.138899 | 18.912983 | False | 0.0200 | 2 | 1 | |
| 49 | 0.27500 | 59.307617 | 62.379511 | 19.005256 | True | 0.0200 | 2 | 0 | |
| 50 | 0.28500 | 59.641885 | 61.648441 | 19.067789 | False | 0.0200 | 2 | 1 | |
| 51 | 0.29500 | 59.974470 | 60.943055 | 19.108004 | True | 0.0200 | 2 | 0 | |
| 52 | 0.30500 | 60.303621 | 60.261244 | 19.131514 | False | 0.0200 | 2 | 1 | |
| 53 | 0.31500 | 60.628070 | 59.601297 | 19.142563 | True | 0.0200 | 2 | 0 |
dynamics.get_diagnostic_decisions_data()
| TIME | Delta U | Delta X | Delta S | caption | L2 | action | step_factor | |
|---|---|---|---|---|---|---|---|---|
| 0 | 0.0000 | -0.500000 | -1.500000 | 2.500000 | NaN | NaN | NaN | |
| 1 | 0.0000 | -0.895000 | -2.902500 | 4.692500 | 3.471676 | ABORT | 0.5 | |
| 2 | 0.0000 | -0.250000 | -0.750000 | 1.250000 | NaN | NaN | NaN | |
| 3 | 0.0000 | -0.473750 | -1.475625 | 2.423125 | 0.919271 | OK | 0.5 | |
| 4 | 0.0050 | 0.000000 | -0.351293 | 0.351293 | NaN | NaN | NaN | |
| 5 | 0.0050 | -0.199169 | -0.697140 | 1.095478 | 0.191749 | OK | 2.0 | |
| 6 | 0.0075 | -0.352527 | -1.361850 | 2.066904 | 0.694556 | OK | 0.5 | |
| 7 | 0.0125 | 0.000000 | -0.319854 | 0.319854 | NaN | NaN | NaN | |
| 8 | 0.0125 | -0.133163 | -0.635111 | 0.901436 | 0.137076 | OK | 2.0 | |
| 9 | 0.0150 | -0.228936 | -1.242846 | 1.700718 | 0.498836 | OK | 1.0 | |
| 10 | 0.0200 | 0.000000 | -0.586591 | 0.586591 | NaN | NaN | NaN | |
| 11 | 0.0200 | -0.158618 | -1.157604 | 1.474840 | 0.393373 | OK | 1.0 | |
| 12 | 0.0250 | 0.000000 | -0.555786 | 0.555786 | NaN | NaN | NaN | |
| 13 | 0.0250 | -0.098038 | -1.097597 | 1.293673 | 0.320880 | OK | 1.0 | |
| 14 | 0.0300 | 0.000000 | -0.528149 | 0.528149 | NaN | NaN | NaN | |
| 15 | 0.0300 | -0.045311 | -1.043735 | 1.134357 | 0.264245 | OK | 1.0 | |
| 16 | 0.0350 | 0.000000 | -0.503306 | 0.503306 | NaN | NaN | NaN | |
| 17 | 0.0350 | 0.000516 | -0.995295 | 0.994262 | 0.219908 | OK | 2.0 | |
| 18 | 0.0400 | 0.080563 | -1.923708 | 1.762582 | 0.757093 | OK | 0.5 | |
| 19 | 0.0500 | 0.000000 | -0.440061 | 0.440061 | NaN | NaN | NaN | |
| 20 | 0.0500 | 0.109979 | -0.871869 | 0.651911 | 0.133027 | OK | 2.0 | |
| 21 | 0.0550 | 0.269912 | -1.694971 | 1.155148 | 0.475572 | OK | 1.0 | |
| 22 | 0.0650 | 0.000000 | -0.787407 | 0.787407 | NaN | NaN | NaN | |
| 23 | 0.0650 | 0.356925 | -1.550088 | 0.836237 | 0.358829 | OK | 1.0 | |
| 24 | 0.0750 | 0.000000 | -0.739068 | 0.739068 | NaN | NaN | NaN | |
| 25 | 0.0750 | 0.416686 | -1.457379 | 0.624007 | 0.298552 | OK | 1.0 | |
| 26 | 0.0850 | 0.000000 | -0.698487 | 0.698487 | NaN | NaN | NaN | |
| 27 | 0.0850 | 0.458273 | -1.379291 | 0.462745 | 0.258510 | OK | 1.0 | |
| 28 | 0.0950 | 0.000000 | -0.663916 | 0.663916 | NaN | NaN | NaN | |
| 29 | 0.0950 | 0.486127 | -1.312539 | 0.340285 | 0.230541 | OK | 2.0 | |
| 30 | 0.1050 | 0.503627 | -1.268038 | 0.260784 | NaN | NaN | NaN | |
| 31 | 0.1050 | 1.934646 | -2.542823 | -1.326469 | 1.329814 | OK | 0.5 | |
| 32 | 0.1250 | 0.179408 | -0.635671 | 0.276854 | NaN | NaN | NaN | |
| 33 | 0.1250 | 0.368097 | -1.253501 | 0.517307 | 0.219374 | OK | 2.0 | |
| 34 | 0.1350 | 0.392839 | -1.202698 | 0.417019 | NaN | NaN | NaN | |
| 35 | 0.1350 | 1.526151 | -2.391435 | -0.660868 | 0.942760 | OK | 0.5 | |
| 36 | 0.1550 | 0.154723 | -0.585304 | 0.275857 | NaN | NaN | NaN | |
| 37 | 0.1550 | 0.318934 | -1.153552 | 0.515684 | 0.188703 | OK | 2.0 | |
| 38 | 0.1650 | 0.344323 | -1.105059 | 0.416414 | NaN | NaN | NaN | |
| 39 | 0.1650 | 1.341740 | -2.193301 | -0.490180 | 0.761235 | OK | 0.5 | |
| 40 | 0.1850 | 0.139137 | -0.534336 | 0.256062 | NaN | NaN | NaN | |
| 41 | 0.1850 | 0.287125 | -1.052974 | 0.478725 | 0.157819 | OK | 2.0 | |
| 42 | 0.1950 | 0.310829 | -1.008359 | 0.386700 | NaN | NaN | NaN | |
| 43 | 0.1950 | 1.212087 | -2.000564 | -0.423611 | 0.627873 | OK | 1.0 | |
| 44 | 0.2150 | 0.252699 | -0.973758 | 0.468361 | NaN | NaN | NaN | |
| 45 | 0.2150 | 0.537812 | -1.890202 | 0.814578 | 0.502849 | OK | 1.0 | |
| 46 | 0.2350 | 0.307109 | -0.868178 | 0.253960 | NaN | NaN | NaN | |
| 47 | 0.2350 | 0.628392 | -1.695072 | 0.438288 | 0.384471 | OK | 1.0 | |
| 48 | 0.2550 | 0.329604 | -0.791028 | 0.131820 | NaN | NaN | NaN | |
| 49 | 0.2550 | 0.663161 | -1.550416 | 0.224094 | 0.321532 | OK | 1.0 | |
| 50 | 0.2750 | 0.334268 | -0.731070 | 0.062534 | NaN | NaN | NaN | |
| 51 | 0.2750 | 0.666854 | -1.436456 | 0.102749 | 0.279851 | OK | 1.0 | |
| 52 | 0.2950 | 0.329151 | -0.681811 | 0.023509 | NaN | NaN | NaN | |
| 53 | 0.2950 | 0.653600 | -1.341758 | 0.034559 | 0.247633 | OK | 2.0 |
[it took 39 computation steps]
df.iloc[39]
SYSTEM TIME 0.185 U 55.979039 X 70.568739 S 17.473182 caption Name: 39, dtype: object
substep_data = df.iloc[39][['U', 'X', 'S']].to_numpy()
substep_data
array([55.97903913467732, 70.568739429991, 17.473182300654425],
dtype=object)
variable_steps_1 (no substeps, and same main steps as in here):¶[it took 21 computation steps]
no_substep_data = np.array([54.631805, 71.023480, 19.712910])
no_substep_data
array([54.631805, 71.02348 , 19.71291 ])
substeps_2 (with tiny fixed steps, used as a proxy for exact solution):¶exact_data = np.array([54.529071, 71.351769, 19.590088])
exact_data
array([54.529071, 71.351769, 19.590088])
substep_error = abs(substep_data - exact_data)
substep_error
array([1.44996813467732, 0.7830295700090062, 2.116905699345576],
dtype=object)
no_substep_error = abs(no_substep_data - exact_data)
no_substep_error
array([0.102734, 0.328289, 0.122822])
In this scenario, the substeps option made the errors WORSE - in spite of a substantial number of extra steps.
Also, substeps led to irregularies in the plot of the concentrations of S.
At any rates, substeps are far less relevant ever since the introduction of variable (main) step.