In this question I ask about how to perform a first-principle derivation of the torsional constant of a section. It appears that there is no such analytical derivation for torsional constant, so my question therefore becomes: what about FEM derivation for torsional constant of arbitrary shapes section?
Note that I am not interesting in just using a FEM package without actually understanding the basic principle. I want to be able to derive the FEM formulation from first principles.