Class: KerbalDyn::OrbitalManeuver::Bielliptic

Inherits:
Base
  • Object
show all
Defined in:
lib/kerbaldyn/orbital_maneuver/bielliptic.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#final_orbit, #initial_orbit

Instance Method Summary collapse

Methods inherited from Base

#delta_mean_anomaly, #delta_t, #delta_time, #delta_velocities, #delta_velocity, #mean_anomalies, #mean_lead_angle, #mean_lead_time, #moving_to_higher_orbit?, #orbital_radii, #relative_anomaly_delta, #times, #velocities

Methods included from Mixin::ParameterAttributes

included

Constructor Details

#initialize(initial_orbit, final_orbit, options = {}) ⇒ Bielliptic

A special 3-burn orbital maneuver between two circular orbits through the transfer_radius options.

Note that all orbits are circularized before being used.

The first burn moves from the initial orbit to the transfer radius, the second burn (at the transfer radius) moves the periapsis of the transfer orbit to the final orbit. The thrid burn circularizes to the final orbit.



14
15
16
17
# File 'lib/kerbaldyn/orbital_maneuver/bielliptic.rb', line 14

def initialize(initial_orbit, final_orbit, options={})
  options = {:transfer_radius => final_orbit.semimajor_axis}.merge(options)
  super(initial_orbit.circularize, final_orbit.circularize, options)
end

Instance Attribute Details

#transfer_radiusObject

Returns the value of attribute transfer_radius.



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

def transfer_radius
  @transfer_radius
end

Instance Method Details

#burn_eventsObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/kerbaldyn/orbital_maneuver/bielliptic.rb', line 38

def burn_events
  r1 = self.initial_orbit.periapsis
  r2 = self.final_orbit.periapsis
  rt = self.transfer_radius

  ito = self.initial_transfer_orbit
  v11, v12 = (rt >= r1) ? [ito.periapsis_velocity, ito.apoapsis_velocity] : [ito.apoapsis_velocity, ito.periapsis_velocity]

  fto = self.final_transfer_orbit
  v21, v22 = (rt < r2) ? [fto.periapsis_velocity, fto.apoapsis_velocity] : [fto.apoapsis_velocity, fto.periapsis_velocity]

  t1 = self.initial_transfer_orbit.period / 2.0
  t2 = self.final_transfer_orbit.period / 2.0

  return [
    BurnEvent.new(:initial_velocity => self.initial_orbit.mean_velocity, :final_velocity => v11, :time => 0.0, :orbital_radius => self.initial_orbit.semimajor_axis, :mean_anomaly => 0.0),
    BurnEvent.new(:initial_velocity => v12, :final_velocity => v21, :time => t1, :orbital_radius => self.transfer_radius, :mean_anomaly => Math::PI),
    BurnEvent.new(:initial_velocity => v22, :final_velocity => self.final_orbit.mean_velocity, :time => t1+t2, :mean_anomaly => 2.0 * Math::PI)
  ]
end

#final_transfer_orbitObject



28
29
30
31
32
# File 'lib/kerbaldyn/orbital_maneuver/bielliptic.rb', line 28

def final_transfer_orbit
  r2 = self.final_orbit.periapsis
  rt = self.transfer_radius
  return Orbit.new(self.initial_orbit.primary_body, :periapsis => [r2,rt].min, :apoapsis => [r2,rt].max)
end

#initial_transfer_orbitObject



22
23
24
25
26
# File 'lib/kerbaldyn/orbital_maneuver/bielliptic.rb', line 22

def initial_transfer_orbit
  r1 = self.initial_orbit.periapsis
  rt = self.transfer_radius
  return Orbit.new(self.initial_orbit.primary_body, :periapsis => [r1,rt].min, :apoapsis => [r1,rt].max)
end

#orbitsObject



34
35
36
# File 'lib/kerbaldyn/orbital_maneuver/bielliptic.rb', line 34

def orbits
  return [self.initial_orbit, self.initial_transfer_orbit, self.final_transfer_orbit.second, self.final_orbit]
end