Numerical integration RK4 for the given data

I have the angular veocity data shown below and wanted to apply , where.
w
Columns 1 through 9
5.0468 0.1049 -0.1582 -0.4549 -0.7088 -0.8615 -0.8758 -0.7409 -0.4740
3.2405 0.6230 0.6264 0.5425 0.3348 0.0279 -0.3276 -0.6692 -0.9351
-0.0000 -0.0049 -0.0119 -0.0229 -0.0369 -0.0526 -0.0687 -0.0837 -0.0962
Columns 10 through 18
-0.1169 0.2715 0.6264 0.8889 1.0163 0.9908 0.8218 0.5447 0.2142
-1.0766 -1.0664 -0.9047 -0.6183 -0.2562 0.1194 0.4448 0.6665 0.7518
-0.1053 -0.1100 -0.1100 -0.1053 -0.0962 -0.0837 -0.0687 -0.0526 -0.0369
Columns 19 through 22
-0.1062 -0.3561 -0.4855 5.7553
0.6957 0.5261 0.3291 1.6874
-0.0229 -0.0119 -0.0049 -0.0000
%The skew matrix is given by
W= [ 0,-w(1),-w(2),-w(3);
w(1), 0, omg(3),-w(2);
w(2),-w(3), 0, w(1);
w(3), w(2),-w(1), 0];
Apperciated !

댓글 수: 6

James Tursa
James Tursa 2020년 8월 18일
편집: James Tursa 2020년 8월 18일
It is not clear to me what you are trying to do. Your qk equation above looks more like a quaternion derivative formula than an integrator. And your w data is rapidly changing so even if you were integrating this I'm not sure you would get meaningful results. I'm assuming that omg(3) is supposed to be w(3)? How does RK4 fit into this? Can you clarify?
HN
HN 2020년 8월 18일
Yes, qk is quatenion derivative that maps angular velocity to so(3). RK4 is to get quaternion from qdot which is given by the formula in the quesion. If we initialize q and change [wx] , rk4 gives quaternion. I know how to do it when w is given in formulat as function of time (w(t). But I am trapped to deal with the numerical data.
Yes, The number is rapidly changed due to my example sampling rate. In actual case, I have 1/1000 step size.
Thank you .
James Tursa
James Tursa 2020년 8월 18일
You could interpolate the w sampled data to give you w(t) for your integration. Or if you have finer sampled data you could assume constant rate between sample points for your w(t).
HN
HN 2020년 8월 18일
편집: HN 2020년 8월 18일
Did you consider that direct integration of w cannot give angular information. If I didn't misunderstand what you are telling me, quaternion derivative is required to resolve this issue. Can you try to show me with some example?
Thank you
James Tursa
James Tursa 2020년 8월 18일
You stated that w is angular rate and you have that data. You have a formula for quaternion derivative as a function of angular rate w. Why can't you integrate that to give the quaternion as a function of time?
James Tursa
James Tursa 2020년 8월 18일
편집: James Tursa 2020년 8월 18일
What are the units of your sampled w? Those numbers look way too large for rad/sec.

댓글을 달려면 로그인하십시오.

 채택된 답변

James Tursa
James Tursa 2020년 8월 18일
편집: James Tursa 2020년 8월 18일

0 개 추천

E.g., a VERY SIMPLISTIC approach showing one step of Euler integration
dt = some delta time value
q = [1,0,0,0]; % Initial quaternion, scalar first
w = a 1x3 angular rate vector in rad/sec from your sampled data
qdot = 0.5 * quatmultiply( q, [0 w] ); % Assuming right chain convention
q = q + qdot * dt; % One Euler step
This is just to show a very basic idea. In practice, one would use more sophisticated methods of integration.

댓글 수: 3

HN
HN 2020년 8월 18일
Euler has a consequence of large error. Like er=10e-4. I need quite close to the desired value 10e-10 or above. Thats why I tried to avoid euler.
James Tursa
James Tursa 2020년 8월 18일
You want 10e-10 integration accuracy using noisy sampled data? Really?
HN
HN 2020년 8월 18일
편집: HN 2020년 8월 18일
Don't you think RK4 can give that accuracy if we use small sample size. My actual data is 3x1001. Not noisy as it is shown above.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

HN
2020년 8월 18일

편집:

HN
2020년 8월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by