Thanks. So if the capsule is at 0 pitch then I want to simulate the shift of the center of gravity. The craft should tilt the 20 degrees, right?
and then this:
[/CODE]
I get this:
Error 2 error C2065: 'VLiftCoeffAoA0' : undeclared identifier C:\orbiter100830\Orbitersdk\samples\MSLBACKSHELL\MSLBACKSHELL.CPP 133 1 MSLBACKSHELL
I feel like I am missing something.
Code:
void VLiftCoeff(double aoa, double M, double Re, double *cl, double *cm, double *cd, double desired_trim_angle)
{
static const double step = RAD*15.0;
static const double istep = 1.0 / step;
static const int nabsc = 25;
// static const double CL[nabsc] = { 0.1, 0.17, 0.2, 0.2, 0.17, 0.1, 0, -0.11, -0.24, -0.38, -0.5, -0.5, -0.02, 0.6355, 0.63, 0.46, 0.28, 0.13, 0.0, -0.16, -0.26, -0.29, -0.24, -0.1, 0.1 };
static const double CL[nabsc] = { 0.1, 0.17, 0.2, 0.2, 0.17, 0.1, 0, -0.11, -0.24, -0.38, -0.5, -0.5, -0.02, 0.6355, 0.63, 0.46, 0.28, 0.13, 0.0, -0.16, -0.26, -0.29, -0.24, -0.1, 0.1 };
static const double CM[nabsc] =
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.002, 0.004, 0.0025, 0.0012, 0, -0.0012, -0.0007, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// -180, -165, -150, -135, -120, -105, -90, -75, -60, -45, -30, -15, 0, 15, 30, 45,
// static const double CM[nabsc] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.002, 0.004, 0.0025, 0.0012, 0, -0.0012, -0.0007, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// lift and moment coefficients from -180 to 180 in 15 degree steps.
// This uses a documented lift slope of 0.0437/deg, everything else is rather ad-hoc
aoa -= desired_trim_angle;
//aoa += PI*2;
int idx = max(0, min(23, (int)(aoa*istep)));
double d = aoa*istep - idx;
*cl = CL[idx] + (CL[idx + 1] - CL[idx])*d;
*cm = CM[idx] + (CM[idx + 1] - CM[idx])*d;
*cd = 0.06 + oapiGetInducedDrag(*cl, 2.266, 0.6);
}
Code:
CreateAirfoil(LIFT_VERTICAL, _V(0, -0.01, -0.1), VLiftCoeffAoA0, 5.5, 0, 1.27);
//CreateAirfoil(LIFT_VERTICAL, _V(0, -0.01, -0.1), VLiftCoeff, 5.5, 0, 1.27);
CreateAirfoil(LIFT_HORIZONTAL, _V(0, 0, 0.01), HLiftCoeff, 5.5, 0, 1.27);
I get this:
Error 2 error C2065: 'VLiftCoeffAoA0' : undeclared identifier C:\orbiter100830\Orbitersdk\samples\MSLBACKSHELL\MSLBACKSHELL.CPP 133 1 MSLBACKSHELL
I feel like I am missing something.
Last edited: