Personal tools

StrideMap.m

StrideMap.m — Objective-C source code, 0Kb

File contents

function [t,F,Fk] = StrideMap(Xk)

global TSPAN                                   % integration time span

options = odeset('RelTol',1e-7,'AbsTol',1e-8,'Events',@stepevents);
[t,F,te,qe,ie] = ode45(@EOM,TSPAN,Xk,options);
% t = n x 1 (column) vector of integration time points; 
% F = n x 4 vector showing the states at each corresponding time point
% te = event_results_qe = qe
% pause(3.0)


if ie(end) == 1 % If the step is successful, compute the post-impact state 
    F_pre = F(end,:)';                  % Define system's state before impact    
    Fk = TransEqns(F_pre);              % Post-Impact State
else
    Fk = zeros(size(Xk));   % otherwise, return zeros for the post-impact state
end


end













Document Actions