kill(all)$

van=facebook.com/LearningCalculus$

load(physical_constants)$

      Radius, Volume and Density of a Black Hole of mass M:
      (%G is the gravitational constant, %c is the speed of light)

r(M):=(2*%G*M)/%c^2$
V(R):=4*%pi*R^3/3$
Rho(M,V):=M/V$

      The largest known black hole, SDSS J140821 has a mass of 196 billion suns.
      What is its radius and density?

     - First some symbolic housekeeping, define mass of sun and black hole.

declare("☉", alphabetic)$
declare("◉", alphabetic)$
declare_constvalue(%M☉, 1.989 * 10^30 `kg);
declare_constvalue(%M◉, (196*10^9) * constvalue(%M☉));

      - Now Schwartzchild radius of black hole in meters and AU and density in kg/m^3

float(constvalue(r(%M◉)));
declare_constvalue(%R◉, % )$
declare_constvalue(%AU, 1.496e+11 `m)$
float(constvalue(r(%M◉)/%AU)) `AU;
float(constvalue(Rho(%M◉,V(%R◉))));
declare_constvalue(Rho◉,%)$

      What would be the equivlent altitude on earth for that density?

declare("⊕", alphabetic)$
declare_constvalue(Rho⊕,1.225 `kg/m^3);
density:constvalue(Rho◉)=constvalue(Rho⊕)*%e^(-h/8400),h$
ratprint:false$
solve(density,h)$
h:rhs(first(solve(Rho◉=Rho⊕*%e^(-h/8400),h))) `m$
float(constvalue(h));
%``feet;