Tuesday, September 9, 2014

Solution of ODE’s using the State-Space Method


The state-space representation of




   provides a no-fuss approach to converting problems with 2nd order ODE’s. The derivative equations take the form

 


The derivative definition thus requires a matrix inversion for A. 

 


Matrix inversion can be performed using techniques such as Gauss-Jordan. Subroutine gaussj from Numerical Recipes can be effortlessly used for the inversion. Rather than perform the matrix inversion, Press et al recommend a LU-decomposition followed by an LU-back substitution to solve for the differential form. They suggest that using the LU-decomposition is “a factor of 3 better than subroutine gaussj”.

Following the recommendation of Press et al, the preferred way to solve for the differential form is to assume it to be a set of linear equations of the form

 


The derivative form is then obtained by performing an LU-decomposition of Q, followed by the LU-backsubstitution of the LU version of Q with P. Subroutines ludcmp and lubksb work superbly efficient for this case.

No comments:

Post a Comment