adding lagrangian.m file