This might not be your only problem, but if o0 is a row vector as you wrote there, you have:
w*w*wo*wo
as a term, where wo*wo is undefined as a vector operation, and also
+ Q^2*wo^4
wo to the power 4 is undefined similarly.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!