Hi, I am a newcomer to Julia and I am specifically interested in applying Julia to physics problems. I have already worked through differential equations and plotting and stuff, and I am quite drawn by the language and how fast it is.
I was wondering if there was a package or a method to implement the Lagrangian formalism using Julia.
For example, in Python, one can use SciPy and SymPy to define variables and the Lagrangian (as an equation, i.e., L = … ). We can then define the equations of motion as:
E_1 = sp.diff(L,x1) - sp.diff(sp.diff(L,x1_d),t).simplify()
And so on, for the other coordinates. These systems of equations can then be solved using sp.solve(), odeint() and so on.
From what I have seen, to solve DEs in Julia, a major requirement is that one should be able to write out the differential equation in a separable form, i.e.,
D(x) = \ ... , D being the derivative.
However, in most complicated scenarios equations might be coupled and it may not be possible to write them out in this manner. Is there a way that one can define a Lagrangian for a system and then have Julia compute the derivatives, equations of motions and then solve them?
Thanks in advance!!