What is the best way for Solving an Optimal Control Theory?

Dear All,

I’m working on an Control Theory problem in the economic area and have to solve the Hamiltonian function. Is there any built in function or packaage? Can I use Variational Method Package?

Many Thanks
Faazel

Can any body help me on this issue?