I am newbie MATLAB user. How to write this equation system in MATLAB?
$$\frac{dN_{ik}}{dt}=\sum_{j=i}^{n}\sum_{l=1}^{n}\beta_{jl}b_{ikjl}S_{jl}N_{jl} - S_{ik}N_{ik}$$
Here, I want to know if I take $n=3$ or any constant number what kind of equation system will I have?
How can i run this loop without entering $\beta$, $b$ and $S$ functions. I just want to see matrix form of this system. Sorry for my bad English, thanks for help.
The function for the right-hand side and arbitrary parameters should look something like this:
where you need to provide the parameter $n$ and the implementations of the functions $\beta, b$ and $S$.
To have it run in Matlab, type
where the first argument is an anonymous function allowing for passing over a third argument (the parameter struct
par), $t_0$ is start time, $t_e$ is end time and $N_0$ are initial conditions. Note that $N_0$ needs to have $n \cdot n_k$ components.Choosing $n = n_k = S = \beta = N_0 = 1$ and $b = 0.5$ yields the following result for $t \in [0, 1]$:
Choosing $n = n_k = 2$, $S = \beta = 1$, $N_0 = (.2, .3, .4, .5)^T$ and $b = 0.5$ returns