  Minimization of energy functionals is based on a discretization by the finite
element method and optimization by the trust-region method. A key tool is a
local evaluation of the approximated gradients together with sparsity of the
resulting Hessian matrix. We describe a vectorized MATLAB implementation of the
p-Laplace problem in one and two space-dimensions, however it is easily
applicable to other energy formulations.
