Class | AppMath::Kep2D |
In: |
kepler_2d.rb
|
Parent: | Object |
Kepler problem in 2 dimensions mass of the test particle is 1. space-fixed central mass times constant of gravity is @g
# File kepler_2d.rb, line 86 86: def initialize(x,v,g) 87: @t = R.c0 88: @x = x 89: @v = v 90: @g = g 91: end
acceleration
# File kepler_2d.rb, line 94 94: def acc 95: r = @x.abs 96: k = -@g * r**-3 97: @x * k 98: end
angular momentum
# File kepler_2d.rb, line 134 134: def ang_mom 135: @x.x * @v.y - @x.y * @v.x 136: end
Runge-Lenz vector
# File kepler_2d.rb, line 139 139: def lenz 140: @x * @v.abs2 - @x * @v.spr(@x) - @x.uv * @g 141: end