I have an energy functional which I want to optimize using calculus of variation.
It would be nice if someone could please post a working example using mathematica. The procedure is as follows, specify the energy functional, compute the Euler-Lagrange equation, discretize them and if possible run for a sample data.
There are some links to the package for calculus of variation. But none of them is providing a complete example as I have described in the above paragraph.
UPDATE1
I am trying the simple Lucas-and-Kanade energy functional
$E(u(x_0,y_0),v(x_0,y_0)) = \int(f_x(x,y,t)u+f_y(x,y,t)v+f_t)dx dy$
I have tried to do it with [this link]
UPDATE2
The correct form of the energy functional is, courtesy of [rcollyer]
$E(u(x,y),v(x,y)) = \int(f_x(x,y,t)u+f_y(x,y,t)v+f_t)^2dx dy$
The question is now how to descritize the Euler-Lagrange equations. and solve it for some artificial data. (this is not extra thing specified in the question already)
* UPDATE3* the complete solution procedure is as follows:
The E-L equations for the integrand of the above energy functional are as follows and we set the first variation to zero
$2f_x(f_x(x,y,t)u+f_y(x,y,t)v+f_t)=0$
$2f_y(f_x(x,y,t)u+f_y(x,y,t)v+f_t)=0$
in the matrix form it will look as follows
Now we can simply solve for u and v because we have two equations and two unknowns but the derivatives are needed to be descritized. For example if we take the forward difference assuming the distance is 1
$f_x = f_{i+1}-f_{i}$
$f_y = f_{j+1}-f_{j}$
In above equations i and j represent the indexing in x and y direction respectively.
$f_t = f_{2}-f_{1}$
Here in the above equation the function is described by indices 1 and 2 describe the function in the temporal direction. (Mathematica provides a lot of variety for descritizing as per the documentation)
So the idea is to be able to replace the derivative with finite differences and we should be able to solve the equation system for u and v given the data.
thanks a lot