baggepinnen / LowLevelParticleFilters.jl

State estimation, smoothing and parameter estimation using Kalman and particle filters.
https://baggepinnen.github.io/LowLevelParticleFilters.jl/stable
Other
117 stars 15 forks source link

Compatibility to ModelingToolkit.jl? #122

Closed dfabianus closed 1 year ago

dfabianus commented 1 year ago

Hello Fredrik!

Thanks for the great package! :)

I want to icorporate the package for nonlinear state estimation. I have built an ODE model using MTK. Is there a straightforward way to use the estimators together with MTK models (ODESystem type)?

I assume I could try to convert my ODESystem to a ODEProblem from DifferentialEquations.jl and obtain the state transition function by the f-field. Or is there another way to automatically "de-modelingtoolkitize" the MTK model from symbolic to a numeric function in order to use it with the estimators?

Otherwise I would have to rewrite the model to a numeric function, right?

What is your thought on that?

baggepinnen commented 1 year ago

Hello! Yes, you can use this package with ModelingToolkit, there's a tutorial here https://help.juliahub.com/juliasimcontrol/dev/examples/state_estimation/ It uses JuliaSimControl.jl, which is a proprietary package, but available for free for non-commercial use.

baggepinnen commented 1 year ago

You can also call the internal function ModelingToolkit.generate_control_function to build the $\dot x = f(x, u, p, t)$ function without using JuliaSimContorl, but with this approach, you'd have to write the output function manually.

dfabianus commented 1 year ago

Thanks a lot! Exactly, what I was looking for. :)

baggepinnen commented 1 year ago

Cool, don't forget to discretize the continuous-time MTK dynamics.