Question: Minimize
F(x,p)
F(x,p)=∫0Tf(x,p,t)dt(1) Subject to
g(x0,p)=x0−p=0(2) -> If given x0, we can compute p at t=0 through g(x0,p), then substitue xt and p in h(xt,x˙t,p,t) and can compute x˙t
Apply Lagrangian function L(x,λ)=f(x)−λg(x) and combine (1) (2) (3) in one loss function
Loss=∫0T[f(x,p,t)+λTh(xt,x˙t,p,t)]dt+uTg(x0,p)(4) Substitute (2) (3)
Loss=∫0T[f(x,p,t)+λT0]dt+uT0=∫0Tf(x,p,t)dt=F(x,p)(5) ∂p∂L=∂p∂F(6) approximation using updated derivative ∂p∂L=∂p∂F=∫0T[∂x∂f⋅∂p∂x+∂p∂f+λT(∂x∂h⋅∂p∂x+∂x˙∂h⋅∂p∂x˙+∂p∂h)]dt+uT(∂x0∂g⋅∂p∂x0+∂p∂g) To avoid compute ∂p∂x˙ , we apply integration by parts ∫udv=uv−∫vdu
∂p∂L=∂p∂L