Ejemplo n.º 1
0
        public string Output()
        {
            StringBuilder sb = new StringBuilder();

            //sb.Append("TOTAL WEIGHT\tTOTAL QUANZHONG\t%RC" + Environment.NewLine);
            //sb.Append(TotalWeight.ToString("#0.000") + "\t");
            //sb.Append(TotalQuanzhong.ToString("#0.000") + "\t");
            //sb.Append(TotalRC.ToString("#0.000"));
            //sb.Append(Environment.NewLine);

            sb.AppendFormat("{0,-10}", "");
            sb.AppendFormat("{0,-15}", "TOTAL WEIGHT");
            sb.AppendFormat("{0,-18}", "TOTAL QUANZHONG");
            sb.AppendFormat("{0,-15}", "%RC");
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-10}", "ZERO");
            sb.AppendFormat("{0,-15}", ZeroWeight.ToString("#0.000"));
            sb.AppendFormat("{0,-18}", ZeroQuanzhong.ToString("#0.000"));
            sb.AppendFormat("{0,-15}", ZeroRC.ToString("#0.000"));
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-10}", "TAKEOFF");
            sb.AppendFormat("{0,-15}", TakeoffWeight.ToString("#0.000"));
            sb.AppendFormat("{0,-18}", TakeoffQuanzhong.ToString("#0.000"));
            sb.AppendFormat("{0,-15}", TakeoffRC.ToString("#0.000"));
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-10}", "LANDING");
            sb.AppendFormat("{0,-15}", LandingWeight.ToString("#0.000"));
            sb.AppendFormat("{0,-18}", LandingQuanzhong.ToString("#0.000"));
            sb.AppendFormat("{0,-15}", LandingRC.ToString("#0.000"));
            sb.Append(Environment.NewLine);

            return(sb.ToString());
        }
Ejemplo n.º 2
0
    private static void example_test(double a, double b, Func <double, double> f, string title)

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    example_test() tests zero_rc() on one test function.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    29 May 2021
    //
    //  Author:
    //
    //    John Burkardt
    //
    //  Input:
    //
    //    double A, B, the endpoints of the change of sign interval.
    //
    //    double F ( double x ), the function whose zero is being sought.
    //
    //    string TITLE, a title for the problem.
    //
    {
        double arg   = 0;
        double value = 0;

        Console.WriteLine("");
        Console.WriteLine("  " + title + "");
        Console.WriteLine("");
        Console.WriteLine("    STATUS      X               F(X)");
        Console.WriteLine("");

        double t = typeMethods.r8_epsilon();

        int status = 0;


        for (;;)
        {
            ZeroRC_data data = new();
            ZeroRC.zero_rc(ref data, a, b, t, ref arg, ref status, value);

            if (status < 0)
            {
                Console.WriteLine("");
                Console.WriteLine("  zero_rc() returned an error flag!");
                break;
            }

            value = f(arg);

            Console.WriteLine("  " + status.ToString().PadLeft(8)
                              + "  " + arg.ToString("0.################").PadLeft(24)
                              + "  " + value.ToString("0.######").PadLeft(14) + "");

            if (status == 0)
            {
                break;
            }
        }
    }
Ejemplo n.º 3
0
        public string OutputAll()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0,-25}", "");
            sb.AppendFormat("{0,-10}", "WEIGHT");
            sb.AppendFormat("{0,-18}", "DISTRIBUTION");
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "LOAD IN COMPARTMENTS");
            sb.AppendFormat("{0,-10}", LoadInCompartments.ToString());
            sb.AppendFormat("{0,-18}", LoadInCompartmentsDis);
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "PASSENGER/CABIN BAG");
            sb.AppendFormat("{0,-10}", Passenger.ToString());
            sb.AppendFormat("{0,-18}", PassengerDis);
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "MAX TRAFFIC PAY LOAD");
            sb.AppendFormat("{0,-10}", "15833");
            sb.AppendFormat("{0,-18}", "PAX 1/133");
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "TOTAL TRAFFIC LOAD");
            sb.AppendFormat("{0,-10}", (LoadInCompartments + Passenger).ToString());
            sb.AppendFormat("{0,-18}", "BLKD 0/2");
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "DRY  OPERATING  WEIGHT");
            sb.AppendFormat("{0,-10}", SelfWeight.DryOperationWeight.ToString());
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "ZERO FUEL WEIGHT ACTUAL");
            sb.AppendFormat("{0,-10}", (LoadInCompartments + Passenger + SelfWeight.DryOperationWeight).ToString());
            sb.AppendFormat("{0,-18}", "MAX 61000   ADJ");
            sb.Append(Environment.NewLine);
            sb.AppendLine("------------------------------------------------------");
            sb.AppendFormat("{0,-25}", "TAKE OFF FUEL");
            sb.AppendFormat("{0,-10}", TakeoffFuel.Weight.ToString());
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "TAKE OFF WEIGHT ACTUAL");
            sb.AppendFormat("{0,-10}", (LoadInCompartments + Passenger + SelfWeight.DryOperationWeight + TakeoffFuel.Weight).ToString());
            sb.AppendFormat("{0,-18}", "MAX 77000   ADJ");
            sb.Append(Environment.NewLine);
            sb.AppendLine("------------------------------------------------------");
            sb.AppendFormat("{0,-25}", "TRIP FUEL");
            sb.AppendFormat("{0,-10}", TripFuelWeight.ToString());
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "LANDING WEIGHT ACTUAL");
            sb.AppendFormat("{0,-10}", (LoadInCompartments + Passenger + SelfWeight.DryOperationWeight + LandingFuel.Weight).ToString());
            sb.AppendFormat("{0,-18}", "MAX 64500   ADJ");
            sb.Append(Environment.NewLine);
            sb.AppendLine("------------------------------------------------------");
            sb.AppendLine("BALANCE AND SEATING CONDITION      LAST MINUTE CHANGES");
            sb.AppendLine("DOI    " + SelfWeight.DryOperationIndex.ToString());
            sb.AppendFormat("{0,-25}", "MAC ZERO FUEL WEIGHT");
            sb.AppendFormat("{0,-10}", ZeroRC.ToString("#0.000"));
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "MAC TAKE OFF WEIGHT");
            sb.AppendFormat("{0,-10}", TakeoffRC.ToString("#0.000"));
            sb.Append(Environment.NewLine);
            sb.AppendFormat("{0,-25}", "MAC LANDING WEIGHT");
            sb.AppendFormat("{0,-10}", LandingRC.ToString("#0.000"));
            sb.Append(Environment.NewLine);

            return(sb.ToString());
        }