U ("Up-regulator") up-regulates X , by sharing a reaction product D ("Drain") across 2 separate reactions:¶U <-> 2 D and X <-> D (both mostly forward)¶1st-order kinetics throughout.
Invoking Le Chatelier's principle, it can be seen that, starting from equilibrium, when [U] goes up, so does [D]; and when [D] goes up, so does [X].
Conversely, when [U] goes down, so does [D]; and when [D] goes down, so does [X].
LAST REVISED: June 23, 2024 (using v. 1.0 beta34.1)
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 'up_regulate_2.log.htm'
# Initialize the system
chem_data = chem(names=["U", "X", "D"])
# Reaction U <-> 2D , with 1st-order kinetics for all species
chem_data.add_reaction(reactants="U", products=[(2, "D", 1)],
forward_rate=8., reverse_rate=2.)
# Reaction X <-> D , with 1st-order kinetics for all species
chem_data.add_reaction(reactants="X", products="D",
forward_rate=6., reverse_rate=3.)
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: 2 (at temp. 25 C)
0: U <-> 2 D (kF = 8 / kR = 2 / delta_G = -3,436.6 / K = 4) | 1st order in all reactants & products
1: X <-> D (kF = 6 / kR = 3 / delta_G = -1,718.3 / K = 2) | 1st order in all reactants & products
Set of chemicals involved in the above reactions: {'X', 'U', 'D'}
[GRAPHIC ELEMENT SENT TO LOG FILE `up_regulate_2.log.htm`]
dynamics = UniformCompartment(chem_data=chem_data, preset = "fast")
dynamics.set_conc(conc={"U": 50., "X": 100.})
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 (D). Conc: 0.0
Set of chemicals involved in reactions: {'X', 'U', 'D'}
dynamics.set_diagnostics() # To save diagnostic information about the call to single_compartment_react()
dynamics.single_compartment_react(initial_step=0.03, target_end_time=0.5,
variable_steps=True, explain_variable_steps=False)
dynamics.get_history()
Some steps were backtracked and re-done, to prevent negative concentrations or excessively large concentration changes
42 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': 17, 'norm_C': 17, 'norm_D': 17}
| SYSTEM TIME | U | X | D | caption | |
|---|---|---|---|---|---|
| 0 | 0.000000 | 50.000000 | 100.000000 | 0.000000 | Initialized state |
| 1 | 0.002333 | 49.066880 | 98.600320 | 3.265920 | |
| 2 | 0.004199 | 48.346505 | 97.514534 | 5.792455 | |
| 3 | 0.006065 | 47.646316 | 96.455051 | 8.252317 | |
| 4 | 0.007932 | 46.965762 | 95.421204 | 10.647272 | |
| 5 | 0.009798 | 46.304308 | 94.412342 | 12.979043 | |
| 6 | 0.011664 | 45.661432 | 93.427831 | 15.249305 | |
| 7 | 0.013530 | 45.036628 | 92.467055 | 17.459688 | |
| 8 | 0.016330 | 44.125790 | 91.060592 | 20.687828 | |
| 9 | 0.018569 | 43.427897 | 89.976007 | 23.168198 | |
| 10 | 0.020809 | 42.753617 | 88.922661 | 25.570105 | |
| 11 | 0.023048 | 42.102175 | 87.899605 | 27.896044 | |
| 12 | 0.026407 | 41.158146 | 86.409082 | 31.274626 | |
| 13 | 0.029095 | 40.441377 | 85.267936 | 33.849309 | |
| 14 | 0.031782 | 39.753857 | 84.165948 | 36.326338 | |
| 15 | 0.034469 | 39.094431 | 83.101698 | 38.709439 | |
| 16 | 0.037157 | 38.461991 | 82.073822 | 41.002196 | |
| 17 | 0.041188 | 37.552211 | 80.584595 | 44.310983 | |
| 18 | 0.044413 | 36.869199 | 79.454040 | 46.807562 | |
| 19 | 0.047638 | 36.219910 | 78.369514 | 49.190667 | |
| 20 | 0.050863 | 35.602742 | 77.329027 | 51.465488 | |
| 21 | 0.055700 | 34.722882 | 75.831509 | 54.722726 | |
| 22 | 0.059570 | 34.071443 | 74.706080 | 57.151033 | |
| 23 | 0.063439 | 33.458967 | 73.634974 | 59.447093 | |
| 24 | 0.069244 | 32.595350 | 72.105604 | 62.703696 | |
| 25 | 0.073888 | 31.966786 | 70.970090 | 65.096338 | |
| 26 | 0.078532 | 31.383796 | 69.899547 | 67.332862 | |
| 27 | 0.085498 | 30.572955 | 68.385212 | 70.468877 | |
| 28 | 0.091070 | 29.995382 | 67.276804 | 72.732432 | |
| 29 | 0.099429 | 29.205486 | 65.726543 | 75.862484 | |
| 30 | 0.106116 | 28.657688 | 64.611327 | 78.073296 | |
| 31 | 0.116147 | 27.924301 | 63.072149 | 81.079249 | |
| 32 | 0.124171 | 27.432914 | 61.987277 | 83.146895 | |
| 33 | 0.136208 | 26.792927 | 60.512982 | 85.901165 | |
| 34 | 0.148245 | 26.280871 | 59.244618 | 88.193640 | |
| 35 | 0.166300 | 25.669531 | 57.603648 | 91.057291 | |
| 36 | 0.180744 | 25.333826 | 56.557174 | 92.775174 | |
| 37 | 0.202410 | 24.962896 | 55.235160 | 94.839047 | |
| 38 | 0.234909 | 24.637090 | 53.711149 | 97.014671 | |
| 39 | 0.283658 | 24.487559 | 52.189072 | 98.835810 | |
| 40 | 0.356781 | 24.617071 | 50.973253 | 99.792605 | |
| 41 | 0.466466 | 24.907587 | 50.264503 | 99.920324 | |
| 42 | 0.630993 | 25.003005 | 49.964069 | 100.029921 |
dynamics.explain_time_advance()
From time 0 to 0.002333, in 1 step of 0.00233 From time 0.002333 to 0.01353, in 6 steps of 0.00187 From time 0.01353 to 0.01633, in 1 step of 0.0028 From time 0.01633 to 0.02305, in 3 steps of 0.00224 From time 0.02305 to 0.02641, in 1 step of 0.00336 From time 0.02641 to 0.03716, in 4 steps of 0.00269 From time 0.03716 to 0.04119, in 1 step of 0.00403 From time 0.04119 to 0.05086, in 3 steps of 0.00322 From time 0.05086 to 0.0557, in 1 step of 0.00484 From time 0.0557 to 0.06344, in 2 steps of 0.00387 From time 0.06344 to 0.06924, in 1 step of 0.0058 From time 0.06924 to 0.07853, in 2 steps of 0.00464 From time 0.07853 to 0.0855, in 1 step of 0.00697 From time 0.0855 to 0.09107, in 1 step of 0.00557 From time 0.09107 to 0.09943, in 1 step of 0.00836 From time 0.09943 to 0.1061, in 1 step of 0.00669 From time 0.1061 to 0.1161, in 1 step of 0.01 From time 0.1161 to 0.1242, in 1 step of 0.00802 From time 0.1242 to 0.1482, in 2 steps of 0.012 From time 0.1482 to 0.1663, in 1 step of 0.0181 From time 0.1663 to 0.1807, in 1 step of 0.0144 From time 0.1807 to 0.2024, in 1 step of 0.0217 From time 0.2024 to 0.2349, in 1 step of 0.0325 From time 0.2349 to 0.2837, in 1 step of 0.0487 From time 0.2837 to 0.3568, in 1 step of 0.0731 From time 0.3568 to 0.4665, in 1 step of 0.11 From time 0.4665 to 0.631, in 1 step of 0.165 (42 steps total)
dynamics.plot_history(colors=['red', 'green', 'gray'])
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium()
0: U <-> 2 D
Final concentrations: [U] = 25 ; [D] = 100
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 4.00072
Formula used: [D] / [U]
2. Ratio of forward/reverse reaction rates: 4
Discrepancy between the two values: 0.0179 %
Reaction IS in equilibrium (within 1% tolerance)
1: X <-> D
Final concentrations: [X] = 49.96 ; [D] = 100
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 2.00204
Formula used: [D] / [X]
2. Ratio of forward/reverse reaction rates: 2
Discrepancy between the two values: 0.1019 %
Reaction IS in equilibrium (within 1% tolerance)
True
dynamics.set_single_conc(species_name="U", conc=70., snapshot=True)
dynamics.describe_state()
SYSTEM STATE at Time t = 0.63099291:
3 species:
Species 0 (U). Conc: 70.0
Species 1 (X). Conc: 49.96406885180444
Species 2 (D). Conc: 100.02992131107243
Set of chemicals involved in reactions: {'X', 'U', 'D'}
dynamics.get_history(tail=3)
| SYSTEM TIME | U | X | D | caption | |
|---|---|---|---|---|---|
| 41 | 0.466466 | 24.907587 | 50.264503 | 99.920324 | |
| 42 | 0.630993 | 25.003005 | 49.964069 | 100.029921 | |
| 43 | 0.630993 | 70.000000 | 49.964069 | 100.029921 | Set concentration of `U` |
dynamics.single_compartment_react(initial_step=0.03, target_end_time=1,
variable_steps=True)
Some steps were backtracked and re-done, to prevent negative concentrations or excessively large concentration changes
24 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: 9
Norm usage: {'norm_A': 51, 'norm_B': 28, 'norm_C': 28, 'norm_D': 28}
#dynamics.get_history()
#dynamics.explain_time_advance()
dynamics.plot_history(colors=['red', 'green', 'gray'])
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium(tolerance=2)
0: U <-> 2 D
Final concentrations: [U] = 36.7 ; [D] = 145.3
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.9596
Formula used: [D] / [U]
2. Ratio of forward/reverse reaction rates: 4
Discrepancy between the two values: 1.01 %
Reaction IS in equilibrium (within 2% tolerance)
1: X <-> D
Final concentrations: [X] = 71.31 ; [D] = 145.3
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 2.03768
Formula used: [D] / [X]
2. Ratio of forward/reverse reaction rates: 2
Discrepancy between the two values: 1.884 %
Reaction IS in equilibrium (within 2% tolerance)
True
dynamics.set_single_conc(species_name="U", conc=100., snapshot=True)
dynamics.describe_state()
SYSTEM STATE at Time t = 1.0692249:
3 species:
Species 0 (U). Conc: 100.0
Species 1 (X). Conc: 71.30574896594584
Species 2 (D). Conc: 145.29798215919604
Set of chemicals involved in reactions: {'X', 'U', 'D'}
dynamics.get_history(tail=3)
| SYSTEM TIME | U | X | D | caption | |
|---|---|---|---|---|---|
| 66 | 0.977392 | 37.441093 | 69.408954 | 145.702851 | |
| 67 | 1.069225 | 36.695130 | 71.305749 | 145.297982 | |
| 68 | 1.069225 | 100.000000 | 71.305749 | 145.297982 | Set concentration of `U` |
dynamics.single_compartment_react(initial_step=0.03, target_end_time=1.6,
variable_steps=True)
Some steps were backtracked and re-done, to prevent negative concentrations or excessively large concentration changes
34 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: 14
Norm usage: {'norm_A': 81, 'norm_B': 44, 'norm_C': 44, 'norm_D': 44}
#dynamics.get_history()
#dynamics.explain_time_advance()
dynamics.plot_history(colors=['red', 'green', 'gray'])
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium()
0: U <-> 2 D
Final concentrations: [U] = 52.11 ; [D] = 208.3
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.99727
Formula used: [D] / [U]
2. Ratio of forward/reverse reaction rates: 4
Discrepancy between the two values: 0.06828 %
Reaction IS in equilibrium (within 1% tolerance)
1: X <-> D
Final concentrations: [X] = 104.1 ; [D] = 208.3
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 2.00191
Formula used: [D] / [X]
2. Ratio of forward/reverse reaction rates: 2
Discrepancy between the two values: 0.09565 %
Reaction IS in equilibrium (within 1% tolerance)
True
dynamics.set_single_conc(species_name="U", conc=5., snapshot=True)
dynamics.describe_state()
SYSTEM STATE at Time t = 1.6922388:
3 species:
Species 0 (U). Conc: 5.0
Species 1 (X). Conc: 104.05849412376946
Species 2 (D). Conc: 208.31604776017218
Set of chemicals involved in reactions: {'X', 'U', 'D'}
dynamics.get_history(tail=3)
| SYSTEM TIME | U | X | D | caption | |
|---|---|---|---|---|---|
| 101 | 1.555133 | 52.537879 | 102.920098 | 208.607876 | |
| 102 | 1.692239 | 52.114595 | 104.058494 | 208.316048 | |
| 103 | 1.692239 | 5.000000 | 104.058494 | 208.316048 | Set concentration of `U` |
dynamics.single_compartment_react(initial_step=0.03, target_end_time=2.3,
variable_steps=True)
Some steps were backtracked and re-done, to prevent negative concentrations or excessively large concentration changes
27 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: 18
Norm usage: {'norm_A': 102, 'norm_B': 57, 'norm_C': 57, 'norm_D': 57}
#dynamics.get_history()
#dynamics.explain_time_advance()
dynamics.plot_history(colors=['red', 'green', 'gray'])
# Verify that the reaction has reached equilibrium
dynamics.is_in_equilibrium(explain=False)
True