Esempio n. 1
0
def main():
    problem = setup()
    
    ## Base Input Values
    #output = problem.objective()
    
    ## Uncomment to view contours of the design space
    #variable_sweep(problem)
    
    ## Uncomment for the first optimization
    output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
    print (output)    
    
    ## Uncomment these lines when you want to start an optimization problem from a different initial guess
    #inputs                                   = [1.28, 1.38]
    #scaling                                  = problem.optimization_problem.inputs[:,3] #have to rescale inputs to start problem from here
    #scaled_inputs                            = np.multiply(inputs,scaling)
    #problem.optimization_problem.inputs[:,1] = scaled_inputs
    #output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
    #print output        
  
    print('fuel burn = ', problem.summary.base_mission_fuelburn)
    print('fuel margin = ', problem.all_constraints())
    
    Plot_Mission.plot_mission(problem)
    
    return
Esempio n. 2
0
def main():

    problem = setup()
    output = scipy_setup.SciPy_Solve(problem)

    problem.translate(output)

    Plot_Mission.plot_mission(problem.results.mission)

    return
Esempio n. 3
0
def main():

    problem = setup()
    output = scipy_setup.SciPy_Solve(problem, sense_step=0.0005)

    ## Uncomment these lines when you want to start an optimization problem from a different initial guess
    #inputs                                   = [1.28, 1.38]
    #scaling                                  = problem.optimization_problem.inputs[:,3] #have to rescale inputs to start problem from here
    #scaled_inputs                            = np.multiply(inputs,scaling)
    #problem.optimization_problem.inputs[:,1] = scaled_inputs
    #output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')

    problem.translate(output)

    Plot_Mission.plot_mission(problem)

    return
Esempio n. 4
0
def main():

    problem = setup()

    ## Base Input Values
    output = problem.objective()

    # Uncomment to view contours of the design space
    #variable_sweep(problem)

    # Uncomment for the first optimization
    output = scipy_setup.SciPy_Solve(problem, solver='SLSQP')
    print(output)

    print('fuel burn = ', problem.summary.base_mission_fuelburn)
    print('fuel margin = ', problem.all_constraints())

    Plot_Mission.plot_mission(problem)

    return
Esempio n. 5
0
def main():

    problem = setup()
    output = scipy_setup.SciPy_Solve(problem)

    print output

    ## Uncomment to view contours of the design space
    variable_sweep(problem)

    ## Uncomment these lines when you want to start an optimization problem from a different initial guess
    #inputs                                   = [1.28, 1.38]
    #scaling                                  = problem.optimization_problem.inputs[:,3] #have to rescale inputs to start problem from here
    #scaled_inputs                            = np.multiply(inputs,scaling)
    #problem.optimization_problem.inputs[:,1] = scaled_inputs
    #output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')

    problem.translate(output)

    Plot_Mission.plot_mission(problem.results.mission)

    return
Esempio n. 6
0
def main():

    t0 = time.time()

    problem = setup()

    ## Base Input Values
    output = problem.objective()
    print output
    Plot_Mission.plot_mission(problem, -1)

    # # Uncomment to view contours of the design space
    # variable_sweep(problem)

    print ' '
    print ' Initial Guess Results '
    print ' '
    print 'Fuel Burn   = ', float(problem.summary.base_mission_fuelburn)
    print 'Cruise Fuel = ', float(problem.summary.cruise_fuel)
    print 'Block  Fuel = ', float(problem.summary.block_fuel)
    print 'MTOW        = ', float(problem.summary.MTOW)
    print 'BOW         = ', float(problem.summary.BOW)
    print 'TOFL        = ', float(problem.summary.takeoff_field_length)
    print 'GRAD        = ', float(
        problem.summary.second_segment_climb_gradient_takeoff)
    print 'Cruise Alt  = ', float(problem.summary.cruise_altitude)
    print 'Design Ran  = ', float(problem.summary.design_range)
    print 'Cruise Ran  = ', float(problem.summary.cruise_range)
    print 'Total Ran   = ', float(problem.summary.total_range)
    print 'Time To Cli = ', float(problem.summary.time_to_climb_value)
    print 'TOW HH      = ', float(problem.summary.TOW_HH)
    print 'Fuel HH     = ', float(problem.summary.FUEL_HH)
    print ' '
    print 'Constraints = ', problem.all_constraints()
    print ' '

    # ------------------------------------------------------------------
    # Pareto

    fuelburn = []
    allconstraints = []
    MTOW = []
    finalvalue = []
    grad = []
    tofl = []

    # betas = [1., 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.]
    # betas = [1., 0.75, 0.5, 0.25, 0.]
    betas = [0.]
    # fid = open('Pareto_results.txt', 'w')  # Open output file
    # fid.write(' Pareto results \n')
    # fid.close()

    for i, beta in enumerate(betas):
        fid = open('Pareto_results.txt', 'ab')  # Open output file
        fid.write('Pareto Frontier. Run number: ' + str(i) + ' \n')
        print('Pareto Frontier. Run number: ' + str(i))

        # updating Beta value
        design_vars = problem.optimization_problem.inputs[:, 1]
        design_vars[-1] = beta
        design_vars[0] = 70.43381
        design_vars[1] = 9.613779
        design_vars[2] = 0.12272157
        design_vars[3] = 24.391733
        design_vars[4] = 1106.5334
        problem.optimization_problem.inputs[:, 1] = design_vars

        bounds = problem.optimization_problem.inputs[:, 2]
        bounds[-1] = list(bounds[-1])
        bounds[-1][0] = beta
        bounds[-1][1] = beta
        bounds[-1] = tuple(bounds[-1])
        problem.optimization_problem.inputs[:, 2] = bounds

        output = scipy_setup.SciPy_Solve(problem, solver='SLSQP')
        print output
        print ' '
        print ' Final Results '
        print ' '
        print 'Fuel Burn   = ', float(problem.summary.base_mission_fuelburn)
        print 'Cruise Fuel = ', float(problem.summary.cruise_fuel)
        print 'Block  Fuel = ', float(problem.summary.block_fuel)
        print 'MTOW        = ', float(problem.summary.MTOW)
        print 'BOW         = ', float(problem.summary.BOW)
        print 'TOFL        = ', float(problem.summary.takeoff_field_length)
        print 'GRAD        = ', float(
            problem.summary.second_segment_climb_gradient_takeoff)
        print 'Cruise Alt  = ', float(problem.summary.cruise_altitude)
        print 'Design Ran  = ', float(problem.summary.design_range)
        print 'Cruise Ran  = ', float(problem.summary.cruise_range)
        print 'Total Ran   = ', float(problem.summary.total_range)
        print 'Time To Cli = ', float(problem.summary.time_to_climb_value)
        print 'TOW HH      = ', float(problem.summary.TOW_HH)
        print 'Fuel HH     = ', float(problem.summary.FUEL_HH)
        print ' '
        print 'Constraints = ', problem.all_constraints()

        Plot_Mission.plot_mission(problem, i)

        finalvalue.append(output)
        fuelburn.append(problem.summary.base_mission_fuelburn)
        allconstraints.append(problem.all_constraints())
        grad.append(problem.summary.second_segment_climb_gradient_takeoff)
        tofl.append(problem.summary.takeoff_field_length)
        MTOW.append(problem.summary.MTOW)

        fid.write(str(fuelburn[-1]) + ' \n')
        fid.write(str(grad[-1]) + ' \n')
        fid.write(str(tofl[-1]) + ' \n')
        fid.write(str(MTOW[-1]) + ' \n')
        fid.write(str(allconstraints[-1]) + ' \n')
        fid.write(str(finalvalue[-1]) + ' \n')
        fid.write('\n \n')
        fid.close()

    fid = open('Pareto_results.txt', 'ab')  # Open output file
    elapsed = time.time() - t0

    fid.write('Total run time: ' + str(elapsed))
    print('Total run time: ' + str(elapsed))

    fid.close()

    return
Esempio n. 7
0
def main():

    t0 = time.time()

    problem = setup()

    ## Base Input Values
    output = problem.objective()
    print output
    Plot_Mission.plot_mission(problem, -1)

    # # Uncomment to view contours of the design space
    # variable_sweep(problem)

    print ' '
    print ' Initial Guess Results '
    print ' '
    print 'Fuel Burn   = ', float(problem.summary.base_mission_fuelburn)
    print 'Cruise Fuel = ', float(problem.summary.cruise_fuel)
    print 'Block  Fuel = ', float(problem.summary.block_fuel)
    print 'MTOW        = ', float(problem.summary.MTOW)
    print 'BOW         = ', float(problem.summary.BOW)
    print 'TOFL        = ', float(problem.summary.takeoff_field_length)
    print 'GRAD        = ', float(problem.summary.second_segment_climb_gradient_takeoff)
    print 'Cruise Alt  = ', float(problem.summary.cruise_altitude)
    print 'Design Ran  = ', float(problem.summary.design_range)
    print 'Cruise Ran  = ', float(problem.summary.cruise_range)
    print 'Total Ran   = ', float(problem.summary.total_range)
    print 'Time To Cli = ', float(problem.summary.time_to_climb_value)
    print 'TOW HH      = ', float(problem.summary.TOW_HH)
    print 'Fuel HH     = ', float(problem.summary.FUEL_HH)
    print ' '
    print 'Constraints = ', problem.all_constraints()
    print ' '

    last_inputs = problem.last_inputs[:, 1]
    print 'S           = ', last_inputs[0]
    print 'AR          = ', last_inputs[1]
    print 't/c         = ', last_inputs[2]
    print 'Sweep Ang   = ', 3
    # ------------------------------------------------------------------
    # Pareto

    fuelburn = []
    allconstraints = []
    MTOW = []
    finalvalue = []
    grad = []
    tofl = []

    betas = [0., 0.25, 0.5, 0.75, 1.]

    fid = open('Pareto_results.txt', 'w')  # Open output file
    fid.write(' Pareto results \n')
    fid.close()

    for i, beta in enumerate(betas):
        fid = open('Pareto_results.txt', 'ab')  # Open output file
        fid.write('Pareto Frontier. Run number: ' + str(i) + ' \n')
        print('Pareto Frontier. Run number: ' + str(i))

        # updating Beta value
        design_vars = problem.optimization_problem.inputs[:, 1]
        problem.beta = beta
        design_vars[0] = 61.
        design_vars[1] = 12
        design_vars[2] = 0.15
        problem.optimization_problem.inputs[:, 1] = design_vars

        output = scipy_setup.SciPy_Solve(problem, solver='SLSQP', sense_step=1.4901161193847656e-05)
        # output = pyopt_setup.Pyopt_Solve(problem, solver='ALPSO')

        finalvalue.append(output)

        print output
        print ' '
        print ' Final Results '
        print ' '
        print 'Fuel Burn   = ', float(problem.summary.base_mission_fuelburn)
        print 'Cruise Fuel = ', float(problem.summary.cruise_fuel)
        print 'Block  Fuel = ', float(problem.summary.block_fuel)
        print 'MTOW        = ', float(problem.summary.MTOW)
        print 'BOW         = ', float(problem.summary.BOW)
        print 'TOFL        = ', float(problem.summary.takeoff_field_length)
        print 'GRAD        = ', float(problem.summary.second_segment_climb_gradient_takeoff)
        print 'Cruise Alt  = ', float(problem.summary.cruise_altitude)
        print 'Design Ran  = ', float(problem.summary.design_range)
        print 'Cruise Ran  = ', float(problem.summary.cruise_range)
        print 'Total Ran   = ', float(problem.summary.total_range)
        print 'Time To Cli = ', float(problem.summary.time_to_climb_value)
        print 'TOW HH      = ', float(problem.summary.TOW_HH)
        print 'Fuel HH     = ', float(problem.summary.FUEL_HH)
        print ' '
        print 'Constraints = ', problem.all_constraints()
        print ' '
        last_inputs = finalvalue[-1]
        print 'S           = ', last_inputs[0] * 61.
        print 'AR          = ', last_inputs[1] * 12.
        print 't/c         = ', last_inputs[2] * 0.15
        print 'Sweep Ang   = ', 3
        # -----------------------------------------
        Plot_Mission.plot_mission(problem, i)

        fuelburn.append(problem.summary.base_mission_fuelburn)
        allconstraints.append(problem.all_constraints())
        grad.append(problem.summary.second_segment_climb_gradient_takeoff)
        tofl.append(problem.summary.takeoff_field_length)
        MTOW.append(problem.summary.MTOW)

        fid.write(str(fuelburn[-1]) + ' \n')
        fid.write(str(grad[-1]) + ' \n')
        fid.write(str(tofl[-1]) + ' \n')
        fid.write(str(MTOW[-1]) + ' \n')
        fid.write(str(allconstraints[-1]) + ' \n')
        fid.write(str(finalvalue[-1]) + ' \n')
        fid.write('\n \n')
        fid.close()

    fid = open('Pareto_results.txt', 'ab')  # Open output file
    elapsed = time.time() - t0

    fid.write('Total run time: ' + str(elapsed))
    print('Total run time: ' + str(elapsed))

    fid.close()

    return
Esempio n. 8
0
def main():
    seed = np.random.seed(1)

    # ------------------------------------------------------------------
    #   SLSQP
    # ------------------------------------------------------------------
    solver_name = 'SLSQP'
    problem = setup(solver_name)
    problem.optimization_problem.constraints = np.array([
        ['x1', '>', -10., 1., Units.less],
        ['x1', '=', 0., 1., Units.less],
        ['x2', '>', 1., 1., Units.less],
        ['x2', '<', 2., 1., Units.less],
    ])
    print('\n\n Checking basic additive with one active constraint...')
    # suppress iteration printout
    Nexus.translate(problem)
    sys.stdout = open(os.devnull, 'w')
    outputs = scipy_setup.SciPy_Solve(problem,
                                      solver='SLSQP',
                                      sense_step=1.4901161193847656e-08,
                                      pop_size=10,
                                      prob_seed=seed)
    # end suppression of interation printout
    sys.stdout = sys.__stdout__
    print(outputs)
    obj = scipy_setup.SciPy_Problem(problem, outputs)[0]
    x1 = outputs[0]
    x2 = outputs[1]

    #   Check Results
    assert (np.isclose(obj, 1, atol=1e-6))
    assert (np.isclose(x1, 0, atol=1e-2))
    assert (np.isclose(x2, 1, atol=1e-2))

    # test writing output function
    filename = 'optimization_output.txt'
    write_optimization_outputs(problem, filename)
    os.remove('optimization_output.txt')

    # ------------------------------------------------------------------
    #   Differential Evolution
    # ------------------------------------------------------------------
    print('\n\n Checking differential evolution algorithm')
    solver_name = 'differential_evolution'
    problem = setup(solver_name)
    problem.optimization_problem.constraints = np.array([
        ['x1', '>', -10., 1., Units.less],
        ['x1', '=', 0., 1., Units.less],
        ['x2', '>', 1., 1., Units.less],
        ['x2', '<', 2., 1., Units.less],
    ])
    # suppress iteration printout
    sys.stdout = open(os.devnull, 'w')
    outputs = scipy_setup.SciPy_Solve(problem,
                                      solver='differential_evolution',
                                      sense_step=1.4901161193847656e-08,
                                      pop_size=10,
                                      prob_seed=seed)
    # end suppression of interation printout
    sys.stdout = sys.__stdout__
    print(outputs)
    obj = outputs.fun
    x1 = outputs.x[0]
    x2 = outputs.x[1]

    #   Check Results
    assert (np.isclose(obj, 1, atol=1e-5))
    assert (np.isclose(x1, 0, atol=1e-4))
    assert (np.isclose(x2, 1, atol=1e-4))

    # ------------------------------------------------------------------
    #   Particle Swarm Optimization
    # ------------------------------------------------------------------
    solver_name = 'particle_swarm_optimization'
    problem = setup(solver_name)
    problem.optimization_problem.constraints = np.array([
        ['x1', '>', -10., 1., Units.less],
        ['x2', '>', 1., 1., Units.less],
        ['x2', '<', 2., 1., Units.less],
    ])
    print('\n\n Checking particle swarm optimization algorithm')
    # suppress iteration printout
    sys.stdout = open(os.devnull, 'w')
    outputs = scipy_setup.SciPy_Solve(problem,
                                      solver='particle_swarm_optimization',
                                      sense_step=1.4901161193847656e-08,
                                      pop_size=100,
                                      prob_seed=seed)
    # end suppression of interation printout
    sys.stdout = sys.__stdout__
    print(outputs)
    obj = outputs[1][0]
    x1 = outputs[0][0]
    x2 = outputs[0][1]

    #   Check Results
    assert (np.isclose(obj, 1, atol=1e-2))
    assert (np.isclose(x1, 0, atol=1e-1))
    assert (np.isclose(x2, 1, atol=1e-1))

    return
Esempio n. 9
0
def main():

    t0 = time.time()

    problem = setup()

    ## Base Input Values
    output = problem.objective()
    print output
    Plot_Mission.plot_mission(problem, -1)

    # # Uncomment to view contours of the design space
    # variable_sweep(problem)

    print ' '
    print ' Initial Guess Results '
    print ' '
    print 'Fuel Burn   = ', float(problem.summary.base_mission_fuelburn)
    print 'Cruise Fuel = ', float(problem.summary.cruise_fuel)
    print 'Block  Fuel = ', float(problem.summary.block_fuel)
    print 'MTOW        = ', float(problem.summary.MTOW)
    print 'BOW         = ', float(problem.summary.BOW)
    print 'TOFL        = ', float(problem.summary.takeoff_field_length)
    print 'GRAD        = ', float(
        problem.summary.second_segment_climb_gradient_takeoff)
    print 'Cruise Alt  = ', float(problem.summary.cruise_altitude)
    print 'Design Ran  = ', float(problem.summary.design_range)
    print 'Cruise Ran  = ', float(problem.summary.cruise_range)
    print 'Total Ran   = ', float(problem.summary.total_range)
    print 'Time To Cli = ', float(problem.summary.time_to_climb_value)
    print 'TOW HH      = ', float(problem.summary.TOW_HH)
    print 'Fuel HH     = ', float(problem.summary.FUEL_HH)
    print ' '
    print 'Constraints = ', problem.all_constraints()
    print ' '

    last_inputs = problem.last_inputs[:, 1]
    print 'S           = ', last_inputs[0]
    print 'AR          = ', last_inputs[1]
    print 't/c         = ', last_inputs[2]
    print 'Sweep Ang   = ', last_inputs[3]
    # ------------------------------------------------------------------
    # Pareto

    fuelburn = []
    allconstraints = []
    MTOW = []
    finalvalue = []
    grad = []
    tofl = []
    variations = []

    fid = open('DoE_results.txt', 'w')  # Open output file
    fid.write(' DoE results \n')
    fid.close()

    deltas = [0.95, 1.05]
    original_values = deepcopy(problem.optimization_problem.inputs[:, 1])
    original_bounds = deepcopy(problem.optimization_problem.inputs[:, 2])
    for k, delta in enumerate(deltas):
        for i in range(len(problem.optimization_problem.inputs) - 2):
            fid = open('DoE_results.txt', 'ab')  # Open output file
            fid.write('DoE - parameter study. Run number: ' +
                      str(i +
                          (len(problem.optimization_problem.inputs) - 2) * k) +
                      ' \n')
            print('DoE - parameter study. Run number: ' +
                  str(i + (len(problem.optimization_problem.inputs) - 2) * k))
            inputs = [1., 1., 1., 1., 1., 1., 1.]
            inputs[i] = delta
            variations.append(inputs)
            print('Scaling Inputs: ' + str(inputs))

            # reset values
            problem.optimization_problem.inputs[:,
                                                1] = deepcopy(original_values)
            problem.optimization_problem.inputs[:,
                                                2] = deepcopy(original_bounds)

            # changing parameters values
            scaling = problem.optimization_problem.inputs[:, 1]
            scaled_inputs = np.multiply(inputs, scaling)
            problem.optimization_problem.inputs[:, 1] = scaled_inputs

            # changing parameters bounds
            bounds = problem.optimization_problem.inputs[:, 2]
            bounds[i] = list(bounds[i])
            bounds[i][0] = bounds[i][0] * inputs[i]
            bounds[i][1] = bounds[i][1] * inputs[i]
            bounds[i] = tuple(bounds[i])
            problem.optimization_problem.inputs[:, 2] = bounds

            output = scipy_setup.SciPy_Solve(problem, solver='SLSQP')
            print output
            finalvalue.append(output)
            print ' '
            print ' Final Results '
            print ' '
            print 'Fuel Burn   = ', float(
                problem.summary.base_mission_fuelburn)
            print 'Cruise Fuel = ', float(problem.summary.cruise_fuel)
            print 'Block  Fuel = ', float(problem.summary.block_fuel)
            print 'MTOW        = ', float(problem.summary.MTOW)
            print 'BOW         = ', float(problem.summary.BOW)
            print 'TOFL        = ', float(problem.summary.takeoff_field_length)
            print 'GRAD        = ', float(
                problem.summary.second_segment_climb_gradient_takeoff)
            print 'Cruise Alt  = ', float(problem.summary.cruise_altitude)
            print 'Design Ran  = ', float(problem.summary.design_range)
            print 'Cruise Ran  = ', float(problem.summary.cruise_range)
            print 'Total Ran   = ', float(problem.summary.total_range)
            print 'Time To Cli = ', float(problem.summary.time_to_climb_value)
            print 'TOW HH      = ', float(problem.summary.TOW_HH)
            print 'Fuel HH     = ', float(problem.summary.FUEL_HH)
            print ' '
            print 'Constraints = ', problem.all_constraints()
            last_inputs = finalvalue[-1]
            print 'S           = ', last_inputs[0]
            print 'AR          = ', last_inputs[1]
            print 't/c         = ', last_inputs[2]
            print 'Sweep Ang   = ', last_inputs[3]
            Plot_Mission.plot_mission(
                problem,
                i + (len(problem.optimization_problem.inputs) - 2) * k)

            fuelburn.append(problem.summary.base_mission_fuelburn)
            allconstraints.append(problem.all_constraints())
            grad.append(problem.summary.second_segment_climb_gradient_takeoff)
            tofl.append(problem.summary.takeoff_field_length)
            MTOW.append(problem.summary.MTOW)

            fid.write(str(fuelburn[-1]) + ' \n')
            fid.write(str(grad[-1]) + ' \n')
            fid.write(str(tofl[-1]) + ' \n')
            fid.write(str(MTOW[-1]) + ' \n')
            fid.write(str(allconstraints[-1]) + ' \n')
            fid.write(str(variations[-1]) + ' \n')
            fid.write(str(finalvalue[-1]) + ' \n')
            fid.write('\n \n')
            fid.close()

    fid = open('DoE_results.txt', 'ab')  # Open output file
    elapsed = time.time() - t0

    fid.write('Total run time: ' + str(elapsed))
    print('Total run time: ' + str(elapsed))

    fid.close()

    return
Esempio n. 10
0
def main():
    problem = setup()
    
    ## Base Input Values
    output = problem.objective()
    
    # # Uncomment to view contours of the design space
    # variable_sweep(problem)
    Plot_Mission.plot_mission(problem, -1)
    # ------------------------------------------------------------------
    # DoE
    fuelburn = []
    allconstraints = []
    variations = []
    finalvalue = []
    grad = []
    tofl = []
    fid = open('DoE_results.txt', 'w')  # Open output file
    fid.write(' DoE results \n')

    deltas = [0.95, 1.05]
    original_values = deepcopy(problem.optimization_problem.inputs[:, 1])
    original_bounds = deepcopy(problem.optimization_problem.inputs[:, 2])
    for k, delta in enumerate(deltas):
        for i in range(len(problem.optimization_problem.inputs)-1):
            fid.write('DoE - parameter study. Run number: '+str(i+(len(problem.optimization_problem.inputs)-1)*k)+' \n')
            print ('DoE - parameter study. Run number: '+str(i+(len(problem.optimization_problem.inputs)-1)*k))
            inputs = [1., 1., 1., 1., 1., 1.]
            inputs[i] = delta
            variations.append(inputs)
            print ('Scaling Inputs: '+str(inputs))

            # reset values
            problem.optimization_problem.inputs[:, 1] = deepcopy(original_values)
            problem.optimization_problem.inputs[:, 2] = deepcopy(original_bounds)

            # changing parameters values
            scaling = problem.optimization_problem.inputs[:, 1]
            scaled_inputs = np.multiply(inputs, scaling)
            problem.optimization_problem.inputs[:, 1] = scaled_inputs

            # changing parameters bounds
            bounds = problem.optimization_problem.inputs[:, 2]
            bounds[i] = list(bounds[i])
            bounds[i][0] = bounds[i][0] * inputs[i]
            bounds[i][1] = bounds[i][1] * inputs[i]
            bounds[i] = tuple(bounds[i])
            problem.optimization_problem.inputs[:, 2] = bounds

            output = scipy_setup.SciPy_Solve(problem, solver='SLSQP')
            print output

            finalvalue.append(output)
            fuelburn.append(problem.summary.base_mission_fuelburn)
            allconstraints.append(problem.all_constraints())
            grad.append(problem.summary.second_segment_climb_gradient_takeoff)
            tofl.append(problem.summary.takeoff_field_length)

            print 'fuel burn   = ', problem.summary.base_mission_fuelburn
            print 'Constraints = ', problem.all_constraints()
            Plot_Mission.plot_mission(problem, i+(len(problem.optimization_problem.inputs)-1)*k)
            print ''

            fid.write(str(fuelburn[-1])+' \n')
            fid.write(str(grad[-1]) + ' \n')
            fid.write(str(tofl[-1]) + ' \n')
            fid.write(str(allconstraints[-1]) + ' \n')
            fid.write(str(variations[-1]) + ' \n')
            fid.write(str(finalvalue[-1]) + ' \n')
            fid.write('\n \n')


    fid.close()
    # Plot_Mission.plot_mission(problem, 0)
    return