示例#1
0
文件: SolverRotor.cs 项目: ysdavy/AJE
        public SolverRotor(float omega, float r, float weight, float power0, float rho0, float buff, float BSFC, bool useOxygen, int clockWise)
        {
            this.omega0    = omega;
            this.r         = r;
            this.weight    = weight;
            this.power0    = power0;
            this.rho0      = rho0;
            this.buff      = buff;
            this.BSFC      = BSFC;
            this.useOxygen = useOxygen;
            this.clockWise = clockWise;

            AoA0          = 20f;
            CL0           = 6 * 9.80665f * weight / rho0 / omega0 / omega0 / r / r;
            LDR0          = 3f * r * 9.80665f * weight * omega0 / 4f / power0;
            CD0           = CL0 / LDR0;
            inertia       = weight / 15 / 3 * r * r * r; //assume the rotor is 1/15 of max take-off weight
            this.omega    = 1;
            this.power    = 0;
            this.dihedral = 0;
            float tau = 30 / omega0;

            smoothinputX = new SmoothInput(tau / 2);
            smoothinputY = new SmoothInput(tau / 2);
            smoothinputZ = new SmoothInput(tau);
            smoothinputP = new SmoothInput(1e-6f);
        }
示例#2
0
        public override void OnStart(StartState state)
        {
            if (state == StartState.Editor)
            {
                return;
            }
            if (vessel == null)
            {
                return;
            }

            float omega = rpm * 0.1047f;

            takeoffLift = power * 745.7f / omega / r; //in newton
            yawPID1     = new PIDController((int)(1 / Time.fixedDeltaTime));
            yawPID2     = new PIDController((int)(1 / Time.fixedDeltaTime));
            t           = part.FindModelTransform(thrustVectorTransformName);
            smoothinput = new SmoothInput(0.5f);
        }