## LPEccentricGVE:

```--------------------------------------------------------------------------
Computes the thrust trajectory to go from an initial state x0 to a
final state xF (relative states defined as element differences).
Simplex is used to optimize the thrust.
This algorithm is valid for circular or eccentric reference orbits.
It does not however account for disturbances or gravity perturbations.

A control system can be expressed in its discrete state-space form as:
X(k+1)      = A(k)X(k) + B(k)U(k)
Y(k)        = C(k)X(k)
where X is state , U is control, Y is output
For the nth timestep, this can be rewritten as:
X(n)        = A(n-1)*A(n-2)...A(n-n)*X(0) + [A(n-1)*A(n-2)...A(n-(n-1))*B   A(n-1)*A(n-2)...A(n-(n-2))*B ..... B]u
where u     = [ U(0)' U(1)' ..... U(n-1)']'
For a fully controllable and observable system,
Y(n) = X(n) = A(n-1)*A(n-2)...A(n-n)*X(0) + pu where p = [A(n-1)*A(n-2)...A(n-(n-1))*B   A(n-1)*A(n-2)...A(n-(n-2))*B ..... B]
error       >= |Y(n) - Y(desired)| = A(n-1)*A(n-2)...A(n-n)*X(0) + pu - Y(desired)

The Simplex problem (minimise cu(cost) such that au <= b) and u >= 0 can now be posed as
[-p; p]u    <= [error + A(n-1)*A(n-2)...A(n-n)*X(0) - Y(desired); error - A(n-1)*A(n-2)...A(n-n)*X(0) + Y(desired)]
In case of an Equality Constraint with 0 error, this reduces to
[-p]u        =  A(n-1)*A(n-2)...A(n-n)*X(0) - Y(desired)
Note: The constraintType determines whether it is an equality
technological constraint( au = b, flag: 0) or an inequality technological
constraint( au <= b, flag: 1)

u are called 'decision variables', in this case thrust vector
Since u is unrestricted in sign (u can be positive and negative),
we split u into two parts: u=up-um, where up>=0 and um>=0.

Since version 7.
--------------------------------------------------------------------------
Form:
[aC,t,exitFlag] = LPEccentricGVE( el0, x0, xF, MF, nS, cW, cType, maxC);
--------------------------------------------------------------------------

------
Inputs
------
el0              (1,6)  Initial orbital elements [a,i,W,w,e,M]
x0               (6,1) Initial relative state, as element differences
xF               (6,1) Final relative state, as element differences
MF                (1)  Final mean anomaly (rad)
nS                (1)  Number of samples to use for control vector
cW                (:)  Cost weighting vector (optional)
cType             (1)  Flag with value 0 or 1 (optional, default: 0)
0 : Equality Constraint on the Linear program formulation
1 : Inequality Constraint on the Linear program
formulation
maxC              (1)  Maximum constraint on u (optional, default: 1e25)

-------
Outputs
-------
aC               (3,nS)   Commanded acceleration in Hill's frame
t                (1,nS+1) Time vector (sec)
exitFlag          (1)     Feasible solution = 1, No feasible solution = 0
--------------------------------------------------------------------------
```

## Children:

```Common: Control/C2DZOH
Math: Analysis/Simplex
Math: Linear/Mag
Math: Trigonometry/UnwrapPhase
Orbit: OrbitMechanics/GVEDynamics
OrbitMiniToolbox: Support/M2Nu
SC: BasicOrbit/M2NuAbs
SC: BasicOrbit/Nu2M
SC: BasicOrbit/OrbRate
```