The pseudospectral Legendre method for discretizing optimal control problems | Synapse