Replies: 3 comments 3 replies
-
Your problem is an ODE system, so you can use |
Beta Was this translation helpful? Give feedback.
-
If your problem is PDE, then you need to use |
Beta Was this translation helpful? Give feedback.
-
Hello Prof. Lu, when runing deepxde for a inversion problem, how to constain values of external_trainable_variables, and let them to be positive during training, thank you so much |
Beta Was this translation helpful? Give feedback.
-
Hello, I was just wondering if anyone can provide a basic example of how one might use the data.constraint function of deepxde (see https://deepxde.readthedocs.io/en/latest/_modules/deepxde/data/constraint.html?highlight=constraint). From the documentation, all I see is a link to the source code, which I don't understand because I'm not well-versed enough in python and defining classes. I'm presuming this is what's needed to place constraints on the data generated by the program? I've looked for similar questions but have only found specific answers that don't seem to pertain to what I'm doing.
If it helps to give the background, I'm working with a group on trying to solve the equation of motion for the two body problem, written as the effective one body problem. The equations of motion, in dimensionless form, is:
• (dr/dt)^2 = [(e^2 - 1) + 1/r - 1/r^2] = (e*sin(theta))^2 -- and --
• dtheta/dt = 1/2r^2
where (r, theta, e) are the radius, polar angle and eccentricity. If I use (dr/dt)^2 = [(e^2 - 1) + 1/r - 1/r^2] as my loss, then I get bad results -- mainly, the algorithm always runs to a circular orbit. If I use dr/dt = e*sin(theta), then the algorithm seems to (a) prefer negative radii/theta and (b) not want theta to change signs, and prefers a solution where theta increases asymptotically towards zero. My guess is that the squared terms are causing problems, as well as the fact that the diff eqn for radius yields a minimum radius, which the algorithm is trying desperately to avoid going below.
I put a picture below to illustrate -- I have the initial theta set to -pi, and as you can see theta increases asymptotically towards zero while r seems to exponentially decay to compensate. Additionally, if I set the initial condition on theta to be somewhere were sin(theta) >= 0, then the solution tends to jump immediately to a negative theta and then again increase asymptotically towards zero.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions