from IPython.display import Image
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/rabbitss.png")
Birth ( asexual bunnies), predation (eat to reproduce), death (rabbits only die when eaten by wolfs).
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/rabbits.png")
Set of species (yellow circles), set of transitions (blue rectangles), rate constant (real number).
A Petri net consist of a set S of species and a set T of transitions together with functions: $$i:S\times T\rightarrow N, o:S\times T\rightarrow N, $$ counting how many copies of each species shows as inputs and outputs of the transitions.
A stochastic Petri net is a Petri net together with a function $$\tau:T\rightarrow (0,\infty)$$ giving a rate constant for each transition.
How the expected number of things of each species changes with time.
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/rabbits.png")
$x(t)$ =# rabbits,
$y(t)$ =# wolves,
$\beta$ the birth rate constant,
$\gamma$ the predation rate constant,
$\delta$ the death rate constant.
The rate equation.
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/water.png")
$\alpha$ the rate constant of reaction.
+Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/waters.png")
$\beta$ the other rate constant of reaction.
The ith species appears as input to a transition $m_i$ times and as output $n_i$ times, then $$\frac{dx_i}{dt} = r(n_i-m_i)x_1^{m_1}\cdots x_k^{m_k}$$ $x=(x_1^{m_1}\cdots x_k^{m_k}), m={m_1}\cdots {m_k}, n={n_1}\cdots {n_k}, x^m = x_1^{m_1}\cdots x_k^{m_k}$ $$\frac{dx}{dt} = r(n-m)x^m$$
If we have different transitions with different rate constants: $$\frac{dx}{dt} = \sum_{\tau\in T} r(\tau)(n(\tau)-m(\tau))x^{m(\tau)}$$
Complex of Petri nets.
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/label.png")
Find a Petri net whose rate equation is: $$\frac{dx}{dt} = \beta x-\gamma xy $$
$$\frac{dy}{dt} = \epsilon xy - \delta y$$
The Sir Model of infectious disease.
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/sir.png")
$\beta$ the rate constant of infection, and $\alpha$ the rate constant of recovery.
Image("C:/Users/FSU/Dropbox/Teaching/2018_Spring_Machine_Learning_Class/Lectures_Jupyter/L9_Reaction_Networks/sirs.png")