torchdiffeq
torchdiffeq copied to clipboard
Solving a system of ODEs
Hi, great work, and thanks for the code!
I was wondering if the following is possible.
I have a system of ODEs (two ODEs):
x_state = f(x, t, theta)
0 = d {g(x, t, phi)} / dx
Simply put, I want the function f
to output something that doesn't change the output of the function g
. f
and g
both are Neural ODEs.
I want to learn the parameters of both f
and g
at the same time.
Any example code would help a lot!
Thanks in advance.
What's the meaning of x_state
? Does it coupled with g
?
Yes, there is a coupling between g
and x
.
Simply put, I want the function f to output something that doesn't change the output of the function g.
If this output x_state
doesn't affect g
, but you want to access it outside, I'd just create f
as an instance of a callable class instead of a function, and store x_state
inside as an attribute. After the ODE is solved you can access it outside.