Difference between revisions of "F-8 aircraft (Muscod)"

From mintOC
Jump to: navigation, search
m (Moved C to Muscod)
m (SebastianSager moved page F-8 aircraft (C) to F-8 aircraft (Muscod) without leaving a redirect: Moved C to Muscod)
(No difference)

Revision as of 10:16, 28 January 2016

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