% R7

constants

ve = 3000;

CD = 2.2; % 10X at solar maximum.
rho = 4e-10; % at 200 km
%rho = 1e-13 % at 600 km
A = 1;
z = 200e3;
v = sqrt(G*M_E/(R_E+z))

ms = 1000; %mass of satellite.
T = sqrt((z+R_E)^3/(G*M_E/(4*pi^2))) %Orbital period (simplified, steady-state)

% Force of atmos. drag.
FD = 1/2*CD*A*rho*v^2

z1 = ((2*sqrt(z+R_E) - CD*A*rho/ms*sqrt(G*M_E)*T)/2)^2-R_E
delta_z = z-z1