I need to solve dN/dt = f*(1-N) - g*N and store the analytical solution in an array
%values init = 1; f = 0.5; g = 0.4; delta = 0.01;
%Array for time values t = 0:delta:10 ;
No products are associated with this question.
Assuming you mean dN/dt = f*(1-N(t)) - g*N(t) and N(0) = 1, then:
N(t) = 5/9+(4/9)*exp(-(9/10)*t)
N(t) = f/(f+g) + exp(-(f+g)*t) * (init - f/(f+g))
Play games and win prizes!Learn more