Created
September 27, 2024 21:25
-
-
Save zby/73000d1cc702be4f56d8e14b27e028b6 to your computer and use it in GitHub Desktop.
Dyson sphere contra fission reactors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| # Constants | |
| SUN_RADIUS = 696340000 # meters | |
| SUN_POWER = 3.828e26 # watts | |
| DYSON_SPHERE_THICKNESS = 1 # meter | |
| DYSON_SPHERE_STANDOFF = 5 # meters | |
| METAL_DENSITY = 7874 # kg/m^3 (assuming iron) | |
| NUCLEAR_PLANT_POWER = 1000e6 # watts (1000 MW, typical large nuclear plant) | |
| NUCLEAR_PLANT_MASS = 200000000 # kg (estimated mass of a nuclear power plant) | |
| def calculate_dyson_sphere_power(): | |
| dyson_sphere_radius = SUN_RADIUS + DYSON_SPHERE_STANDOFF | |
| dyson_sphere_surface_area = 4 * math.pi * dyson_sphere_radius**2 | |
| dyson_sphere_volume = dyson_sphere_surface_area * DYSON_SPHERE_THICKNESS | |
| dyson_sphere_mass = dyson_sphere_volume * METAL_DENSITY | |
| # Assuming perfect energy capture | |
| dyson_sphere_power = SUN_POWER | |
| return dyson_sphere_power, dyson_sphere_mass | |
| def calculate_fission_power(total_mass): | |
| num_plants = total_mass // NUCLEAR_PLANT_MASS | |
| fission_power = num_plants * NUCLEAR_PLANT_POWER | |
| return fission_power, num_plants | |
| def calculate_order_of_magnitude(number): | |
| return math.floor(math.log10(number)) | |
| def main(): | |
| dyson_sphere_power, dyson_sphere_mass = calculate_dyson_sphere_power() | |
| fission_power, num_plants = calculate_fission_power(dyson_sphere_mass) | |
| dyson_order = calculate_order_of_magnitude(dyson_sphere_power) | |
| fission_order = calculate_order_of_magnitude(fission_power) | |
| order_difference = dyson_order - fission_order | |
| print(f"Dyson Sphere Power: {dyson_sphere_power:.2e} W (Order: 10^{dyson_order})") | |
| print(f"Dyson Sphere Mass: {dyson_sphere_mass:.2e} kg") | |
| print(f"Number of Nuclear Plants: {num_plants:,}") | |
| print(f"Total Fission Power: {fission_power:.2e} W (Order: 10^{fission_order})") | |
| print(f"Order of Magnitude Difference: {order_difference}") | |
| print(f"The Dyson sphere produces {10**order_difference:.2e} times more power than fission reactors.") | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment