A mass m is suspended by a massless spring of spring constant k and unstretched length b. The suspension point has a constant upward acceleration a0. Gravity is acting vertically downward. Find the Lagrangian and Hamiltonian functions and obtain Hamilton's equations of motion.