This is done in optimal control theory, in the form of Pontryagin's minimum principle.
Optimal kontrol teorisinde bu yapılmıştır, Pontryagin's minimum prensibi formunda.