You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using Catalyst to build up a reaction network from which I generate a system of ODEs .
The model I am implementing implies interpolated data as an algebraic function, as described in Bergman's minimal model (Bergman et al 1979) :
However, unlike other algebraic functions I have previously used, some implying the variable t, in different models, linear interpolation does not seem to work inside an ODE:
TypeError: non-boolean (Num) used in boolean context
I also have kind of the same problem when I directly implement the system of ODEs:
function fminimalmodel(u, p, t)
B_0,k_gelim,k_iut,k_imet,k_gmet, k_ipan ,k_ielim = p
G_p , I_r = u
dGp = B_0 - k_gelim * G_p - k_gmet * G_p - (k_iut + k_imet) * G_p * I_r
dIr = k_ipan * Iintpol(t) - k_ielim* I_r
[dGp, dIr]
end
prm = [datamean1[1],0.03,0.04,0.005,0.09,0.9,0.005]
oprob = ODEProblem(fminimalmodel, [datamean1[1],0.0], tspan, prm)
sol = solve(oprob)
output:
BoundsError: attempt to access 9-element extrapolate(interpolate((::Vector{Union{Missing, Int64}},), ::Vector{Float64}, Gridded(Linear())), Throw()) with element type Float64 at index [305.0204580512005]
Is there any workaround in Catalyst or DifferentialEquations to solve this issue?
The text was updated successfully, but these errors were encountered:
Can you post a complete minimum working example that loads the appropriate package and builds the interpolant so we can run the code ourselves? Your DifferentialEquations error seems to be related to the interpolant -- are you sure you are building / using it correctly? Have you checked you can call Iintpol(t) and plot it yourself from how you've defined it?
For the DifferentialEquations object, it was just a misuse indeed (tspan[end] > tticks[end]): issue solved.
The register_symbolic macro did the trick, the model works as expected, I've never used it before, good to know.
Thank you
Hello ,
I am currently using Catalyst to build up a reaction network from which I generate a system of ODEs .
The model I am implementing implies interpolated data as an algebraic function, as described in Bergman's minimal model (Bergman et al 1979) :
However, unlike other algebraic functions I have previously used, some implying the variable t, in different models, linear interpolation does not seem to work inside an ODE:
TypeError: non-boolean (Num) used in boolean context
I also have kind of the same problem when I directly implement the system of ODEs:
output:
Is there any workaround in Catalyst or DifferentialEquations to solve this issue?
The text was updated successfully, but these errors were encountered: