JustPaste.it

clear;clc;
T_w=1; %Time needed to turn w 1 round around the z-axis
t_A=0.00001; %sample time
T=3;
w=2*pi/T; %angular frequency for w (absolute value)


t0=0.35; %start time
t=t0:t_A:t0+t_A; %generate 2 timestops
theta=w*t; %angle difference in radians
w_hat=[cos(2*pi/T_w*t);sin(2*pi/T_w*t); 0*t] %changing w_hat (unit) vector
%w_hat=[[1 1];0*t;0*t]; % Non changing w_hat vector (always points to
%x-axis)


R0=expm(skew(w_hat(:,1))*theta(1));
R1=expm(skew(w_hat(:,2))*theta(2));


R_dot=(R1-R0)/t_A %Approximatian for time-derivative
R_dot_analytic=(skew(w_hat(:,1))*w)*R0 %exact solution