Text this: Hamiltonian and Lagrangian Dynamical Matrix Approaches Applied to Magnetic Nanostructures