1
$\begingroup$

I am trying to find black hole shadow contour with respect to temperature. with metricf[r_] := -((2*M*r^2)/(g^3 + r^3)) + (8/3)*Pi*P*r^2 + 1. So here is my code,

f[r_] := 1 - (2*M*r^2)/(r^3 + g^3) + (8/3)*Pi*P*r^2; 
M = ((g^3 + r^3)*(8*Pi*P*r^2 + 3))/(6*r^2); 
T = (-(2*g^3) + 8*Pi*P*r^5 + r^3)/(4*Pi*r*(g^3 + r^3)); 
\[Xi] = ((3 + 8*Pi*r^2)^3*(g^3 + r^3)^3)/(216*r^6) + Sqrt[g^6 - 
(g^3*(3 + 8*Pi*r^2)^3*(g^3 + r^3)^3)/(108*r^6)] - g^3; 
rp = g^3/(2*r^2) + r/2 + (4/3)*(g^3 + r^3)*P*Pi + ((3 + 
8*Pi*r^2)^2*(g^3 + r^3)^2)/(36*r^4*\[Xi]^(1/3)) + \[Xi]^(1/3); 
rs = rp/Sqrt[f[rp]]; 
shadowcontour[met_, g_, p_, T1_, T2_] := Module[{T, r, \[Theta], 
shadowrad, photonrad, xi, rh}, 
rh = r /. Last[NSolve[T - (-2*g^3 + r^3 + 8*p*Pi*r^5)/(4*Pi*r*(g^3 + r^3)) == 0, r]]; 
xi = ((3 + 8*Pi*r^2)^3*(g^3 + r^3)^3)/(216*r^6) + Sqrt[g^6 - (g^3*(3 + 8*Pi*r^2)^3*(g^3 + r^3)^3)/(108*r^6)] - g^3; 
photonrad = g^3/(2*r^2) + r/2 + (4/3)*(g^3 + r^3)*p*Pi + ((3 + 8*Pi*r^2)^2*(g^3 + r^3)^2)/(36*r^4*xi^(1/3)) + xi^(1/3); 
shadowrad = photonrad/Sqrt[met[photonrad]] /. r -> rh; 
plot = Region[ParametricRegion[{shadowrad*Cos[\[Theta]], 
shadowrad*Sin[\[Theta]]}, {{\[Theta], 0, 2*Pi}, {T, T1, T2}}]]; 
plot]
shadowcontour[f, 0.3, 0.002418/0.09, 0, 0.21]

now perfomrfing shadowcontour[f, 0.3, 0.002418/0.09, 0, 0.21] gives no answer. Can anyone help me with it.

$\endgroup$
7
  • $\begingroup$ You have 2 boxes with the code. If I copy and paste in my notebook, there are some undefined variables. Then I see that you have definition of f somewhere, and parameters g and P are defined yet in another place. I think you will get better answers if you prepare a single copy-paste-able code. $\endgroup$ Commented Apr 20, 2024 at 8:44
  • $\begingroup$ actually I am trying to recreate fig 5 in arxiv.org/pdf/2301.06120.pdf . They have used equation 16-21 and 24,25 to plot the figure with f(r0)=1 and the choice of P and g as mentioned. can you help me with it? $\endgroup$ Commented Apr 23, 2024 at 7:02
  • $\begingroup$ You should prepare a copy-paste-able code. Currently it consists of many pieces, extra work is needed to even start working on your problem. $\endgroup$ Commented Apr 23, 2024 at 8:23
  • $\begingroup$ Please look at This. There I have shared two of my notebook. community.wolfram.com/groups/-/m/t/3163006 $\endgroup$ Commented Apr 23, 2024 at 8:38
  • 1
    $\begingroup$ Kindly check the edited version. I have made the code in single box. Once again I apologize for rudeness and I will be careful from next time. Thank you. $\endgroup$ Commented Apr 24, 2024 at 7:01

1 Answer 1

1
$\begingroup$

It is not the full answer, rather a suggestion how to organise the code. The problem with the existing code is in the mixing of notations. For instance, in the definition of f a parameter P is used, which is undefined. Later, a parameter p is used. In order to avoid this confusion, you have to explicitly specify all arguments. I recommend to define several functions:

 Clear[f,M,T,ξ,rp,rs]
f[r_,M_,g_,P_]:=1-(2*M[r,g,P]*r^2)/(r^3+g^3)+(8/3)*Pi*P*r^2;
M[r_,g_,P_]:=((g^3+r^3)*(8*Pi*P*r^2+3))/(6*r^2);
T[r_,g_,P_]:=(-(2*g^3)+8*Pi*P*r^5+r^3)/(4*Pi*r*(g^3+r^3));
ξ[r_,g_]:=((3+8*Pi*r^2)^3*(g^3+r^3)^3)/(216*r^6)+Sqrt[g^6-(g^3*(3+8*Pi*r^2)^3*(g^3+r^3)^3)/(108*r^6)]-g^3;
rp[r_,g_,P_]:=g^3/(2*r^2)+r/2+(4/3)*(g^3+r^3)*P*Pi+((3+8*Pi*r^2)^2*(g^3+r^3)^2)/(36*r^4*ξ^(1/3))+ξ^(1/3);
rs[r_,M_,g_,P_]:=rp[r,g,P]/Sqrt[f[rp[r,g,P],M,g,P]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.