F-8 aircraft (Muscod)

From mintOC
Revision as of 16:56, 11 August 2009 by SebastianSager (Talk | contribs) (Initial setup)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The differential equations for the F-8 aircraft problem in C code read as follows

  double x1 = xd[0];
  double x2 = xd[1];
  double x3 = xd[2];
 
#ifdef CONVEXIFIED
  double xi = 0.05236;
 
  rhs[0] = -0.877*x1 + x3 - 0.088*x1*x3 + 0.47*x1*x1 - 0.019*x2*x2 -x1*x1*x3 + 3.846*x1*x1*x1
	         + 0.215*xi - 0.28*x1*x1*xi + 0.47*x1*xi*xi - 0.63*xi*xi*xi
	         - 2*u[0] * ( 0.215*xi - 0.28*x1*x1*xi - 0.63*xi*xi*xi );
  rhs[1] = x3;
  rhs[2] = - 4.208*x1 - 0.396*x3 - 0.47*x1*x1 - 3.564*x1*x1*x1
	         + 20.967*xi - 6.265*x1*x1*xi + 46*x1*xi*xi - 61.4*xi*xi*xi
	         - 2*u[0] * ( 20.967*xi - 6.265*x1*x1*xi - 61.4*xi*xi*xi );
#else
  double u_ = -0.05236 + u[0]*2.0*0.05236;
 
  rhs[0] = -0.877*x1 + x3 - 0.088*x1*x3 + 0.47*x1*x1 - 0.019*x2*x2
           -x1*x1*x3 + 3.846*x1*x1*x1 - 0.215*u_ + 0.28*x1*x1*u_ + 0.47*x1*u_*u_ + 0.63*u_*u_*u_;
  rhs[1] = x3;
  rhs[2] = -4.208*x1 - 0.396*x3 - 0.47*x1*x1 - 3.564*x1*x1*x1
           - 20.967*u_ + 6.265*x1*x1*u_ + 46*x1*u_*u_ + 61.4*u_*u_*u_;
#endif