The way to describe the equations in NGSolve is very close to the variational formulation (the virtual displacement formulation).