Class: KerbalDyn::OrbitalManeuver::BurnEvent

Inherits:
Object
  • Object
show all
Includes:
Mixin::OptionsProcessor, Mixin::ParameterAttributes
Defined in:
lib/kerbaldyn/orbital_maneuver/burn_event.rb

Overview

Encapsulates information about a burn event.

Instance Method Summary collapse

Methods included from Mixin::ParameterAttributes

included

Constructor Details

#initialize(options = {}) ⇒ BurnEvent

Create a new burn event.

The following parameters are expected to be given:

initial_velocity

The velocity before the burn.

final_velocity

The velocity after the burn.

time

The time of the burn.

orbital_radius

The orbital radius at the time of the burn.

mean_anomaly

The mean anomaly at the time of the burn.

The following parameters are optional.

epoch

Used to offset the time.



19
20
21
# File 'lib/kerbaldyn/orbital_maneuver/burn_event.rb', line 19

def initialize(options={})
  process_options(options, :epoch => 0.0)
end

Instance Method Details

#delta_velocityObject Also known as: delta_v

Returns the change in velocity for this maneuver.

Note that the sign may be meaningful to the maneuver. For example, a retrograde burn is usually negative.



45
46
47
# File 'lib/kerbaldyn/orbital_maneuver/burn_event.rb', line 45

def delta_velocity
  return self.final_velocity - self.initial_velocity
end

#epoch_timeObject

Gives the time of this event in epoch time if epoch was set.



51
52
53
# File 'lib/kerbaldyn/orbital_maneuver/burn_event.rb', line 51

def epoch_time
  return time + epoch
end