This Python code defines functions for calculating components of the Schwarzschild metric and Christoffel symbols of general relativity for a non-rotating, uncharged black hole. It takes radius and mass as inputs, defines terms of the metric, calculates the metric and its derivatives, and prints the non-zero Christoffel symbols.
This Python code defines functions for calculating components of the Schwarzschild metric and Christoffel symbols of general relativity for a non-rotating, uncharged black hole. It takes radius and mass as inputs, defines terms of the metric, calculates the metric and its derivatives, and prints the non-zero Christoffel symbols.
This Python code defines functions for calculating components of the Schwarzschild metric and Christoffel symbols of general relativity for a non-rotating, uncharged black hole. It takes radius and mass as inputs, defines terms of the metric, calculates the metric and its derivatives, and prints the non-zero Christoffel symbols.
global DeriveMetricParameter Derive = DeriveMetricParameter metric = ShwarzchildMetric( mass, radius, theta ) result = [ [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ], [ 0.0, 0.0, 0.0, 0.0 ] ] results = [] results.append( copy.deepcopy( result ) ) results.append( copy.deepcopy( result ) ) results.append( copy.deepcopy( result ) ) results.append( copy.deepcopy( result ) ) for l in range( 4 ): DebugPrint( '<matrix' + str( l ) + '>', debug ) for m in range( 4 ): DebugPrint( '\t<row' + str( m ) + '>', debug ) for n in range( 4 ): DebugPrint( '\t\t<number' + str( m ) + 'x' + str( n ) + '>', debug ) for p in range ( 4 ): #print( "Deriving0: ", symboles[ n ], ": ", metric[ m ][ p ], "::", Derive( metric, m, p, symboles[ n ] ) ) #print( "Deriving1: ", symboles[ m ], ": ", metric[ n ][ p ], "::", Derive( metric, n, p, symboles[ m ] ) ) #print( "Deriving2: ", symboles[ p ], ": ", metric[ m ][ n ], "::",Derive( metric, m, n, symboles[ p ] ) ) DebugPrint( ( '\t\t\t', 0.5 * metric[ l ][ p ], ' * ( ', Derive( metric, m, p, symboles[ n ] ), '+', Derive( metric, n, p, symboles[ m ] ), '-', Derive( metric, m, n, symboles[ p ] ), ' )', 'l: ', l, ' m: ', m, ' n: ', n, ' p: ', p ), debug ) results[ l ][ m ][ n ] += ( 0.5 * metric[ l ][ p ] * ( Derive( metric, m, p, symboles[ n ] ) + Derive( metric, n, p, symboles[ m ] ) - Derive( metric, m, n, symboles[ p ] ) ) ) DebugPrint( ( '\t\t\tresult: ', results[ l ][ m ][ n ], '\n' ), debug ) DebugPrint( '\t\t\t<ncurrently>', debug ) for o in results[ l ]: DebugPrint( ( '\t\t\t\t', o ), debug ) DebugPrint( '\t\t\t</ncurrently>', debug ) DebugPrint( '\t\t</number' + str( m ) + 'x' + str( n ) + '>', debug ) DebugPrint( '\t\t<rcurrently>', debug ) for o in results[ l ]: DebugPrint( ( '\t\t\t', o ), debug ) DebugPrint( '\t\t</rcurrently>', debug ) DebugPrint( '\t</row' + str( m ) + '>', debug ) DebugPrint( '</matrix' + str( l ) + '>\n\n', debug ) return results