Hi Ben, first of all thank you for this very nice mechanical project.
I tried to use your example to solve the ode of the inverse pendulum.
The NN with two outputs works fine, but adding the physics loss does not help to extrapolate the equations (after more than 200.000 episodes).
You can find my code here: https://github.com/lennart2810/InvertedPendulumSDS/blob/master/PINN/InvertedPendulum/Inverse%20Pendulum%20PINN.ipynb
I had a quick look at your code, it all looks reasonable, the two lines I would check are:
rather than what you have at the moment. Also I would trial a few different scalar values of lambda_x and lambda_theta above; the physics loss needs to be balanced well with the data loss for it to converge well.
Hi Lennart, super cool application of PINNs to the inverted pendulum. Replying to your question on my blog post (https://benmoseley.blog/my-research/so-what-is-a-physics-informed-neural-network/) here for ease. Here is the question:
I had a quick look at your code, it all looks reasonable, the two lines I would check are:
when training the PINN. I am assuming these are your (coupled) equations of motion (from the repo readme.md?)
If so I think you would need two physics loss terms in the loss function (one for each equation of motion), i.e.
rather than what you have at the moment. Also I would trial a few different scalar values of lambda_x and lambda_theta above; the physics loss needs to be balanced well with the data loss for it to converge well.