-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathOmega_dot_omega.m
36 lines (31 loc) · 1.55 KB
/
Omega_dot_omega.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function Omega__dot_omega = Omega_dot_omega(omega_next, omega_prev, dt)
%‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
% [Eq. 126 Trawny]
% OMEGA_DOT_OMEGA Defines the derivative of the turn rate (omega_dot) and the associated matrix
% (Omega(omega_dot)), which - in the linear case - is constant.
%
% INPUT:
% * omega_next, Angular velocity omega(k+1) (3 x 1) vector [rad / s]
% * omega_prev, Angular velocity omega(k) (3 x 1) vector [rad / s]
% * dt, Time step (dt = t(k+1) - t(k)) scalar [s]
%
% OUTPUT:
% * Omega__dot_omega, Omega matrix (3 x 3) matrix
%
% Author: Livio Bisogni
%_______________________________________________________________________________________________________
% Check number of arguments
narginchk(3,3);
if (~isequal(size(omega_next), [3 1]))
error('omega_next must be a (3 x 1) vector.');
end
if (~isequal(size(omega_prev), [3 1]))
error('omega_prev must be a (3 x 1) vector.');
end
if (~isscalar(dt))
error('dt must be a scalar.');
end
% global dt
% [Eq. 126 Trawny]
Omega__dot_omega = Omega((omega_next - omega_prev) / dt);
end