# 1. Electrical capacitance and energy of the mitochondrial inner membrane

A capacitor is an electrical circuit element that stores electrical energy in an electric field (Wikipedia REF). The mitochondrial inner membrane acts as an electrical capacitor to store energy in an electrostatic potential different between the milieu on the two sides the membrane.

Electrical capacitance is measured in units of charge per unit voltage, or in standard units, Coulombs per Volt (C/V), equivalently, a Farad. (1 F = 1 C/V)

```python

```

## 1.1. What is the capacitance of mitochondrial inner membrane? Make a reasonable assumption about the size of a mitochondrion and assume that the inner membrane has 5 or 10 times more area than the outer membrane.

A typical range for the capacity density of a biological membrane is 0.5-1.0 $\mu$F cm$^{-2}$ [REF]. Let’s take a mitochondrion as a sphere with radius 1  $\mu$m. In this case the outer membrane would have a surface area of $4\pi r^2$, or approximately 12.5  $\mu$m$^2$. If the inner membrane has 10 times more area than the outer, then the area of the inner membrane is 125 $\mu$m$^2$. So, we can approximate the capacitance of this mitochondrion’s inner membrane as

$$
  c_{mito} = \left( 1 \frac{\mu{\rm F}} {{\rm cm}^2} \right)
             \left(  125 \, \mu{\rm m}^2  \right)
             \left( \frac{ 1 \, {\rm cm}^2} {10^8 \mu{\rm m}^2} \right) =
             1.25 \times 10^{-6} \mu{\rm F} .
$$

## 1.2. Express inner mitochondrial membrane capacitance in units of: (a.) farads per liter of mitochondria; (b.) moles per millivolt per unit liter of mitochondria.

Note that for a spherical mitochondrion of radius 1 $\mu$m, we have a volume of
\begin{equation}
    \Bigg(\frac{4}{3}\pi (1\mu\rm{m})^3\Bigg) \Bigg(\frac{1 \ \rm{cm}}{10^4 \ \mu\rm{m}}\Bigg)^3 \Bigg(\frac{1 \ \rm{mL}}{1 \ \rm{cm}^3} \Bigg) \Bigg(\frac{1 \ \rm{L}}{10^3 \ \rm{mL}}\Bigg) = \frac{4}{3}\pi \times 10^{-15} \ \rm{L}.
\end{equation}
Dividing the capacitance by the volume gives
\begin{equation}
    \Bigg(\frac{1.25 \times 10^{-6} \ \mu\rm{F}}{\frac{4}{3}\pi \times 10^{-15} \ \rm{L}} \Bigg) \Bigg( \frac{1 \ \rm{F}}{10^6 \ \mu\rm{F}} \Bigg) = 2.98 \times 10^2 \frac{\rm{F}}{\rm{L}} \approx 300 \frac{\rm{F}}{\rm{L}} = 300 \frac{\rm{C}}{\rm{V}\cdot \rm{L}} = 0.3 \frac{\rm{C}}{\rm{mV} \cdot \rm{L}}.
\end{equation}
Converting untis gives
\begin{equation}
    \Bigg( 300 \frac{\rm{F}}{\rm{L}} \Bigg) \Bigg(\frac{1 \ \frac{\rm{C}}{\rm{V}}}{1 \ \rm{F}} \Bigg) \Bigg( \frac{1 \ \rm{V}}{10^3 \ \rm{mV}} \Bigg) \Bigg( \frac{1 \ \rm{mol}}{96485 \ \rm{C}} \Bigg) = 3.11 \times 10^{-6} \frac{\rm{mol}}{\rm{mV} \cdot \rm{L}}
\end{equation}

## 1.3. If the electrostatic potential across the inner mitochondrial membrane is 180 mV, how much electrical energy per unit volume is stored in mitochondria? How much electrical energy is stored in mitochondria per unit volume of myocardium? Express your answer in joules per liter.

The potential $U$ stored on a capacitor is given by
\begin{equation}
    U = \frac{1}{2} c \Delta \Psi^2,
\end{equation}
where $c$ is the capacitance and $\Delta\Psi$ is the voltage gradient across the membrane. Then the energy per unit volume of mitochondria is
\begin{equation}
    U_{mito} = \frac{1}{2} c_{mito} \Delta \Psi^2 = \frac{1}{2} \Bigg(0.3 \ \frac{\rm{C}}{\rm{mV} \cdot \rm{L}} \Bigg) (180 \ \rm{mV})^2 = 4.86 \times 10^3 \ \frac{\rm{C} \cdot \rm{mV}}{\rm{L}} = 4.86 \ \frac{\rm{C} \cdot \rm{V}}{\rm{L}} = 4.86 \frac{\rm{J}}{\rm{L}} \approx 5 \ \frac{\rm{J}}{\rm{L}}.
\end{equation}
Since approximately 1/3 of the volume of myocardium is mitochondria, the energy stored in the myocardium is 5/3 J L$^{-1}$.

## 1.4. Approximately much electrical energy is stored in mitochondria in the whole human heart? How does that compare to the amount of energy supplied by a AA battery? How does it compare to the amount of mechanical work the heart does per unit time?

An average human heart is approximately 250 g. In L, that is
\begin{equation}
    250 g \Bigg( \frac{1 \ \rm{L}}{10^3 \ \rm{g}} \Bigg) = 0.25\ \rm{L}.
\end{equation}
Then,
\begin{equation}
    \Bigg(\frac{5}{3} \ \frac{\rm{J}}{\rm{L}} \Bigg) \Bigg(\frac{1}{4} \ \rm{L} \Bigg) = \frac{5}{12} \ \rm{J}
\end{equation}
of energy is stored in the inner membrane of the mitochondria.

A typical AA battery contains 0.0039 kWH = 14 kJ. The LV typically does 1 W of work at baseline, that is, 1 W = 1 J s$^{-1}$.

Another comparison: the LV does approximately 1 watt of work under resting baseline conditions. That is: 1 W = 1 joule / second. The $1/4$ joule of electrical energy stored in the inner mitochodondrial membrane is equivalent to how much mechanical work the heart does at rest in $1/4$ second.

# 2. Converting electrical potential to the ATP hydrolysis chemical potential

The electrostatic energy potential across the mitochondrial inner membrane is used to drive the synthesis of ATP in the final step of oxidative ATP synthesis. The mammalian mitochondrial F$_1$F$_0$-ATPase synthesizes ATP in the mitochondrial matrix from ADP and inorganic phosphate, coupled to the translocation of protons (H$^{+}$ ions) from outside to inside of the matrix. The chemical reaction stoichiometry can be expressed as

\begin{equation}
	\mathrm{MgADP}^{1-} + \mathrm{HPO}_4^{2-} + (\mathrm{H}^+)_\mathrm{inside} \leftrightharpoons
    \mathrm{MgATP}^{2-} + \mathrm{H}_2\mathrm{O},
\end{equation}

where the term $(\mathrm{H}^+)_\mathrm{inside}$ indicates that a hydrogen ion from inside the matrix is covalently incorporated into the synthesized ATP. The species MgADP$^{1-}$ and MgATP$^{2-}$ are the magnesium-bound species of ADP and ATP. This chemical reaction is coupled to the transport of $n_A = 8/3$ protons across the inner membrane:

\begin{equation}
    n_A \, (\mathrm{H}^+)_\mathrm{outside} \leftrightharpoons n_A \, (\mathrm{H}^+)_\mathrm{inside}.
\end{equation}

## 2.1. Given a free magnesium concentration [Mg$^{2+}$] and hydrogen ion activity [H$^+$] = 10$^{\rm -pH}$, how can you compute the concentrations of MgADP$^{1-}$, MgATP$^{2-}$, and HPO$_4^{2-}$ in terms of the total concentrations of the reactants [$\Sigma$ADP], [$\Sigma$ATP], and [$\Sigma$Pi]? (You will need to account for binding of biochemical species to [Mg$^{2+}$] and [H$^+$].)

To determine the total measurable ATP, we must consider each cation species and their dissociation. The dissociation constants of ATP from each cation species are
\begin{align}
    \rm{MgATP}^{2-} \rightleftharpoons \rm{Mg}^{2+} + \rm{ATP}^{4-} \quad &\Rightarrow \quad K_{\rm{MgATP}} = \frac{[\rm{Mg}^{2+}] [\rm{ATP}^{4-}]}{[\rm{MgATP}^{2-}]} \\
    \rm{HATP}^{3-} \rightleftharpoons \rm{H}^{+} + \rm{ATP}^{4-} \quad &\Rightarrow \quad K_{\rm{HATP}} = \frac{[\rm{H}^{+}] [\rm{ATP}^{4-}]}{[\rm{HATP}^{3-}]} \\
    \rm{KATP}^{3-} \rightleftharpoons \rm{K}^{+} + \rm{ATP}^{4-} \quad &\Rightarrow \quad K_{\rm{KATP}} = \frac{[\rm{K}^{+}] [\rm{ATP}^{4-}]}{[\rm{KATP}^{3-}]}.
\end{align}
Note: we disregard the doubly bound cation species in these calculations. Then, the total measurable ATP is
\begin{eqnarray}
  [\Sigma{\rm ATP}] & = & [{\rm ATP}^{4-}] + [{\rm Mg}\cdot{\rm ATP}^{2-}] +
                          [{\rm H}\cdot{\rm ATP}^{3-}] + [{\rm K}\cdot{\rm ATP}^{3-}] \\
                    & = & [{\rm ATP}^{4-}]  + \frac{[{\rm Mg}^{2+}]}{K_\mathrm{MgATP}}[{\rm ATP}^{4-}]  +
                          \frac{[{\rm H}^{+}]}{K_\mathrm{HATP}}[{\rm ATP}^{4-}] +
                          \frac{[{\rm K}^{+}]}{K_\mathrm{KATP}}[{\rm ATP}^{4-}]  \\
                    & = & [{\rm ATP}^{4-}]\left(1 + \frac{[{\rm Mg}^{2+}]}{K_\mathrm{MgATP}} +
                          \frac{[{\rm H}^{+}]}{K_\mathrm{HATP}} + \frac{[{\rm K}^{+}]}{K_\mathrm{KATP}} \right) \\
                          & = & [\mathrm{ATP}^{4-}] P_{\mathrm{ATP}},
\end{eqnarray}
where we can define something called the *binding polynomial*, $P_\mathrm{ATP}$, that is,
\begin{equation}
  P_{ATP} =  1 + \frac{[{\rm Mg}^{2+}]}{K_\mathrm{MgATP}} +
                     \frac{[{\rm H}^{+}]}{K_\mathrm{HATP}} + \frac{[{\rm K}^{+}]}{K_\mathrm{KATP}}.
\end{equation}
Similarly, we can define binding polynomials for the other species as
\begin{eqnarray}
  P_\mathrm{ADP} & = & 1 + \frac{[{\rm Mg}^{2+}]}{K_\mathrm{MgADP}} +
                     \frac{[{\rm H}^{+}]}{K_\mathrm{HADP}} + \frac{[{\rm K}^{+}]}{K_\mathrm{KADP}} \quad \text{and} \\
  P_\mathrm{Pi}  & = & 1 + \frac{[{\rm Mg}^{2+}]}{K_\mathrm{MgPi}} +
                     \frac{[{\rm H}^{+}]}{K_\mathrm{HPi}} + \frac{[{\rm K}^{+}]}{K_\mathrm{KPi}}.
\end{eqnarray}
Then, the total measurable concentrations are
\begin{eqnarray}
  [\Sigma{\rm ATP}] & = & [{\rm ATP}^{4-}] P_\mathrm{ATP} \\
  [\Sigma{\rm ADP}] & = & [{\rm ADP}^{3-}] P_\mathrm{ADP} \\
  [\Sigma{\rm Pi}] & = & [{\rm HPO}_4^{2-}] P_\mathrm{Pi} \, .
\end{eqnarray}

Furthermore
\begin{eqnarray}
  [{\rm Mg}\cdot{\rm ATP}^{2-}] & = & \frac{[{\rm Mg}^{2+}]/K_\mathrm{MgATP}}{P_\mathrm{ATP}}[\Sigma{\rm ATP}] \\
  [{\rm Mg}\cdot{\rm ADP}^{1-}] & = & \frac{[{\rm Mg}^{2+}]/K_\mathrm{MgADP}}{P_\mathrm{ADP}}[\Sigma{\rm ADP}] \\
  [{\rm HPO}_4^{2-}] & = & \frac{1}{P_\mathrm{Pi}}[\Sigma{\rm Pi}] \\
\end{eqnarray}

## 2.2. Derive an expression for the Gibbs free energy change associated with reaction (2.1) in terms of the reference $\Delta G_r^0$, the concentrations of biochemical reactants, and the cation concentrations [Mg$^{2+}$] and [H$^+$]. What is the free energy of ATP hydrolysis in the mitochondrial matrix? Assume that pH = 7.2 and [$\Sigma$ADP] = 9.5 mM, [$\Sigma$ATP] = 0.5 mM, and [$\Sigma$Pi] = 1 mM.

To determine the Gibbs energy of the ATP synthesis reaction, consider the ATP synthesis reaction
$$
  \rm ADP^{3-} + HPO_4^{2-} + H^+ \rightleftharpoons ATP^{4-} + H_2O \, ,
$$
with equilibrium mass action ratio
$$
  K_{eq} = e^{-\Delta G_\mathrm{ATP}^0 / RT} = \left( \frac{[{\rm ATP}^{4-}]}
        {[{\rm H}^+][{\rm HPO}_4^{2-}][{\rm ADP}^{3-}]} \right)_{eq} ,
$$
where $\Delta G_\mathrm{ATP}^0$ is the change in Gibbs energy under standard conditions. Substituting the expressions for the binding polynomials, we have
$$
  K_{eq} = e^{-\Delta G_\mathrm{ATP}^0 / RT} = \left( \frac{[\Sigma{\rm ATP}]}
        {[\Sigma{\rm Pi}][\Sigma{\rm ADP}]} \right)_{eq}
        \frac{P_\mathrm{ADP}P_\mathrm{Pi}}{P_\mathrm{ATP}} \frac{1}{[{\rm H}^+]}\, ,
$$
which yields and expression for the *apparent equilibrium constant* in terms of biochemical reactants
$$
  K'_{eq} = e^{-\Delta G_\mathrm{ATP}^{\prime 0} / RT} = \left( \frac{[\Sigma{\rm ATP}]}
        {[\Sigma{\rm Pi}][\Sigma{\rm ADP}]} \right)_{eq} =
        K_{eq}[{\rm H}^+]\frac{P_\mathrm{ATP}}{P_\mathrm{ADP}P_\mathrm{Pi}} \, .
$$

Using these equations, there are a couple of equivalent ways to express the Gibbs free enegy change for this reaction. One is based on the referenc chemical reaction

\begin{equation}
  \Delta G_\mathrm{ATP} = \Delta G^0_\mathrm{ATP} - RT \ln\left( \frac{[{\rm H}^+][{\rm HPO}_4^{2-}][{\rm ADP}^{3-}]}
                                                  {[{\rm ATP}^{4-}]}\right) \, .
\end{equation}

The other is
\begin{equation}
  \Delta G_\mathrm{ATP} = \Delta G^{\prime 0}_\mathrm{ATP} - RT \ln\left( \frac{[\Sigma{\rm Pi}][\Sigma{\rm ADP}]}
                                                  {[\Sigma{\rm ATP}]}\right) ,
\end{equation}
where $\Delta G_\mathrm{ATP}^{\prime 0}$ is the apparent Gibbs energy under standard conditions.

To verify these two equations give the same value, take the following values for dissociation constants

| Reactant (L) | $K_{H-L}$                | $K_{K-L}$               | $K_{Mg-L}$                |
| ------------ | ------------------------ | ----------------------- | ------------------------- |
| ATP          | 2.757$\times 10^{-7}$ M  | 9.809$\times 10^{-2}$ M   | 8.430$\times 10^{-5}$ M   |
| ADP          | 4.106$\times 10^{-7}$ M  | 1.319$\times 10^{-1}$ M   | 7.149$\times 10^{-4}$ M   |
| PI           | 2.308$\times 10^{-7}$ M  | 3.803$\times 10^{-1}$ M  | 2.815$\times 10^{-2}$ M   |

and $\Delta_r^0 G = -4.67$ kJ/mole, which yields $K_{eq} = 6.1163$ at 37$^\circ$ C.

The Python code below verifies that both approaches yield the same value of 45.730 kJ/mole.

```python
import numpy

# Dissociation Constants
K_HATP = 2.757e-7
K_KATP = 9.809e-2
K_MATP = 8.430e-5
K_HADP = 4.106e-7
K_KADP = 1.319e-1
K_MADP = 7.149e-4
K_HPI  = 2.308e-7
K_KPI  = 3.803e-1
K_MPI  = 2.815e-2

# Other constants
Keq = 6.1163
DG_ATP0 = -4670
RT = 310.15*8.3145
DG_ATP0 = -RT*numpy.log(Keq)

# Concentrations
ATP = 0.5e-3
ADP = 9.5e-3
Pi  = 1e-3
Mg  = 1e-3
H   = 10**(-7.2)
K   = 100e-3

# binding polynomials:
P_ATP = 1 + H/K_HATP + K/K_KATP + Mg/K_MATP
P_ADP = 1 + H/K_HADP + K/K_KADP + Mg/K_MADP
P_PI  = 1 + H/K_HPI  + K/K_KPI  + Mg/K_MPI

# reference species concentration
ATPs = ATP/P_ATP
ADPs = ADP/P_ADP
Pi_s = Pi/P_PI

# compute DeltaG_r in terms of reference species
DG_ATP1 = +DG_ATP0 - RT*numpy.log(H*Pi_s*ADPs/ATPs)
print("First equation:",DG_ATP1," J/mole")

K_apparent = Keq*H*P_ATP/(P_ADP*P_PI)
DG_ATP2 = -RT*numpy.log(K_apparent) - RT*numpy.log(ADP*Pi/ATP)
print("Second equation:",DG_ATP2," J/mole")
```

    First equation: 45729.93159766788  J/mole
    Second equation: 45729.93159766787  J/mole

This positive value for $\Delta G_\mathrm{ATP}$ means that the reaction is not favorable to proceed in the forward driection. (In other words, ATP synthesis cannot proceed without being coupled to some other driving force.)

## 2.3. What is the free energy change of Equation (2.2) at $\Delta\Psi$ = 180 mV? How does the free energy change of Equation (2.1) compare to that of Equation (2.2)? How efficient is the transduction of electrical to chemical free energy in this step in ATP synthesis? (What is the ratio of energy stored in ATP to the total energy consumed?)

The Gibbs energy of translocating protons across the membrane $\Delta G_{\rm{H}^{+}}$ at $\Delta \Psi = 180$ mV is
\begin{equation}
    \Delta G_{\rm{H}^{+}} = -F \Delta\Psi = - \Bigg(96485 \frac{\rm{C}}{\rm{mol}} \Bigg) (0.18 \ \rm{V}) \Bigg( \frac{1 \ \frac{\rm{J}}{\rm{C}}}{1 \ \rm{V}} \Bigg) \Bigg( \frac{1 \ \rm{kJ}}{10^3 \ \rm{J}} \Bigg) = -17.36 \ \frac{\rm{kJ}}{\rm{mol}}
\end{equation}
for Faraday's constant $F$. Note: *this equation ignores differences in pH on either side of the inner membrane*. This is the energy required (per mole) to move positive charges against the electrostatic gradient from the inside to the outside of the matrix. In other words, there is an electrical force driving postive charge into the matrix.

Since ATP synthesis reaction in mitochondrial is coupled to $n_A = 8/3$ H$^+$ translocate to the matrix, the overall free energy change for the coupled transport and reaction process is

\begin{equation}
  \Delta G = \Delta G_\mathrm{ATP} + n_A \Delta G_{\mathrm{H}^+} \, .
\end{equation}

Plugging the numbers from Section (2.2) we get

\begin{equation}
  \Delta G = +45.73 - (8/3)*17.36 = -0.56 \, {\rm kJ \ mol}^{-1} \, ,
\end{equation}

which means that, given the assumed concentrations, the system is operating close to equilibrium. The ratio of chemical energy stored in the ATP hydrolysis potential to electrical energy consumed is $45.73/46.32 \approx 98.7 \%$.

## 2.4. Given the concentrations assumed in 2.2, what is the minimum value of $\Delta\Psi$ at which ATP can be synthesized in the mitochondrial matrix?

At equilibrium, $\Delta G = 0$, that is,
\begin{eqnarray}
    \Delta G_{\rm{ATP}} &=& - n_{A} \Delta G_{\rm{H}^{+}} = -n_{A} (- F \Delta \Psi) \\
    \Rightarrow \Delta \Psi  &=& \frac{\Delta G_\mathrm{ATP} }{ n_A F } = 177.8 \ \mathrm{mV}.
\end{eqnarray}

## 2.5. Assume that reaction (2.1) proceeds by simple mass-action kinetics, with a constant reverse rate $k_r$. How does the forward rate constant necessarily depend on $\Delta\Psi$ for the reaction kinetics to be properly thermodynamically balanced?

To recap, the free energy for the ATP synthesis reaction
\begin{equation}
	{\rm ADP}^{3-} + {\rm HPO}_4^{2-} + ({\rm H}^+)_{\rm inside} \leftrightharpoons
    {\rm ATP}^{4-} + {\rm H}_2{\rm O},
\end{equation}
is
\begin{equation}
  \Delta G_\mathrm{ATP} = \Delta G_\mathrm{ATP}^0 - RT \log\left( \frac{[{\rm H}^+]_{\rm inside}[{\rm HPO}_4^{2-}][{\rm ADP}^{3-}]}
      {[{\rm ATP}^{4-}]} \right)
\end{equation}
where $\Delta G_\mathrm{ATP}^0 \approx -4.6$ kJ/mole is the standard Gibbs free energy change for the reference chemical reaction. In mitochondria ATP synthesis is coupled to proton transport from outside to inside of the matrix as
\begin{equation}
   n_A \left({\rm H}^+ \right)_{\rm outside} \leftrightharpoons n_A \left({\rm H}^+ \right)_{\rm inside} ,
\end{equation}
which is associated with a free energy change
\begin{equation}
  \Delta G_{\mathrm{H}^{+}} = -n_A F\Delta\Psi - RT \log\left( \frac{[{\rm H}^+]_{\rm outside}}
          { [{\rm H}^+]_{\rm inside}} \right)^{n_A} \, .
\end{equation}
This free energy is sometimes called the *proton motive force*. The last term on the right-hand side represents the contribution to the proton-transport free energy from a gradient in pH across the inner mitochondrial membrane.

The free energy of coupled ATP synthsis and proton transport is
\begin{equation}
  \Delta G_r = \Delta G_\mathrm{ATP}^0 - RT \log\left( \frac{[{\rm HPO}_4^{2-}][{\rm ADP}^{3-}]}
      {[{\rm ATP}^{4-}]} \right) -n_A F\Delta\Psi - RT \log \frac{\left( [{\rm H}^+]_{\rm outside}\right)^{n_A}}
          {\left( [{\rm H}^+]_{\rm inside}\right)^{n_A-1}}  \, .
\end{equation}

Chemical equilibrium occurs when $\Delta G_r = 0$, that is,
\begin{equation}
  \left( \frac{[{\rm ATP}^{4-}]}{[{\rm HPO}_4^{2-}][{\rm ADP}^{3-}]}
       \right)_{eq} = \exp\left[-\left( \Delta G_\mathrm{ATP}^0 - n_A F\Delta\Psi \right)/RT \right]\cdot
      \frac{\left( [{\rm H}^+]_{\rm outside}\right)^{n_A}}
          {\left( [{\rm H}^+]_{\rm inside}\right)^{n_A-1}} \, ,
\end{equation}
or in terms of sums of species
\begin{equation}
  K'_{\mathrm{F}_1 \mathrm{F}_0 \mathrm{ATPase}} =
  \left( \frac{[\Sigma{\rm ATP}]}{[\Sigma{\rm Pi}][\Sigma{\rm ADP}]}
       \right)_{eq} = \exp\left[-\left( \Delta G_\mathrm{ATP}^0 - n_A F\Delta\Psi \right)/RT \right]
       \frac{P_\mathrm{ATP}}{P_\mathrm{ADP} P_\mathrm{Pi}}
      \frac{\left( [{\rm H}^+]_{\rm outside}\right)^{n_A}}
          {\left( [{\rm H}^+]_{\rm inside}\right)^{n_A-1}} \, .
\end{equation}

A simple mass-action expression for the reaction flux that satisfies this thermodynamic relation is
\begin{equation}
  J_{\mathrm{F}_1\mathrm{F}_0\mathrm{ATPase}} = k_r\left( K'_{\mathrm{F}_1\mathrm{F}_0\mathrm{ATPase}}[\Sigma{\rm Pi}][\Sigma{\rm ADP}] - [\Sigma{\rm ATP}] \right),
\end{equation}
where
\begin{eqnarray}
  \frac{\mathrm{d}}{\mathrm{dt}} [\Sigma \mathrm{ATP}] &=& J_{\mathrm{F}_1\mathrm{F}_0\mathrm{ATPase}} \\
  \frac{\mathrm{d}}{\mathrm{dt}} [\Sigma \mathrm{ADP}] &=& -J_{\mathrm{F}_1\mathrm{F}_0\mathrm{ATPase}} \\
  \frac{\mathrm{d}}{\mathrm{dt}} [\Sigma \mathrm{Pi}] &=& -J_{\mathrm{F}_1\mathrm{F}_0\mathrm{ATPase}} \\
\end{eqnarray}

## 2.6. Write a simple program that simulates the kinetics of [$\Sigma$ADP], [$\Sigma$ATP] , and [$\Sigma$Pi] in the matrix given a fixed membrane potential, pH, and magnesium concentration, and given arbitrary initial conditions. How do the predicted steady-state concentrations depend on membrane potential, pH, and magnesium concentration?

```python
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import math as mt
# init_conditions = ATP, ADP, P
# ATP, ADP, P = init_conditions
# Psi input in mV
def J_ATPase(psi, pH_inner, pH_outer, Mg, concentrations):
    # Define initial conditions
    ATP, ADP, Pi  = concentrations

    k_r = 1 # assumption
    n_A = 8/3

    # Dissociation Constants
    K_HATP = 2.757e-7
    K_KATP = 9.809e-2
    K_MATP = 8.430e-5
    K_HADP = 4.106e-7
    K_KADP = 1.319e-1
    K_MADP = 7.149e-4
    K_HPI  = 2.308e-7
    K_KPI  = 3.803e-1
    K_MPI  = 2.815e-2

    # H concentrations
    H_x = 10**(-pH_inner)
    H_e = 10**(-pH_outter)

    # binding polynomials:
    P_ATP = 1 + H/K_HATP + Mg/K_MATP
    P_ADP = 1 + H/K_HADP + Mg/K_MADP
    P_PI = 1 + H/K_HPI + Mg/K_MPI

    # Other constants
    DGr0 = -4670
    RT = 310.15*8.3145
    F = 96485.33  # C/mole

    # Define K'_F1F0ATPase
    k_prime = np.exp(-(DGr0 - F * psi * n_A)/(RT))*P_ATP/(P_ADP*P_PI)*H_e**n_A / H_x**(n_A-1)
    J = k_r*(k_prime*Pi * ADP - ATP)

    return J

```

```python
pH_outer = 7.2
pH_inner = 7.4

Mg  = 1e-3        # M
ATP = 0.5e-3      # M
ADP = 9.5e-3      # M
Pi  = 1e-3        # M
Mg  = 1e-3        # M
H   = 10**(-7.2)  # M
K   = 100e-3      # M

psi = 180 / 1000  # Convert to V

init_conditions = np.array([ATP, ADP, Pi])
# J_ATPase(psi, pH_inner, pH_outter, Mg, init_conditions)
def dSTATES_dt(STATES, t, psi, pH_inner, pH_outer, Mg):
    rate = J_ATPase(psi, pH_inner, pH_outter, Mg, STATES)
    dATP = rate
    dADP = - rate
    dPi = - rate

    dxdt = (dATP, dADP, dPi)
    return dxdt
```

```python
pH_outter = 7.2
pH_inner = 7.4
Mg  = 1e-3
psi = 180 / 1000

t = np.linspace(0,10)

dSTATES_dt(init_conditions, t, psi, pH_inner, pH_outer, Mg)

ode_results = odeint(dSTATES_dt,init_conditions, t, (psi, pH_inner, pH_outer, Mg)).T
plt.plot(t,ode_results[0], label = 'ATP')
plt.plot(t,ode_results[1], label = 'ADP')
plt.plot(t,ode_results[2], label = 'Pi')

plt.legend()
ode_results[:,-1][0]/ode_results[:,-1][1]
```

```python
RT*np.log(0.2)
```

    -4150.325422837771

### Mg Analysis

```python
Mg_array = np.linspace(1e-4, 1e-2)
SS_end = []
for Mg in Mg_array:
    ode_results = odeint(dSTATES_dt,init_conditions, t, (psi, pH_inner, pH_outter, Mg)).T
    SS_end.append(ode_results[:,-1])
SS_end= np.array(SS_end)

plt.figure()
plt.plot(Mg_array,SS_end[:,0])
Mg  = 1e-3
```

### Psi Analysis

```python
psi_array = np.linspace(120, 220) / 1000 # convert to V
SS_end = []
for psi in psi_array:
    ode_results = odeint(dSTATES_dt,init_conditions, t, (psi, pH_inner, pH_outer, Mg)).T
    SS_end.append(ode_results[:,-1])
SS_end= np.array(SS_end)

plt.figure()
plt.plot(psi_array*1000,SS_end[:,0])
plt.plot(psi_array*1000,SS_end[:,1])
plt.plot(psi_array*1000,SS_end[:,2])
psi  = 180
```

### Inner pH

```python
psi  = 180 / 1000

pH_array = np.linspace(7, 8)
SS_end = []
for pH_inner in pH_array:
    ode_results = odeint(dSTATES_dt,init_conditions, t, (psi, pH_inner, pH_outer, Mg)).T
    SS_end.append(ode_results[:,-1])
SS_end= np.array(SS_end)

plt.figure()
plt.plot(pH_array,SS_end[:,0])
plt.plot(pH_array,SS_end[:,1])
plt.plot(pH_array,SS_end[:,2])

```

# 3. Adenine nucleotide translocase (ANT)

## Buiding on the model developed in the previous section, add an extramitochondrial cytoplasmic compartment coupled to the mitochondria with the kinetic model for the ANT of Bazil et al. https://doi.org/10.1016/j.bpj.2015.09.036. (The model formulation and kinetic parameters are in the supplementary material for the paper.) With constant $\Delta\Psi$ and inorganic phosphate concentrations, simulate how matrix and cytoplasmic ATP and ADP concentration depend on cytoplasmic ATP hydrolysis rate.

The biochemical equation for the ANT is
\begin{equation}
	{\rm ATP}_{x} + {\rm ADP}_{e} \leftrightharpoons
    {\rm ATP}_{e} + {\rm ADP}_{x},
\end{equation}
where the subscripts $x$ and $e$ denote mitochondrial matrix and extramitochondrial, respectively. Then, from Bazil et al. the flux is
\begin{equation}
  \ J_\mathrm{ANT} =  - E_{ANT} \dfrac{
    k_2^\mathrm{ANT} q \frac{ [\mathrm{ATP}^{4-}]_x [\mathrm{ADP}^{3-}]_e }{ K_o^D } -
    k_3^\mathrm{ANT} \frac{ [\mathrm{ATP}^{4-}]_e [\mathrm{ADP}^{3-}]_x }{ K_o^T } }{
      \left( 1 + \frac{ [\mathrm{ATP}^{4-}]_e }{ K_o^T } + \frac{ [\mathrm{ADP}^{3-}] }{ K_o^D } \right) \left( [\mathrm{ATP}^{4-}]_x + q [\mathrm{ADP}^{3-}]_x \right)
    } ,
\end{equation}
where
\begin{eqnarray}
  k_2^\mathrm{ANT} &=& k_2^{\mathrm{ANT}, o} e^{ (-3 \alpha_1 - 4 \alpha_2 + \alpha_3) \frac{F \Delta \Psi}{RT}} \\
  k_3^\mathrm{ANT} &=& k_3^{\mathrm{ANT}, o} e^{ (-4 \alpha_1 - 3 \alpha_2 + \alpha_3) \frac{F \Delta \Psi}{RT}}\\
  K_o^D &=& K_o^{D,o} e^{ 3 \delta_D \frac{RT}{F \Delta\Psi}} \\
  K_o^T &=& K_o^{T,o} e^{ 4 \delta_T \frac{RT}{F \Delta\Psi}} \quad \text{and} \\
  q &=& \frac{ k_3^{\mathrm{ANT}} K_o^D }{ k_2^\mathrm{ANT} K_o^T } e^{ \frac{F \Delta\Psi }{ RT } }.
\end{eqnarray}

The parameters values can be found in the following table:

| Parameter | Unit | Value |
| -- | -- | -- |
| $E_\mathrm{ANT}$ | M | 0.141 |
| $k_2^{\mathrm{ANT},o}$ | s$^{-1}$ | 0.159 |
| $k_3^{\mathrm{ANT},o}$ | s$^{-1}$ | 0.501 |
| $K_o^{D,o}$ | $\mu$M | 38.89 |
| $K_o^{T,o}$ | $\mu$M | 56.05 |
| $\alpha_1$  |        | 0.2829 |
| $\alpha_2$  |        | -0.2086|
| $\alpha_3$  |        | 0.2372 |
| $\delta_T$  |        | 0.0167 |
| $\delta_D$  |        | 0.0699 |

```python
def J_ANT(psi, pH_inner, pH_outer, Mg, concentrations):
    # Define initial conditions
    ATPx, ADPx, Pix , ATPe, ADPe, Pie, Cre = concentrations

    E_ANT = 0.141           # mol (L mito)^(-1)
    k2_ANT_o = 9.54 / 60      # s^(-1)
    k3_ANT_o = 30.05/60       # s^(-1)
    Ko_Do = 38.89e-6    # microM
    Ko_To = 56.05e-6    # microM
    alpha_1 = 0.2829
    alpha_2 = -0.2086
    alpha_3 = 0.2372
    delta_T = 0.0167
    delta_D = 0.0699

    F = 96485.33            # C mol^(-1)
    RT = 310.15*8.3145
    fi = F*psi/RT

    k2_ANT = k2_ANT_o*mt.exp((alpha_1*(-3)+alpha_2*(-4)+alpha_3)*fi)
    k3_ANT = k3_ANT_o*mt.exp((alpha_1*(-4)+alpha_2*(-3)+alpha_3)*fi)

    Ko_D = Ko_Do * mt.exp(3*delta_D*fi)
    Ko_T = Ko_To * mt.exp(4*delta_T*fi)
    q = k3_ANT * Ko_D * mt.exp(fi) / (k2_ANT * Ko_T)

    num = k2_ANT * q * ATPx * ADPe / Ko_D - k3_ANT * ATPe * ADPx / Ko_T
    den = (1 + ATPe/Ko_T + ADPe/Ko_D) * (ADPx + q * ATPx)
    J = E_ANT * num / den

    return J

```

```python
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import math as mt

def J_F1F0(psi, pH_inner, pH_outer, Mg, concentrations):
    # Define initial conditions
    ATPx, ADPx, Pix , ATPe, ADPe, Pie, Cre = concentrations

    # Assume k_r = 1
    k_r = 1 # assumption
    n_A = 8/3

    # Dissociation Constants
    K_HATP = 2.757e-7
    K_KATP = 9.809e-2
    K_MATP = 8.430e-5
    K_HADP = 4.106e-7
    K_KADP = 1.319e-1
    K_MADP = 7.149e-4
    K_HPI  = 2.308e-7
    K_KPI  = 3.803e-1
    K_MPI  = 2.815e-2

    # Other constants
    DGr0 = -4670
    RT = 310.15*8.3145
    F = 96485.33  # C/mole

    # H concentrations
    H_x = 10**(-pH_inner)
    H_e = 10**(-pH_outter)

    # binding polynomials:
    P_ATP = 1 + H_x/K_HATP + Mg/K_MATP
    P_ADP = 1 + H_x/K_HADP + Mg/K_MADP
    P_PI  = 1 + H_x/K_HPI  + Mg/K_MPI

    # Define K'_F1F0ATPase
    k_prime = np.exp(-(DGr0 - F * psi * n_A)/(RT))*P_ATP/(P_ADP*P_PI)*H_e**n_A / H_x**(n_A-1)
    J = k_r*(k_prime*Pix * ADPx - ATPx)

    return J

```

```python

def J_ATPase(psi, pH_inner, pH_outer, Mg, concentrations):
    # Define initial conditions
    ATPx, ADPx, Pix , ATPe, ADPe, Pie, Cre = concentrations
    H_x = 10**(-pH_inner)
    H_e = 10**(-pH_outter)
    RT = 310.15*8.3145

    # Dissociation Constants
    K_HATP = 2.757e-7
    K_KATP = 9.809e-2
    K_MATP = 8.430e-5
    K_HADP = 4.106e-7
    K_KADP = 1.319e-1
    K_MADP = 7.149e-4
    K_HPI  = 2.308e-7
    K_KPI  = 3.803e-1
    K_MPI  = 2.815e-2

    X_ATPase = 0.01 # U/ml
    K_iADP = 2.41e-4 # M
    DGr0_ATPase = 4510 # Joules/mol
     # binding polynomials:
    P_ATP = 1 + H_e/K_HATP + Mg/K_MATP
    P_ADP = 1 + H_e/K_HADP + Mg/K_MADP
    P_PI  = 1 + H_e/K_HPI  + Mg/K_MPI

    Keq = mt.exp(-DGr0_ATPase/RT)/ (H_e) * ((P_ADP * P_PI)/P_ATP)

    J = X_ATPase * (1 - (ADPe * Pie)/(ATPe * Keq))/(1 + ADPe/K_iADP)
    return J
```

```python

def J_PiC(psi, pH_inner, pH_outer, Mg, concentrations):
    # Define initial conditions
    ATPx, ADPx, Pix , ATPe, ADPe, Pie, Cre = concentrations
    H_x = 10**(-pH_inner)
    H_e = 10**(-pH_outter)

    X_PiC = 3.34e7*1 #mol/s/M/lmito
    k_PiC = 1.61 # mM
    J = - X_PiC *(Pix * H_x - Pie * H_e)/(Pie + k_PiC )
    return J
```

```python
def J_CK(psi, pH_inner, pH_outer, Mg, concentrations):
    # Define initial conditions
    ATPx, ADPx, Pix , ATPe, ADPe, Pie, Cr = concentrations
    H_x = 10**(-pH_inner)
    H_e = 10**(-pH_outter)

    DGr0_CK = -7910 # j/mol
    X_CK = 1e3 #M/s
    RT = 310.15*8.3145
    kref = 7.14e8 # Wu eta al 2008
    # Dissociation Constants
    K_HATP = 2.757e-7
    K_KATP = 9.809e-2
    K_MATP = 8.430e-5
    K_HADP = 4.106e-7
    K_KADP = 1.319e-1
    K_MADP = 7.149e-4
    K_HPI  = 2.308e-7
    K_KPI  = 3.803e-1
    K_MPI  = 2.815e-2

    Crtot = 20e-3 # total creatin
    PCre = Crtot - Cre #
    # binding polynomials:
    P_ATP = 1 + H_e/K_HATP + Mg/K_MATP
    P_ADP = 1 + H_e/K_HADP + Mg/K_MADP
    keq = kref*H_e*(P_ATP/P_ADP)
    #keq = mt.exp(-DGr0_CK/RT)*H_e*(P_ATP/P_ADP)
    J = X_CK *(keq * ADPe *PCre - ATPe * Cre)
    return J
```

```python
pH_outer = 7.2
pH_inner = 7.4

psi = 180 / 1000

ATPx = 0.5e-3
ADPx = 9.5e-3
Pix   = 1e-3
ATPe = 7.5e-3
ADPe = 0.05e-3
Pie   = 0.3e-3
Crtot = 20e-3 # total creatin
Cre = 0.7 * Crtot;

Mg  = 1e-3
H   = 10**(-7.2)
K   = 100e-3

# Volumes
Ve = 2  #4.54e3
Vx = 1  # 0.65

init_conditions = np.array([ATPx, ADPx, Pix, ATPe, ADPe, Pie, Cre])
# J_ATPase(psi, pH_inner, pH_outter, Mg, init_conditions)
def dSTATES_dt(STATES, t, psi, pH_inner, pH_outer, Mg):

    F1F0 = J_F1F0(psi, pH_inner, pH_outter, Mg, STATES)
    ANT  = J_ANT(psi, pH_inner, pH_outer, Mg, STATES)
    PiC =  J_PiC(psi, pH_inner, pH_outer, Mg, STATES)

    ATPase = J_ATPase(psi, pH_inner, pH_outer, Mg, STATES)
    CK = J_CK(psi, pH_inner, pH_outer, Mg, STATES)

    dATPx = (F1F0 - ANT) / Vx
    dADPx = (-F1F0 + ANT) / Vx
    dPix   = (PiC-F1F0)/Vx
    dATPe = ANT / Ve - ATPase + CK
    dADPe = - ANT / Ve + ATPase - CK
    dPie = - PiC / Ve + ATPase
    dCre = CK
    #dPCre = PCre - (Crtot - Cre)/1e20

    dxdt = (dATPx, dADPx, dPix, dATPe, dADPe, dPie, dCre)
    return dxdt
```

```python
pH_outter = 7.2
pH_inner = 7.4
Mg  = 1e-3
psi = 180 / 1000

t = np.linspace(0,10)

dSTATES_dt(init_conditions, t, psi, pH_inner, pH_outter, Mg)

ode_results = odeint(dSTATES_dt,init_conditions, t, (psi, pH_inner, pH_outter, Mg)).T
plt.plot(t,ode_results[0] * 1000, label = 'ATP_x')
plt.plot(t,ode_results[1] * 1000, label = 'ADP_x')
plt.plot(t,ode_results[2] * 1000, label = 'Pi_x')
plt.plot(t,ode_results[3] * 1000, label = 'ATP_e')
plt.plot(t,ode_results[4] * 1000, label = 'ADP_e')
plt.plot(t,ode_results[5] * 1000, label = 'Pi_e')
plt.plot(t,ode_results[6] * 1000, label = 'Cre')

plt.legend(fontsize=12)
plt.ylabel('Concentration (mM)', fontsize=16)
plt.xlabel('Time (s)', fontsize=16)
plt.legend(bbox_to_anchor=(1.2, 0.5))
Mg  = 1e-3

```

# 4. Phosphate transport

# 5. Cytoplasmic creatine kinase

## Add cytoplasmic creatine kinase and simulate how steady-state energetic state varies with ATP hydrolysis rate. Plot predicted CrP/ATP ratio as a function of myocardial MVO2.

Python Code/Quantitative_Aspects_of_Mitochondrial_Function July 21.ipynb