FEniCS Project Updated +Created
One big advantage over FreeFem is that it uses plain old Python to describe the problems instead of a domain-specific language. Matplotlib is used for plotting by default, so we get full Python power out of the box!
One downside is that its documentation is a Springer published PDF link.springer.com/content/pdf/10.1007%2F978-3-319-52462-7.pdf which is several years out-of-date (tested with FEnics 2016.2. Newbs. This causes problems e.g.: stackoverflow.com/questions/53730427/fenics-did-not-show-figure-nameerror-name-interactive-is-not-defined/57390687#57390687
system of partial differential equations are mentioned at: link.springer.com/content/pdf/10.1007%2F978-3-319-52462-7.pdf 3.5 "A system of advection–diffusion–reaction equations". You don't need to manually iterate between the equations.
On Ubuntu 20.04 as per fenicsproject.org/download/
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics
sudo apt install fenics
python3 -m pip install -u matplotlib
Before 2020-06, it was failing with:
E: The repository 'http://ppa.launchpad.net/fenics-packages/fenics/ubuntu focal Release' does not have a Release file.
but they seem to have created the Ubuntu 20.04 package as of 2020-06, so it now worked! askubuntu.com/questions/866901/what-can-i-do-if-a-repository-ppa-does-not-have-a-release-file
TODO heat equation hello world.
Lagrangian mechanics Updated +Created
Originally it was likely created to study constrained mechanical systems where you want to use some "custom convenient" variables to parametrize things instead of global x, y, z. Classical examples that you must have in mind include:
When doing lagrangian mechanics, we just lump together all generalized coordinates into a single vector that maps time to the full state:
where each component can be anything, either the x/y/z coordinates relative to the ground of different particles, or angles, or nay other crazy thing we want.
The Lagrangian is a function that maps:
to a real number.
Then, the stationary action principle says that the actual path taken obeys the Euler-Lagrange equation:
This produces a system of partial differential equations with:
  • equations
  • unknown functions
  • at most second order derivatives of . Those appear because of the chain rule on the second term.
The mixture of so many derivatives is a bit mind mending, so we can clarify them a bit further. At:
the is just identifying which argument of the Lagrangian we are differentiating by: the i-th according to the order of our definition of the Lagrangian. It is not the actual function, just a mnemonic.
Then at:
  • the part is just like the previous term, just identifies the argument with index ( because we have the non derivative arguments)
  • after the partial derivative is taken and returns a new function , then the multivariable chain rule comes in and expands everything into terms
However, people later noticed that the Lagrangian had some nice properties related to Lie group continuous symmetries.
Basically it seems that the easiest way to come up with new quantum field theory models is to first find the Lagrangian, and then derive the equations of motion from them.
For every continuous symmetry in the system (modelled by a Lie group), there is a corresponding conservation law: local symmetries of the Lagrangian imply conserved currents.
Genius: Richard Feynman and Modern Physics by James Gleick (1994) chapter "The Best Path" mentions that Richard Feynman didn't like the Lagrangian mechanics approach when he started university at MIT, because he felt it was too magical. The reason is that the Lagrangian approach basically starts from the principle that "nature minimizes the action across time globally". This implies that things that will happen in the future are also taken into consideration when deciding what has to happen before them! Much like the lifeguard in the lifegard problem making global decisions about the future. However, chapter "Least Action in Quantum Mechanics" comments that Feynman later notice that this was indeed necessary while developping Wheeler-Feynman absorber theory into quantum electrodynamics, because they felt that it would make more sense to consider things that way while playing with ideas such as positrons are electrons travelling back in time. This is in contrast with Hamiltonian mechanics, where the idea of time moving foward is more directly present, e.g. as in the Schrödinger equation.
Furthermore, given the symmetry, we can calculate the derived conservation law, and vice versa.
And partly due to the above observations, it was noticed that the easiest way to describe the fundamental laws of particle physics and make calculations with them is to first formulate their Lagrangian somehow: why do symmetries such as SU(3), SU(2) and U(1) matter in particle physics?s.
Bibliography:
Video 1.
Euler-Lagrange equation explained intuitively - Lagrangian Mechanics by Physics Videos by Eugene Khutoryansky (2018)
Source. Well, unsurprisingly, it is exactly what you can expect from an Eugene Khutoryansky video.
Lagrangian vs Hamiltonian Updated +Created
The key difference from Lagrangian mechanics is that the Hamiltonian approach groups variables into pairs of coordinates called the phase space coordinates:
  • generalized coordinates, generally positions or angles
  • their corresponding conjugate momenta, generally velocities, or angular velocities
This leads to having two times more unknown functions than in the Lagrangian. However, it also leads to a system of partial differential equations with only first order derivatives, which is nicer. Notably, it can be more clearly seen in phase space.