A
down-regulates B
,¶A + 2 B <-> Y
(mostly forward)¶1st-order kinetics.
If [A] is low and [B] is high, then [B] remains high. If [A] goes high, [B] goes low. However, at that point, A can no longer bring B up to any substantial extent.
See also 1D/reactions/down_regulation_1
LAST REVISED: June 23, 2024 (using v. 1.0 beta36)
import set_path # Importing this module will add the project's home directory to sys.path
Added 'D:\Docs\- MY CODE\BioSimulations\life123-Win7' to sys.path
from experiments.get_notebook_info import get_notebook_basename
from life123 import ChemData as chem
from life123 import UniformCompartment
from life123 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_2"],
extra_js="https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.21.2/cytoscape.umd.js")
-> Output will be LOGGED into the file 'down_regulate_2.log.htm'
# Initialize the system
chem_data = chem(names=["A", "B", "Y"])
# Reaction A + 2 B <-> Y , with 1st-order kinetics for all species
chem_data.add_reaction(reactants=["A" , (2, "B", 1)], products="Y",
forward_rate=8., reverse_rate=2.)
chem_data.describe_reactions()
# Send the plot of the reaction network to the HTML log file
chem_data.plot_reaction_network("vue_cytoscape_2")
Number of reactions: 1 (at temp. 25 C) 0: A + 2 B <-> Y (kF = 8 / kR = 2 / delta_G = -3,436.6 / K = 4) | 1st order in all reactants & products Set of chemicals involved in the above reactions: {'B', 'Y', 'A'} [GRAPHIC ELEMENT SENT TO LOG FILE `down_regulate_2.log.htm`]
dynamics = UniformCompartment(chem_data=chem_data, preset="fast")
dynamics.set_conc(conc={"A": 5., "B": 100.},
snapshot=True) # A is scarce, B is plentiful, Y is absent
dynamics.describe_state()
SYSTEM STATE at Time t = 0: 3 species: Species 0 (A). Conc: 5.0 Species 1 (B). Conc: 100.0 Species 2 (Y). Conc: 0.0 Set of chemicals involved in reactions: {'B', 'Y', 'A'}
# All of these settings are currently close to the default values... but subject to change; set for repeatability
dynamics.single_compartment_react(initial_step=0.0005, duration=0.015,
variable_steps=True)
Some steps were backtracked and re-done, to prevent negative concentrations or excessively large concentration changes 31 total step(s) taken Number of step re-do's because of negative concentrations: 0 Number of step re-do's because of elective soft aborts: 1 Norm usage: {'norm_A': 8, 'norm_B': 7, 'norm_C': 7, 'norm_D': 7}
A, as the scarse limiting reagent, stops the reaction.
When A is low, B is also low.
dynamics.plot_history(colors=['red', 'darkorange', 'green'],
title="Changes in concentrations (reaction A + 2 B <-> Y)")
dynamics.get_history()
SYSTEM TIME | A | B | Y | caption | |
---|---|---|---|---|---|
0 | 0.000000 | 5.000000 | 100.000000 | 0.000000 | Initialized state |
1 | 0.000300 | 3.800000 | 97.600000 | 1.200000 | |
2 | 0.000600 | 2.910608 | 95.821216 | 2.089392 | |
3 | 0.000900 | 2.242506 | 94.485013 | 2.757494 | |
4 | 0.001200 | 1.735641 | 93.471282 | 3.264359 | |
5 | 0.001500 | 1.348242 | 92.696483 | 3.651758 | |
6 | 0.001800 | 1.050487 | 92.100974 | 3.949513 | |
7 | 0.002100 | 0.820655 | 91.641309 | 4.179345 | |
8 | 0.002400 | 0.642668 | 91.285336 | 4.357332 | |
9 | 0.002700 | 0.504484 | 91.008968 | 4.495516 | |
10 | 0.003000 | 0.396991 | 90.793982 | 4.603009 | |
11 | 0.003300 | 0.313246 | 90.626493 | 4.686754 | |
12 | 0.003600 | 0.247926 | 90.495852 | 4.752074 | |
13 | 0.003900 | 0.196930 | 90.393861 | 4.803070 | |
14 | 0.004200 | 0.157089 | 90.314178 | 4.842911 | |
15 | 0.004500 | 0.125945 | 90.251890 | 4.874055 | |
16 | 0.004800 | 0.101589 | 90.203179 | 4.898411 | |
17 | 0.005100 | 0.082535 | 90.165071 | 4.917465 | |
18 | 0.005400 | 0.067626 | 90.135251 | 4.932374 | |
19 | 0.005700 | 0.055956 | 90.111912 | 4.944044 | |
20 | 0.006000 | 0.046821 | 90.093642 | 4.953179 | |
21 | 0.006300 | 0.039669 | 90.079338 | 4.960331 | |
22 | 0.006600 | 0.034069 | 90.068138 | 4.965931 | |
23 | 0.007050 | 0.027492 | 90.054983 | 4.972508 | |
24 | 0.007500 | 0.023054 | 90.046108 | 4.976946 | |
25 | 0.007950 | 0.020060 | 90.040120 | 4.979940 | |
26 | 0.008625 | 0.017029 | 90.034059 | 4.982971 | |
27 | 0.009300 | 0.015477 | 90.030954 | 4.984523 | |
28 | 0.010312 | 0.014284 | 90.028568 | 4.985716 | |
29 | 0.011831 | 0.013804 | 90.027607 | 4.986196 | |
30 | 0.014109 | 0.013874 | 90.027747 | 4.986126 | |
31 | 0.017527 | 0.013806 | 90.027612 | 4.986194 |
dynamics.explain_time_advance(use_history=True)
From time 0 to 0.0066, in 22 steps of 0.0003 From time 0.0066 to 0.00795, in 3 steps of 0.00045 From time 0.00795 to 0.0093, in 2 steps of 0.000675 From time 0.0093 to 0.01031, in 1 step of 0.00101 From time 0.01031 to 0.01183, in 1 step of 0.00152 From time 0.01183 to 0.01411, in 1 step of 0.00228 From time 0.01411 to 0.01753, in 1 step of 0.00342 (31 steps total)
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium()
0: A + 2 B <-> Y Final concentrations: [A] = 0.01381 ; [B] = 90.03 ; [Y] = 4.986 1. Ratio of reactant/product concentrations, adjusted for reaction orders: 4.01174 Formula used: [Y] / ([A][B]) 2. Ratio of forward/reverse reaction rates: 4 Discrepancy between the two values: 0.2934 % Reaction IS in equilibrium (within 1% tolerance)
True
dynamics.set_single_conc(species_name="A", conc=40., snapshot=True)
dynamics.describe_state()
SYSTEM STATE at Time t = 0.017526562: 3 species: Species 0 (A). Conc: 40.0 Species 1 (B). Conc: 90.0276115740671 Species 2 (Y). Conc: 4.986194212966452 Set of chemicals involved in reactions: {'B', 'Y', 'A'}
dynamics.history.get_dataframe(tail=5)
SYSTEM TIME | A | B | Y | caption | |
---|---|---|---|---|---|
28 | 0.010312 | 0.014284 | 90.028568 | 4.985716 | |
29 | 0.011831 | 0.013804 | 90.027607 | 4.986196 | |
30 | 0.014109 | 0.013874 | 90.027747 | 4.986126 | |
31 | 0.017527 | 0.013806 | 90.027612 | 4.986194 | |
32 | 0.017527 | 40.000000 | 90.027612 | 4.986194 | Set concentration of `A` |
dynamics.single_compartment_react(initial_step=0.0005, target_end_time=0.055,
variable_steps=True)
40 total step(s) taken Number of step re-do's because of negative concentrations: 0 Number of step re-do's because of elective soft aborts: 5 Norm usage: {'norm_A': 32, 'norm_B': 19, 'norm_C': 19, 'norm_D': 19}
dynamics.plot_history(colors=['red', 'darkorange', 'green'],
title="Changes in concentrations (reaction A + 2 B <-> Y)")
A, still the limiting reagent, is again stopping the reaction.
The (transiently) high value of [A] led to a high value of [B]
dynamics.get_history()
SYSTEM TIME | A | B | Y | caption | |
---|---|---|---|---|---|
0 | 0.000000 | 5.000000 | 100.000000 | 0.000000 | Initialized state |
1 | 0.000300 | 3.800000 | 97.600000 | 1.200000 | |
2 | 0.000600 | 2.910608 | 95.821216 | 2.089392 | |
3 | 0.000900 | 2.242506 | 94.485013 | 2.757494 | |
4 | 0.001200 | 1.735641 | 93.471282 | 3.264359 | |
... | ... | ... | ... | ... | ... |
68 | 0.036135 | 1.489987 | 13.007586 | 43.496207 | |
69 | 0.038991 | 1.295592 | 12.618796 | 43.690602 | |
70 | 0.043275 | 1.109602 | 12.246816 | 43.876592 | |
71 | 0.049702 | 0.974898 | 11.977408 | 44.011296 | |
72 | 0.059343 | 0.922923 | 11.873458 | 44.063271 |
73 rows × 5 columns
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium()
0: A + 2 B <-> Y Final concentrations: [A] = 0.9229 ; [B] = 11.87 ; [Y] = 44.06 1. Ratio of reactant/product concentrations, adjusted for reaction orders: 4.021 Formula used: [Y] / ([A][B]) 2. Ratio of forward/reverse reaction rates: 4 Discrepancy between the two values: 0.525 % Reaction IS in equilibrium (within 1% tolerance)
True
dynamics.set_single_conc(species_name="A", conc=30., snapshot=True)
dynamics.describe_state()
SYSTEM STATE at Time t = 0.059342556: 3 species: Species 0 (A). Conc: 30.0 Species 1 (B). Conc: 11.873458232380969 Species 2 (Y). Conc: 44.06327088380949 Set of chemicals involved in reactions: {'B', 'Y', 'A'}
dynamics.history.get_dataframe(tail=5)
SYSTEM TIME | A | B | Y | caption | |
---|---|---|---|---|---|
69 | 0.038991 | 1.295592 | 12.618796 | 43.690602 | |
70 | 0.043275 | 1.109602 | 12.246816 | 43.876592 | |
71 | 0.049702 | 0.974898 | 11.977408 | 44.011296 | |
72 | 0.059343 | 0.922923 | 11.873458 | 44.063271 | |
73 | 0.059343 | 30.000000 | 11.873458 | 44.063271 | Set concentration of `A` |
dynamics.single_compartment_react(initial_step=0.001, target_end_time=0.09,
variable_steps=True)
21 total step(s) taken Number of step re-do's because of negative concentrations: 0 Number of step re-do's because of elective soft aborts: 2 Norm usage: {'norm_A': 11, 'norm_B': 9, 'norm_C': 9, 'norm_D': 9}
dynamics.plot_history(colors=['red', 'darkorange', 'green'],
title="Changes in concentrations (reaction A + 2 B <-> Y)")
dynamics.get_history()
SYSTEM TIME | A | B | Y | caption | |
---|---|---|---|---|---|
0 | 0.000000 | 5.000000 | 100.000000 | 0.000000 | Initialized state |
1 | 0.000300 | 3.800000 | 97.600000 | 1.200000 | |
2 | 0.000600 | 2.910608 | 95.821216 | 2.089392 | |
3 | 0.000900 | 2.242506 | 94.485013 | 2.757494 | |
4 | 0.001200 | 1.735641 | 93.471282 | 3.264359 | |
... | ... | ... | ... | ... | ... |
90 | 0.070570 | 24.334850 | 0.543158 | 49.728421 | |
91 | 0.073304 | 24.317670 | 0.508797 | 49.745601 | |
92 | 0.077404 | 24.319757 | 0.512972 | 49.743514 | |
93 | 0.083555 | 24.317814 | 0.509086 | 49.745457 | |
94 | 0.092782 | 24.321984 | 0.517426 | 49.741287 |
95 rows × 5 columns
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium(tolerance=2)
0: A + 2 B <-> Y Final concentrations: [A] = 24.32 ; [B] = 0.5174 ; [Y] = 49.74 1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.95248 Formula used: [Y] / ([A][B]) 2. Ratio of forward/reverse reaction rates: 4 Discrepancy between the two values: 1.188 % Reaction IS in equilibrium (within 2% tolerance)
True
A, again the scarse limiting reagent, stops the reaction yet again
dynamics.set_single_conc(species_name="A", conc=0., snapshot=True) # Completely eliminate A
dynamics.describe_state()
SYSTEM STATE at Time t = 0.092781775: 3 species: Species 0 (A). Conc: 0.0 Species 1 (B). Conc: 0.5174262547179348 Species 2 (Y). Conc: 49.741286872641005 Set of chemicals involved in reactions: {'B', 'Y', 'A'}
dynamics.single_compartment_react(initial_step=0.001, target_end_time=0.16,
variable_steps=True)
19 total step(s) taken Number of step re-do's because of negative concentrations: 0 Number of step re-do's because of elective soft aborts: 0 Norm usage: {'norm_A': 9, 'norm_B': 10, 'norm_C': 9, 'norm_D': 9}
dynamics.plot_history(colors=['red', 'darkorange', 'green'],
title="Changes in concentrations (reaction A + 2 B <-> Y)")
dynamics.get_history()
SYSTEM TIME | A | B | Y | caption | |
---|---|---|---|---|---|
0 | 0.000000 | 5.000000 | 100.000000 | 0.000000 | Initialized state |
1 | 0.000300 | 3.800000 | 97.600000 | 1.200000 | |
2 | 0.000600 | 2.910608 | 95.821216 | 2.089392 | |
3 | 0.000900 | 2.242506 | 94.485013 | 2.757494 | |
4 | 0.001200 | 1.735641 | 93.471282 | 3.264359 | |
... | ... | ... | ... | ... | ... |
110 | 0.115432 | 1.744222 | 4.005870 | 47.997065 | |
111 | 0.121507 | 1.987812 | 4.493050 | 47.753475 | |
112 | 0.130619 | 2.207024 | 4.931475 | 47.534262 | |
113 | 0.144288 | 2.316339 | 5.150105 | 47.424947 | |
114 | 0.164791 | 2.304340 | 5.126107 | 47.436947 |
115 rows × 5 columns
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium()
0: A + 2 B <-> Y Final concentrations: [A] = 2.304 ; [B] = 5.126 ; [Y] = 47.44 1. Ratio of reactant/product concentrations, adjusted for reaction orders: 4.0159 Formula used: [Y] / ([A][B]) 2. Ratio of forward/reverse reaction rates: 4 Discrepancy between the two values: 0.3974 % Reaction IS in equilibrium (within 1% tolerance)
True
Le Chatelier's principle in action: "A change in one of the variables that describe a system at equilibrium produces a shift in the position of the equilibrium that counteracts the effect of this change."