Here is my sheet. non_linear_P2_last_q.mw
In this problem I have achieved every thing what I aimed, thnaks to the wonderful people here!!!
I am looking for a way to do it in a more structured way meaning the calculation of Jacobian in the attached sheet is somewhat manuel, though I wonder does maple has some other way?