Hi All,
This seems like it should be a simple problem to solve, but I’ve scoured the documentation of DifferentialEquations.jl and can’t seem to identify anything specifically relating to my issue.
For a simple coupled ODE of the form
I’ve set up my Julia implementation like so:
u0 = [20.0, 2.6]; #Initial populations
p = [ib, r, nutr, H₁, H₂, H₃, H₄];
tspan = (0.0,364.0);
prob = ODEProblem(coupled_ode!,u0,tspan,p);
sol = solve(prob);
I want to generate a state space diagram over A \in [0,20], B \in [0,120], showing zero isoclines for both parameters (i.e. traces over the state space when \frac{dA}{dt} = 0 or \frac{dB}{dt} = 0).
There are a few steady state solutions to this problem, that I can obtain using prob = SteadyStateProblem(coupled_ode!,u0,p)
in place of the ODEProblem
, but I can’t seem to find a concise/efficient solution for generating the zero-isoclines at all.
Currently I’ve looked into using two for
loops altering u0 = [A0[i], B0[j]]
to build the state space.
I can use sol(0.0, Val{1})
for each of the solutions to find the derivative values when t=0, but of course I’m looking for the the time when Val{1} == 0
.
Perhaps I can generate a large search range over time and find the index of the minimum of the derivative?
search = 0.0:0.001:5000.0;
findmin(abs.(hcat(sol(search,Val{1}).u...)),dims=2)
but this seems like overkill, and doesn’t necessarily assure that A’ = 0 has been found either.
It’s highly likely I’ve either missed a simple method or misunderstood something conceptually. Any hints or suggestions on this would be appreciated.