For an assignment I have to create an SI model with Python and answer some questions about it. The model itself is very simple. I use a Python package to create a graph with an average degree of $\langle k \rangle$. In this graph an infected node, for each timestep, will infect a neighbouring node with a probability of $i$. The problem I am having is understanding one of the questions that has nothing to do with programming, but with mathematics!
Specifically we have to analytically derive the reproduction number $R_0$ (which they define as "the expected number of new infections in the first step of time per infected node"). I have Googled a lot and found out the following:
\begin{align*} \frac{dI}{dT} &= \beta \frac{SI}{N}\\ \frac{dS}{dT} &= -\beta \frac{SI}{N} \end{align*}
where $I$ is the total number of infected nodes, $S$ the total number of susceptible nodes and $N$ the total number of nodes ($N = S + I$). In most places I've read that $\beta$ is defined as the infection/contact rate or the probability of infection times the average contact between susceptible and infected nodes.
In my case I assume that $\beta = i \cdot \langle k \rangle$, right? How do I get $R_0$ from this, and is this even what they mean by "analytically derive"?
In your case specifically, $R_0 = \infty$. The value of $R_0$ is determined by the method used, but in this case, again, all methods that I know of lead to the same value, $\infty$. To understand this, know that $R_0$ represents the average number of individual becomes infected because of a single infectious individual in a population that is healthy. In general, $$R_0= \left(\text{average time an infectious individual remains in the infected class}\right)\times\left(\text{infection rate}\right)$$ In your case, the infection rate is either $\beta$ or a multiple of $\beta$ (depending on your precise definition of $\beta$). On the other hand, the infectious individuals in your model ($I$), never die. This means the first term is infinite.
For very complex system, such intuitive method becomes difficult to carry out because of the connectivity between terms. In this case, you try Next Generation Matrix method to compute $R_0$. As far as I know, this method always works. There is a catch though. Finding the interpretation of whatever expression you get becomes very difficult. And I consider both methods to be analytical. Of course, there are many others including some numerical ones too.
To learn more about Next Generation Matrix, you check out the following papers.
Diekmann, Odo, Johan Andre Peter Heesterbeek, and Johan AJ Metz. "On the definition and the computation of the basic reproduction ratio R0 in models for infectious diseases in heterogeneous populations." Journal of mathematical biology 28.4 (1990): 365-382.
Or for a more application purpose (example),
Castillo-Chavez, Carlos, and Baojun Song. "Dynamical models of tuberculosis and their applications." Mathematical biosciences and engineering 1.2 (2004): 361-404.