Hello, I’m fresh off the boat to using Julia (coming from Python and Stan), and I am looking for the preferred generic solution to specifying an ODE with both unknown parameters and control variables/system forcings.
As a simple case, I have a vector response function, Y = f(u,t,\theta;X), where X are control variables/system characteristics (like the volume of a tank, say, or inflow concentrations) potentially to be optimized to meet some constraints, and \theta are parameters to be learned (like reaction rates, settling velocities) from observed concentration data (u) via calibration (in my case, preferably Bayesian to support uncertainty quantification in the decision domain due to the unknown parameters).
I can easily make an ODEProblem
work to separate user-specified “inputs” (i.e., X values) and parameters in the derivative function (thanks to the excellent SciMLTutorials), e.g.
function derivatives!(du,u,p,t)
theta = p[1:n]
x1 = p[n+1] # p[n+1] a tuple
...
xn = p[last] # p[last] a vector
# now compute derivatives
end
but this solution throws method errors I don’t yet understand how to interpret when passing the same problem to Turing for parameter estimation. Any tips/pointers would be much appreciated - especially so if there is a settled way of handling this pattern, generally. I am working on a simple example to see if the SciML ecosystem is right for my research focus (optimization of wasteload allocations in aquatic systems). So while this is currently just an ODEProblem, it will quickly become a PDE, SDE and perhaps UDE problem, as well.