Ejemplo n.º 1
0
def main(argv):
    numerical_result = numerical_solution(100.0, 0.01, fugoid_numerical,
                                          [100., 10.])
    analytical_result = fugoid_analytic(numerical_result[:, 0])

    plot_multiple(numerical_result[:, 0],
                  [numerical_result[:, 1], analytical_result],
                  ['Numerical', 'Analytical'], 'phugoid_trajectory.png')
Ejemplo n.º 2
0
def main(argv):
    deltas = np.array([0.1, 0.05, 0.01, 0.005, 0.001, 0.0001])
    errors = np.empty_like(deltas)

    for i, delta in enumerate(deltas):
        numerical  = numerical_solution(100.0, delta, fugoid_numerical, [100., 10.])
        analytical = fugoid_analytic(numerical[:, 0])
        errors[i]  = get_error(numerical[:, 1], analytical, delta)

    plot_error(deltas, errors, 'phugoid_errors.png')
Ejemplo n.º 3
0
def main(argv):
    deltas = np.array([0.1, 0.05, 0.01, 0.005, 0.001, 0.0001])
    errors = np.empty_like(deltas)

    for i, delta in enumerate(deltas):
        numerical = numerical_solution(100.0, delta, fugoid_numerical,
                                       [100., 10.])
        analytical = fugoid_analytic(numerical[:, 0])
        errors[i] = get_error(numerical[:, 1], analytical, delta)

    plot_error(deltas, errors, 'phugoid_errors.png')
Ejemplo n.º 4
0
def main(argv):
    results  = numerical_solution(40.0, 0.1, rocket_numerical, [0., 0.])

    steps    = results[:, 0]
    altitude = results[:, 1]
    velocity = results[:, 2]

    index1   = np.argmax(velocity)
    index2   = np.argmax(altitude)
    index3   = np.where(altitude < 0.0)[0][0]

    print_results(results, index1, index2, index3)

    plot_single(steps, altitude, ['Altitude'], 'rocket_altitude_02.png')
    plot_single(steps, velocity, ['Velocity'], 'rocket_velocity_02.png')
Ejemplo n.º 5
0
def main(argv):
    results = numerical_solution(40.0, 0.1, rocket_numerical, [0., 0.])

    steps = results[:, 0]
    altitude = results[:, 1]
    velocity = results[:, 2]

    index1 = np.argmax(velocity)
    index2 = np.argmax(altitude)
    index3 = np.where(altitude < 0.0)[0][0]

    print_results(results, index1, index2, index3)

    plot_single(steps, altitude, ['Altitude'], 'rocket_altitude_02.png')
    plot_single(steps, velocity, ['Velocity'], 'rocket_velocity_02.png')
Ejemplo n.º 6
0
def main(argv):
    numerical_result  = numerical_solution(100.0, 0.01, fugoid_numerical, [100., 10.])
    analytical_result = fugoid_analytic(numerical_result[:, 0])

    plot_multiple(numerical_result[:, 0], [numerical_result[:, 1], analytical_result], ['Numerical', 'Analytical'], 'phugoid_trajectory.png')