function dYdt = kepler_ode_planet9(t,Y)

rX = [Y(1);Y(2)];
vX = [Y(3);Y(4)];
rS = [Y(5);Y(6)];
vS = [Y(7);Y(8)];
rJ = [Y(9);Y(10)];
vJ = [Y(11);Y(12)];
rSat=[Y(13);Y(14)];
vSat=[Y(15);Y(16)];
rN = [Y(17);Y(18)];
vN = [Y(19);Y(20)];
rU = [Y(21);Y(22)];
vU = [Y(23);Y(24)];

global mS mX G mJ mSat mN mU

X   = norm(rS-rX);% SUN PLANET X
X1  = norm(rS-rJ); % SUN JUPITER
X2  = norm(rS-rSat); %SUN SATURN
X3  = norm(rS-rN); % SUN NEPTUNE
X4  = norm(rS-rU); % SUN URANUS
X5 = norm(rX-rS); % PLANET X SUN
X6 = norm(rX-rJ); % PLANET X JUPITER
X7 = norm(rX-rSat); % PLANET X SATURN
X8 = norm(rX-rN); % PLANET X NEPTUNE
X9 = norm(rX-rU); % PLANET X URANUS
X10 = norm(rJ-rS); % JUPITER SUN
X11 = norm(rJ-rX); % JUPITER PLANET X
X12 = norm(rJ-rSat); %JUPITER SATURN
X13 = norm(rJ-rN); %JUPITER NEPTUNE
X14 = norm(rJ-rU); %JUPITER URANUS
X15 = norm(rSat-rS); %SATURN SUN
X16 = norm(rSat-rX); %SATURN PLANET X
X17 = norm(rSat-rJ); %SATURN JUPITER
X18 = norm(rSat-rN); %SATURN NEPTUNE
X19 = norm(rSat-rU); %SATURN URANUS
X20 = norm(rN-rS); %NEPTUNE SUN
X21 = norm(rN-rX); %NEPTUNE PLANET X
X22 = norm(rN-rJ); %NEPTUNE JUPITER
X23 = norm(rN-rSat); %NEPTUNE SATURN
X24 = norm(rN-rU); %NEPTUNE URANUS
X25 = norm(rU-rS); % URANUS SUN
X26 = norm(rU-rX); %URANUS PLANET X
X27 = norm(rU-rJ); %URANUS JUPITER
X28 = norm(rU-rSat); %URANUS SATURN
X29 = norm(rU-rN); %URANUS NEPTUNE

% Force and Accerlation Calculations:
%force planet X on others
FX= (((-G*mX*mS)/(X5^3)).*(rX-rS))+(((-G*mX*mJ)/(X6^3)).*(rX-rJ))+(((-G*mX*mSat)/(X7^3)).*(rX-rSat))+(((-G*mX*mN)/(X8^3)).*(rX-rN))+(((-G*mX*mU)/(X9^3)).*(rX-rU));
aX= FX./mX;
%force Sun on others
FS = (((-G*mS*mX)/((X)^3)).*(rS-rX))+(((-G*mS*mJ)/((X1)^3)).*(rS-rJ))+(((-G*mS*mSat)/((X2)^3)).*(rS-rSat))+(((-G*mS*mN)/((X3)^3)).*(rS-rN))+(((-G*mS*mU)/((X4)^3)).*(rS-rU));
aS = FS ./ mS;
%Force Jupiter on others
FJ = (((-G*mS*mJ)/((X10)^3)).*(rJ-rS))+(((-G*mX*mJ)/((X11)^3)).*(rJ-rX))+(((-G*mJ*mSat)/((X12)^3)).*(rJ-rSat))+(((-G*mJ*mN)/((X13)^3)).*(rJ-rN))+(((-G*mJ*mU)/((X14)^3)).*(rJ-rU));
aJ = FJ ./ mJ;
%Force Saturn on others
FSat = (((-G*mS*mSat)/((X15)^3)).*(rSat-rS))+(((-G*mSat*mX)/((X16)^3)).*(rSat-rX))+(((-G*mJ*mSat)/((X17)^3)).*(rSat-rJ))+(((-G*mSat*mN)/((X18)^3)).*(rSat-rN))+(((-G*mSat*mU)/((X19)^3)).*(rSat-rU));
aSat = FSat ./mSat;
%Force Neptune on others
FN = (((-G*mS*mN)/((X20)^3)).*(rN-rS))+(((-G*mN*mX)/((X21)^3)).*(rN-rX))+(((-G*mN*mJ)/((X22)^3)).*(rN-rJ))+(((-G*mN*mSat)/((X23)^3)).*(rN-rSat))+(((-G*mN*mU)/((X24)^3)).*(rN-rU));
aN = FN./mN;
%Force uranus on others
FU = (((-G*mS*mU)/((X25)^3)).*(rU-rS))+(((-G*mU*mX)/((X26)^3)).*(rU-rX))+(((-G*mU*mJ)/((X27)^3)).*(rU-rJ))+(((-G*mU*mSat)/((X28)^3)).*(rU-rSat))+(((-G*mU*mN)/((X29)^3)).*(rU-rN));
aU = FU./mU; 

dYdt = [vX(1);vX(2);aX(1);aX(2);vS(1);vS(2);aS(1);aS(2);vJ(1);vJ(2);aJ(1);aJ(2);vSat(1);vSat(2);aSat(1);aSat(2);vN(1);vN(2);aN(1);aN(2);vU(1);vU(2);aU(1);aU(2)];