UDEs & ModelingToolkit

Hi everyone,

I’m using the UDE example here but trying to make it work for the case that my ODE system is not in defined in vector form (as it usually is for UODE examples I’ve seen), but in symbolic form using MTK. I haven’t been able to find an example that does this and I’ve been trying to find a solution myself as follows:

For example, suppose I have the Hires ODEs defined using MTK. The first idea I had was to extract the RHS of my symbolic equations as a vector-valued function, and then embed that inside my ude_dynamics!(du, u, p, t, p_true) function, but for some reason that results in errors in the optimization step (I have tested the RHS function and made sure that it can be successfully used to solve the ODE problem). Here’s the full version of the code.

I’m wondering if there’s a way to achieve what I described—embedding a NN inside an ODE system that’s defined using MTK?

Thanks a lot in advance!

Not yet.

1 Like