Practical Application of Optimal Control Theory: Computational approach