LowThrustGVE_EventFcn:
% Stopping event function for low thrust GVE sim using ode solver.
Terminate when the abs value of difference between current element and
desired element is less than tolerance.
--------------------------------------------------------------------------
Form:
[value,isterminal,direction] = LowThrustGVE_EventFcn(t,y,k,ykdes,tol)
--------------------------------------------------------------------------
------
Inputs
------
t (1,1) Time
y (6,1) State vector
k (1,1) Index of element to check (1 <= k <= 6)
ykdes (1,1) Desired value of kth element
tol (1,1) Threshold passing tolerance
-------
Outputs
-------
value (1,1) Value of function evaluation
isterminal (1,1) 1 - terminal condition
direction (1,1) 0 - direction does not matter
--------------------------------------------------------------------------