# Euler-Lagrange as a Sparse matrix

1. Mar 5, 2012

### matia

Hello,
I want to represent Euler-Lagrange equations in a (sparse) matrix form, such that; Az=b.
(in order to improve performance when solving).
I know A should be diagonal block, very large, and sparse.
my equations are:

1. -ψ'(Ix*Iz) + $\gamma$ψ'(Ixx*Ixz + Ixz + Ixy*Iyy) - βη(ψ'(u-u1).
2. -ψ'(Iy*Iz) + $\gamma$ψ'(Iyy*Iyz + Ixy*Ixz) - βη(ψ'(v-v1).

η - means some kind of neighboring of u.

I know it should looks something like:
Az=b:
where
z = [u1 v1 u2 v2 ....un vn]τ (column vector).
b = - [ψ'xz + βηU IxIz + βηV ... ] (Alternately) --> I'm not so sure here..
and A is very large, and saprse, of size 2*(n*n) - where n is the number of values I have.

Are z and b correct ? How should A be constructed ?
Thanks
Matia