Universal Gravitation with Recoil  

[Diagram Level | Equations Level | Graphs ]




position_1(t) = position_1(t - dt) + (rate_of_change_of_pos_1) * dt
INIT position_1 = initial_pos_1
rate_of_change_of_pos_1 = velocity_1

position_2(t) = position_2(t - dt) + (rate_of_change_of_pos_2) * dt
INIT position_2 = initial_pos_2
rate_of_change_of_pos_2 = velocity_2

velocity_1(t) = velocity_1(t - dt) + (rate_of_change_of_vel_1) * dt
INIT velocity_1 = 0
rate_of_change_of_vel_1 = accel_1

velocity_2(t) = velocity_2(t - dt) + (rate_of_change_of_vel_2) * dt
INIT velocity_2 = 0
rate_of_change_of_vel_2 = accel_2

accel_1 = net_force_1/mass_1
accel_2 = net_force_2/mass_2

compression_constant = 4e8
compression_force = if distance_between<(2*radius) then 
                    -compression_constant*(2*radius-distance_between) 
                    else 0

distance_between = ABS(position_2-position_1)
grav_force = 6.67E-11*(mass_1*mass_2)/(distance_between^2)

initial_pos_1 = -0.2
initial_pos_2 = 0.2

mass_1 = 6E6
mass_2 = 6E6

net_force_1 = grav_force+compression_force
net_force_2 = -grav_force-compression_force

radius = 0.05
Time Specs Settings
Range: 0-60; dt = 0.05; Integration Method = Runge-Kutta 4



Graph of Position



Graph of Forces

Home | Contact | Site Map | Search