I'm trying to construct a series of differential equations that defines the behavior of m mutually interacting species according to the Lotka-Volterra equations. I figure there must be some clever Mathematica way to define them all in one go without having to manually write out each equation but unfortunately I'm quite inexperienced. How would I do this?
n1'[t] == r1 n1[t] (1 + a11 n1[t] + a12 n2[t]+a13 n3[t] ...);
n2'[t] == r2 n2[t] (1 + a22 n2[t] + a21 n1[t]+a23 n3[t] ...);
n3'[t] == r3 n3[t] (1 + a33 n3[t] + a31 n1[t]+a32 n3[t] ...);
n4'[t] == r4 n4[t] (1 + a44 n4[t] + a41 n1[t]+a42 n4[t] ...);
.
.
.
n[1]'[t] == r[1] n[1][t] (1 + a[1,1] n[1][t] ...)
, together with either aTable
orArray
to vary the indices! $\endgroup$==
does not define things; it's merely part of an expression. so, you'll want to keep these expressions around in some kind of container, like a list (as would be produced by aTable
), and store that in a variable. in that case you'll want to avoid the semicolon at the end!) $\endgroup$