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 was wondering if it was somehow possible to use transport delay inside of a ModelingToolkit component. I tried modifing this minamal example using DDEs
using ModelingToolkit, DelayDiffEq
using ModelingToolkit: t_nounits as t, D_nounits as D
using Plots
# this does not work
tau = 1
@mtkmodel FOL begin
@parameters begin
p0=0.2
p1=0.2
q0=0.3
q1=0.3
v0=1
v1=1
d0=5
d1=1
d2=1
beta0=1
beta1=1
end
@variables begin
x₀(t)
x₁(t)
x₂(..)
end
@equations begin
D(x₀) ~ (v0 / (1 + beta0 * (x₂(t - tau)^2))) * (p0 - q0) * x₀ - d0 * x₀
D(x₁) ~ (v0 / (1 + beta0 * (x₂(t - tau)^2))) * (1 - p0 + q0) * x₀ +
(v1 / (1 + beta1 * (x₂(t - tau)^2))) * (p1 - q1) * x₁ - d1 * x₁
D(x₂(t)) ~ (v1 / (1 + beta1 * (x₂(t - tau)^2))) * (1 - p1 + q1) * x₁ - d2 * x₂(t)
end
end
tspan = (0.0, 10.0)
@mtkbuild sys = FOL()
prob = DDEProblem(sys,
[x₀ => 1.0, x₁ => 1.0, x₂(t) => 1.0],
tspan,
constant_lags = [tau])
alg = MethodOfSteps(Tsit5())
sol = solve(prob, alg)
plot(sol)
and found it does not work as expected. It turned out that ModelingToolkit.jl does no support DDEs in the macro right now, but should be able to lower to System instead of ODESystem.
I was wondering if it was somehow possible to use transport delay inside of a ModelingToolkit component. I tried modifing this minamal example using DDEs
to
and found it does not work as expected. It turned out that ModelingToolkit.jl does no support DDEs in the macro right now, but should be able to lower to System instead of ODESystem.
This issue is a result of a forum discussion.
The text was updated successfully, but these errors were encountered: