Hello, i am working in a project which now requires me to solve some linear equations in a recursive way (ricatti equation) because i would like to use linear cuadratic control in a system.

In particular, i am trying to solve this equations with my gpu:

u[k] = - K[k]*x[k]

K[k] = ((R + B’*S[k+1]*B)^(-1) )B’*S[k+1] A*K[k]) + Q + K[k]'

S[k] = (A-BK[k])'S[k+1](A-B

*R*K[k]

For this system A, B, R, Q, S[k0] are sparse ones. Maybe i should use many libraries together or a library and a kernel done by myself.

I am with cuda 4.0 and i have been seeing CUBLAS, CUSPARSE and CULA (free edition)…

What would you reccommend me to use or to do with this problem to get the fastest result? Nothing seems to satisfy me…

Thanks for your help!