A down-regulates B , by being the limiting reagent in reaction 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.
Single-bin reaction
Based on experiment reactions_single_compartment/down_regulate_2
LAST_REVISED = "May 4, 2025"
LIFE123_VERSION = "1.0.0rc3" # Library version this experiment is based on
#import set_path # Using MyBinder? Uncomment this before running the next cell!
#import sys, os
#os.getcwd()
#sys.path.append("C:/some_path/my_env_or_install") # CHANGE to the folder containing your venv or libraries installation!
# NOTE: If any of the imports below can't find a module, uncomment the lines above, or try: import set_path
from experiments.get_notebook_info import get_notebook_basename
from life123 import ChemData, UniformCompartment, BioSim1D, GraphicLog, check_version
check_version(LIFE123_VERSION)
OK
# 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_regulation_1.log.htm'
# Initialize the system. NOTE: Diffusion not applicable (just 1 bin)
chem_data = ChemData(names=["A", "B", "Y"], plot_colors=['red', 'darkorange', 'green'])
uc = UniformCompartment(chem_data=chem_data)
# Reaction A + 2 B <-> Y , with 1st-order kinetics for all chemical species
uc.add_reaction(reactants=["A", (2, "B", 1)], products="Y",
forward_rate=8., reverse_rate=2.)
uc.describe_reactions()
# Send the plot of the reaction network to the HTML log file
uc.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: {"A" (red), "B" (darkorange), "Y" (green)}
[GRAPHIC ELEMENT SENT TO LOG FILE `down_regulation_1.log.htm`]
bio = BioSim1D(n_bins=1, reaction_handler=uc)
bio.set_uniform_concentration(chem_label="A", conc=5.) # Scarce
bio.set_uniform_concentration(chem_label="B", conc=100.) # Plentiful
# Initially, no "Y" is present
bio.describe_state()
SYSTEM STATE at Time t = 0: 1 bins and 3 chemical species:
| Species | Diff rate | Bin 0 | |
|---|---|---|---|
| 0 | A | None | 5.0 |
| 1 | B | None | 100.0 |
| 2 | Y | None | 0.0 |
# Let's enable history - by default for all chemicals and all bins (we're only using one)
bio.enable_history(take_snapshot=True, caption="Initial setup")
History enabled for bins None and chemicals None (None means 'all')
bio.get_bin_history(bin_address=0)
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.0 | 5.0 | 100.0 | 0.0 | Initial setup |
bio.react(time_step=0.0005, n_steps=30)
bio.describe_state()
System Time is now: 0.015 SYSTEM STATE at Time t = 0.015: 1 bins and 3 chemical species:
| Species | Diff rate | Bin 0 | |
|---|---|---|---|
| 0 | A | None | 0.013852 |
| 1 | B | None | 90.027705 |
| 2 | Y | None | 4.986148 |
bio.get_bin_history(bin_address=0)
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.0000 | 5.000000 | 100.000000 | 0.000000 | Initial setup |
| 1 | 0.0005 | 3.000000 | 96.000000 | 2.000000 | |
| 2 | 0.0010 | 1.850000 | 93.700000 | 3.150000 | |
| 3 | 0.0015 | 1.159770 | 92.319540 | 3.840230 | |
| 4 | 0.0020 | 0.735332 | 91.470665 | 4.264668 | |
| 5 | 0.0025 | 0.470552 | 90.941104 | 4.529448 | |
| 6 | 0.0030 | 0.303911 | 90.607822 | 4.696089 | |
| 7 | 0.0035 | 0.198460 | 90.396921 | 4.801540 | |
| 8 | 0.0040 | 0.131501 | 90.263002 | 4.868499 | |
| 9 | 0.0045 | 0.088891 | 90.177782 | 4.911109 | |
| 10 | 0.0050 | 0.061738 | 90.123476 | 4.938262 | |
| 11 | 0.0055 | 0.044420 | 90.088840 | 4.955580 | |
| 12 | 0.0060 | 0.033369 | 90.066737 | 4.966631 | |
| 13 | 0.0065 | 0.026314 | 90.052627 | 4.973686 | |
| 14 | 0.0070 | 0.021809 | 90.043618 | 4.978191 | |
| 15 | 0.0075 | 0.018932 | 90.037864 | 4.981068 | |
| 16 | 0.0080 | 0.017095 | 90.034189 | 4.982905 | |
| 17 | 0.0085 | 0.015921 | 90.031842 | 4.984079 | |
| 18 | 0.0090 | 0.015172 | 90.030343 | 4.984828 | |
| 19 | 0.0095 | 0.014693 | 90.029386 | 4.985307 | |
| 20 | 0.0100 | 0.014387 | 90.028774 | 4.985613 | |
| 21 | 0.0105 | 0.014192 | 90.028383 | 4.985808 | |
| 22 | 0.0110 | 0.014067 | 90.028134 | 4.985933 | |
| 23 | 0.0115 | 0.013987 | 90.027974 | 4.986013 | |
| 24 | 0.0120 | 0.013936 | 90.027872 | 4.986064 | |
| 25 | 0.0125 | 0.013904 | 90.027807 | 4.986096 | |
| 26 | 0.0130 | 0.013883 | 90.027766 | 4.986117 | |
| 27 | 0.0135 | 0.013870 | 90.027739 | 4.986130 | |
| 28 | 0.0140 | 0.013861 | 90.027722 | 4.986139 | |
| 29 | 0.0145 | 0.013856 | 90.027711 | 4.986144 | |
| 30 | 0.0150 | 0.013852 | 90.027705 | 4.986148 |
A, as the scarse limiting reagent, stops the reaction.
When A is low, B is also low.
# Verify that the reaction has reached equilibrium
bio.reaction_dynamics.is_in_equilibrium(conc=bio.bin_snapshot(bin_address = 0))
0: A + 2 B <-> Y
Current concentrations: [A] = 0.01385 ; [B] = 90.03 ; [Y] = 4.986
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.99823
Formula used: [Y] / ([A][B])
2. Ratio of forward/reverse reaction rates: 4
Discrepancy between the two values: 0.0443 %
Reaction IS in equilibrium (within 1% tolerance)
True
bio.plot_history_single_bin(bin_address=0,
title="Reaction A + 2 B <-> Y . Concentrations at bin 0")
bio.set_bin_conc(bin_address=0, chem_index=0, conc=40.)
bio.describe_state()
SYSTEM STATE at Time t = 0.015: 1 bins and 3 chemical species:
| Species | Diff rate | Bin 0 | |
|---|---|---|---|
| 0 | A | None | 40.000000 |
| 1 | B | None | 90.027705 |
| 2 | Y | None | 4.986148 |
bio.capture_snapshot(caption="[A] suddenly increased externally")
bio.get_bin_history(bin_address=0)
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.0000 | 5.000000 | 100.000000 | 0.000000 | Initial setup |
| 1 | 0.0005 | 3.000000 | 96.000000 | 2.000000 | |
| 2 | 0.0010 | 1.850000 | 93.700000 | 3.150000 | |
| 3 | 0.0015 | 1.159770 | 92.319540 | 3.840230 | |
| 4 | 0.0020 | 0.735332 | 91.470665 | 4.264668 | |
| 5 | 0.0025 | 0.470552 | 90.941104 | 4.529448 | |
| 6 | 0.0030 | 0.303911 | 90.607822 | 4.696089 | |
| 7 | 0.0035 | 0.198460 | 90.396921 | 4.801540 | |
| 8 | 0.0040 | 0.131501 | 90.263002 | 4.868499 | |
| 9 | 0.0045 | 0.088891 | 90.177782 | 4.911109 | |
| 10 | 0.0050 | 0.061738 | 90.123476 | 4.938262 | |
| 11 | 0.0055 | 0.044420 | 90.088840 | 4.955580 | |
| 12 | 0.0060 | 0.033369 | 90.066737 | 4.966631 | |
| 13 | 0.0065 | 0.026314 | 90.052627 | 4.973686 | |
| 14 | 0.0070 | 0.021809 | 90.043618 | 4.978191 | |
| 15 | 0.0075 | 0.018932 | 90.037864 | 4.981068 | |
| 16 | 0.0080 | 0.017095 | 90.034189 | 4.982905 | |
| 17 | 0.0085 | 0.015921 | 90.031842 | 4.984079 | |
| 18 | 0.0090 | 0.015172 | 90.030343 | 4.984828 | |
| 19 | 0.0095 | 0.014693 | 90.029386 | 4.985307 | |
| 20 | 0.0100 | 0.014387 | 90.028774 | 4.985613 | |
| 21 | 0.0105 | 0.014192 | 90.028383 | 4.985808 | |
| 22 | 0.0110 | 0.014067 | 90.028134 | 4.985933 | |
| 23 | 0.0115 | 0.013987 | 90.027974 | 4.986013 | |
| 24 | 0.0120 | 0.013936 | 90.027872 | 4.986064 | |
| 25 | 0.0125 | 0.013904 | 90.027807 | 4.986096 | |
| 26 | 0.0130 | 0.013883 | 90.027766 | 4.986117 | |
| 27 | 0.0135 | 0.013870 | 90.027739 | 4.986130 | |
| 28 | 0.0140 | 0.013861 | 90.027722 | 4.986139 | |
| 29 | 0.0145 | 0.013856 | 90.027711 | 4.986144 | |
| 30 | 0.0150 | 0.013852 | 90.027705 | 4.986148 | |
| 31 | 0.0150 | 40.000000 | 90.027705 | 4.986148 | [A] suddenly increased externally |
bio.react(time_step=0.0005, n_steps=80)
bio.describe_state()
System Time is now: 0.055 SYSTEM STATE at Time t = 0.055: 1 bins and 3 chemical species:
| Species | Diff rate | Bin 0 | |
|---|---|---|---|
| 0 | A | None | 0.979974 |
| 1 | B | None | 11.987653 |
| 2 | Y | None | 44.006174 |
bio.get_bin_history(bin_address=0)
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.0000 | 5.000000 | 100.000000 | 0.000000 | Initial setup |
| 1 | 0.0005 | 3.000000 | 96.000000 | 2.000000 | |
| 2 | 0.0010 | 1.850000 | 93.700000 | 3.150000 | |
| 3 | 0.0015 | 1.159770 | 92.319540 | 3.840230 | |
| 4 | 0.0020 | 0.735332 | 91.470665 | 4.264668 | |
| ... | ... | ... | ... | ... | ... |
| 107 | 0.0530 | 0.993822 | 12.015349 | 43.992326 | |
| 108 | 0.0535 | 0.990050 | 12.007805 | 43.996098 | |
| 109 | 0.0540 | 0.986493 | 12.000690 | 43.999655 | |
| 110 | 0.0545 | 0.983138 | 11.993981 | 44.003010 | |
| 111 | 0.0550 | 0.979974 | 11.987653 | 44.006174 |
112 rows × 5 columns
# Verify that the reaction has reached equilibrium
bio.reaction_dynamics.is_in_equilibrium(conc=bio.bin_snapshot(bin_address = 0), tolerance=7)
0: A + 2 B <-> Y
Current concentrations: [A] = 0.98 ; [B] = 11.99 ; [Y] = 44.01
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.74597
Formula used: [Y] / ([A][B])
2. Ratio of forward/reverse reaction rates: 4
Discrepancy between the two values: 6.351 %
Reaction IS in equilibrium (within 7% tolerance)
True
bio.plot_history_single_bin(bin_address=0,
title="Reaction A + 2 B <-> Y . Concentrations at bin 0")
A, still the limiting reagent, is again stopping the reaction.
The (transiently) high value of [A] led to a high value of [B]
bio.set_bin_conc(bin_address=0, chem_index=0, conc=30.)
bio.describe_state()
SYSTEM STATE at Time t = 0.055: 1 bins and 3 chemical species:
| Species | Diff rate | Bin 0 | |
|---|---|---|---|
| 0 | A | None | 30.000000 |
| 1 | B | None | 11.987653 |
| 2 | Y | None | 44.006174 |
bio.capture_snapshot(caption="[A] again suddenly increased externally")
bio.get_bin_history(bin_address=0)
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.0000 | 5.000000 | 100.000000 | 0.000000 | Initial setup |
| 1 | 0.0005 | 3.000000 | 96.000000 | 2.000000 | |
| 2 | 0.0010 | 1.850000 | 93.700000 | 3.150000 | |
| 3 | 0.0015 | 1.159770 | 92.319540 | 3.840230 | |
| 4 | 0.0020 | 0.735332 | 91.470665 | 4.264668 | |
| ... | ... | ... | ... | ... | ... |
| 108 | 0.0535 | 0.990050 | 12.007805 | 43.996098 | |
| 109 | 0.0540 | 0.986493 | 12.000690 | 43.999655 | |
| 110 | 0.0545 | 0.983138 | 11.993981 | 44.003010 | |
| 111 | 0.0550 | 0.979974 | 11.987653 | 44.006174 | |
| 112 | 0.0550 | 30.000000 | 11.987653 | 44.006174 | [A] again suddenly increased externally |
113 rows × 5 columns
bio.react(time_step=0.0005, n_steps=70)
bio.describe_state()
System Time is now: 0.09 SYSTEM STATE at Time t = 0.09: 1 bins and 3 chemical species:
| Species | Diff rate | Bin 0 | |
|---|---|---|---|
| 0 | A | None | 24.262454 |
| 1 | B | None | 0.512561 |
| 2 | Y | None | 49.743720 |
bio.get_bin_history(bin_address=0)
| SYSTEM TIME | A | B | Y | caption | |
|---|---|---|---|---|---|
| 0 | 0.0000 | 5.000000 | 100.000000 | 0.000000 | Initial setup |
| 1 | 0.0005 | 3.000000 | 96.000000 | 2.000000 | |
| 2 | 0.0010 | 1.850000 | 93.700000 | 3.150000 | |
| 3 | 0.0015 | 1.159770 | 92.319540 | 3.840230 | |
| 4 | 0.0020 | 0.735332 | 91.470665 | 4.264668 | |
| ... | ... | ... | ... | ... | ... |
| 178 | 0.0880 | 24.262455 | 0.512563 | 49.743718 | |
| 179 | 0.0885 | 24.262455 | 0.512562 | 49.743719 | |
| 180 | 0.0890 | 24.262454 | 0.512562 | 49.743719 | |
| 181 | 0.0895 | 24.262454 | 0.512561 | 49.743720 | |
| 182 | 0.0900 | 24.262454 | 0.512561 | 49.743720 |
183 rows × 5 columns
# Verify that the reaction has reached equilibrium
bio.reaction_dynamics.is_in_equilibrium(conc=bio.bin_snapshot(bin_address = 0))
0: A + 2 B <-> Y
Current concentrations: [A] = 24.26 ; [B] = 0.5126 ; [Y] = 49.74
1. Ratio of reactant/product concentrations, adjusted for reaction orders: 3.99999
Formula used: [Y] / ([A][B])
2. Ratio of forward/reverse reaction rates: 4
Discrepancy between the two values: 0.0003695 %
Reaction IS in equilibrium (within 1% tolerance)
True
bio.plot_history_single_bin(bin_address=0,
title="Reaction A + 2 B <-> Y . Concentrations at bin 0")
A, again the scarse limiting reagent, stops the reaction yet again
Note: A can down-regulate B, but it cannot bring it up.