Hello,
I have a toy problem where I have a parameter that depends on time
using ModelingToolkit, DifferentialEquations
using ModelingToolkit: t_nounits as t, D_nounits as D
function test(;name)
vars = @variables begin
x(t)
end
para = @parameters begin
α(t)
end
eqs = [
D(x) ~ α
]
ODESystem(eqs,t,vars,para,name=name)
end
@named model = test()
sys = structural_simplify(model)
para = [sys.α => cos(t)]
u0 = [sys.x => 1]
tspan = (0,2π)
prob = ODEProblem(sys,u0,tspan,para)
sol = solve(prob)
The solution I get after solving does not consider the parameter to be dynamic.
Here it will fix α
= cos(0)
= 1 for the entire time span.