#!/usr/bin/env python # coding: utf-8 # # Carter time machine # In[2]: get_ipython().run_line_magic('display', 'latex') # In[3]: var('a r') # In[4]: var('th', latex_name=r'\theta') # In[5]: f(r,a,th) = (r^2+a^2)*(r^2+a^2*cos(th)^2) + 2*a^2*r*sin(th)^2 f # In[69]: g0 = plot(f(r,0.9,0), (r,-1.5,1.5), legend_label=r'$\theta=0$', thickness=2, linestyle=':', color='red') g1 = plot(f(r,0.9,pi/4), (r,-1.5,1.5), legend_label=r'$\theta=\pi/4$', thickness=2, linestyle='-.', color='grey') g2 = plot(f(r,0.9,pi/3), (r,-1.5,1.5), legend_label=r'$\theta=\pi/3$', thickness=2, linestyle='--', color='blue') g3 = plot(f(r,0.9,pi/2), (r,-1.5,1.5), legend_label=r'$\theta=\pi/2$', thickness=2, color='violet') graph = g0+g1+g2+g3 graph.axes_labels([r'$r/m$', r'$\rho^2 (r^2+a^2) + 2 a^2 m r \, \sin^2\theta$']) graph.set_legend_options(loc='upper right') graph # In[70]: graph.save('ker_sign_gpp.pdf') # In[51]: rp(a) = 1 + sqrt(1-a^2) rm(a) = 1 - sqrt(1-a^2) # In[52]: rp # In[53]: rm # In[54]: rp(0.9) # In[55]: rm(0.9) # In[74]: df = diff(f(r,a,th), r).simplify_full() df # In[84]: s = solve(df==0, r, solution_dict=True) s # In[87]: rmin = s[2][r] rmin # In[97]: df.subs(r=rmin).simplify_full() # In[105]: plot(rmin.subs(th=pi/2), (a,0.01, 0.9)) # In[107]: fmin = f(rmin.subs(th=pi/2), a, pi/2).simplify_full() fmin # In[ ]: