Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
52 views
ubuntu2404
Kernel: Julia 1.11

Modern Thermodynamics: From Stars to Biology

Learning Objectives

By the end of this tutorial, you will:

  • Apply thermodynamics to stellar astrophysics and black hole physics

  • Understand biological thermodynamics and metabolic processes

  • Analyze modern energy systems and climate applications

  • Explore cutting-edge applications in nanotechnology and quantum systems

  • Connect thermodynamic principles to information theory

  • Utilize Julia for advanced thermodynamic modeling

  • Master CoCalc collaboration for interdisciplinary research

Expanding Thermodynamic Horizons

This notebook explores how thermodynamic principles extend far beyond traditional engineering applications. From the nuclear furnaces of stars to the molecular machinery of living cells, thermodynamics provides a universal framework for understanding energy and entropy across all scales.

Historical Context: The 20th century saw thermodynamics expand into new realms—statistical mechanics explained molecular behavior, astrophysics revealed stellar thermodynamics, and biochemistry uncovered the energy basis of life.

CoCalc Advantage: Interdisciplinary collaboration between physicists, biologists, engineers, and climate scientists, enabling breakthrough research at the intersections of traditional fields.

import Pkg; Pkg.add("PlotThemes") using Plots, Printf, Statistics, LinearAlgebra using PlotThemes theme(:bright) # Fundamental constants (2018 CODATA values) const k_B = 1.380649e-23 # Boltzmann constant (J/K) const N_A = 6.02214076e23 # Avogadro's number (1/mol) const R = k_B * N_A # Universal gas constant (J/mol·K) const σ_SB = 5.670374419e-8 # Stefan-Boltzmann constant (W/m²·K⁴) const c = 299792458.0 # Speed of light (m/s) const h = 6.62607015e-34 # Planck constant (J·s) const G = 6.67430e-11 # Gravitational constant (m³/kg⋅s²) const M_sun = 1.989e30 # Solar mass (kg) println("🌟 MODERN THERMODYNAMICS: FROM STARS TO BIOLOGY") println(repeat("=", 55)) println("Exploring thermodynamics across scales and disciplines") println() println("Universal Constants:") println("• Boltzmann constant: k_B = $(k_B) J/K") println("• Stefan-Boltzmann: σ = $(σ_SB) W/(m²·K⁴)") println("• Gravitational constant: G = $(G) m³/(kg⋅s²)") println("• Solar mass: M☉ = $(M_sun) kg")
Resolving package versions... No Changes to `~/.julia/environment/v1.11/Project.toml` No Changes to `~/.julia/environment/v1.11/Manifest.toml`
🌟 MODERN THERMODYNAMICS: FROM STARS TO BIOLOGY ======================================================= Exploring thermodynamics across scales and disciplines Universal Constants: • Boltzmann constant: k_B = 1.380649e-23 J/K • Stefan-Boltzmann: σ = 5.670374419e-8 W/(m²·K⁴) • Gravitational constant: G = 6.6743e-11 m³/(kg⋅s²) • Solar mass: M☉ = 1.989e30 kg

1. Stellar Thermodynamics and Astrophysics

Stars as Thermodynamic Systems

Stars are massive thermodynamic systems governed by:

  • Hydrostatic equilibrium: Pressure gradient balances gravitational force

  • Energy transport: Radiation and convection carry energy outward

  • Nuclear fusion: Converts mass to energy in stellar cores

  • Stellar evolution: Thermodynamic properties change over stellar lifetime

Key Stellar Relations

Stefan-Boltzmann Law for stellar luminosity: L=4πR2σTeff4L = 4\pi R^2 \sigma T_{eff}^4

where LL is luminosity, RR is stellar radius, and TeffT_{eff} is effective temperature.

Hydrostatic Equilibrium: dPdr=ρGM(r)r2\frac{dP}{dr} = -\frac{\rho GM(r)}{r^2}

Virial Theorem for gravitational systems: 2K+U=02K + U = 0

where KK is kinetic energy and UU is gravitational potential energy.

Black Hole Thermodynamics

Hawking Temperature: TH=c38πGMkBT_H = \frac{\hbar c^3}{8\pi G M k_B}

Bekenstein-Hawking Entropy: SBH=Ac34GS_{BH} = \frac{A c^3}{4G\hbar}

where A=4πrs2A = 4\pi r_s^2 is the event horizon area and rs=2GM/c2r_s = 2GM/c^2 is the Schwarzschild radius.

# Stellar physics functions function stellar_luminosity(R, T_eff) """Stefan-Boltzmann law: L = 4πR²σT⁴""" return 4π * R^2 * σ_SB * T_eff^4 end function main_sequence_lifetime(M) """Rough main sequence lifetime: τ ∝ M/L ∝ M^(-2.5) (very approximate)""" # For solar-type stars, lifetime scales as (M/M_sun)^(-2.5) τ_sun = 10e9 * 365.25 * 24 * 3600 # 10 billion years in seconds return τ_sun * (M / M_sun)^(-2.5) end function hawking_temperature(M) """Hawking temperature: T_H = ℏc³/(8πGMk_B)""" = h / (2π) return ( * c^3) / (8π * G * M * k_B) end function schwarzschild_radius(M) """Schwarzschild radius: r_s = 2GM/c²""" return 2 * G * M / c^2 end function bekenstein_hawking_entropy(M) """Bekenstein-Hawking entropy: S = Ac³/(4Gℏ)""" = h / (2π) r_s = schwarzschild_radius(M) A = 4π * r_s^2 # Event horizon area return A * c^3 / (4 * G * ) end println("=== STELLAR THERMODYNAMICS ===") println("Main Sequence Stars (Hydrostatic Equilibrium):") println() # Main sequence stars data stellar_data = [ ("Red dwarf (M-type)", 0.1, 0.1, 3000), ("Sun (G-type)", 1.0, 1.0, 5778), ("Blue giant (B-type)", 10.0, 5.0, 20000), ("Blue supergiant (O-type)", 50.0, 20.0, 40000) ] println("Main Sequence Properties:") println(repeat("-", 80)) @printf "%-25s %8s %8s %10s %12s %12s\n" "Star Type" "M/M☉" "R/R☉" "T_eff (K)" "L/L☉" "Lifetime (yr)" println(repeat("-", 80)) for (star_name, M_ratio, R_ratio, T_eff) in stellar_data M_star = M_ratio * M_sun R_star = R_ratio * 6.96e8 # Solar radius in meters L_star = stellar_luminosity(R_star, T_eff) L_sun = stellar_luminosity(6.96e8, 5778) # Solar luminosity L_ratio = L_star / L_sun lifetime = main_sequence_lifetime(M_star) lifetime_years = lifetime / (365.25 * 24 * 3600) @printf "%-25s %8.1f %8.1f %10.0f %12.1f %12.2e\n" star_name M_ratio R_ratio T_eff L_ratio lifetime_years end println() println("Stellar Evolution Insights:") println("• More massive stars are hotter, brighter, but shorter-lived") println("• Luminosity scales roughly as M³⁻⁴ (mass-luminosity relation)") println("• Lifetime scales as M/L ∝ M⁻²·⁵ (more massive = faster burning)") println("• Red dwarfs will outlive the universe's current age") println("• Massive stars explode as supernovae after millions of years") println()
=== STELLAR THERMODYNAMICS === Main Sequence Stars (Hydrostatic Equilibrium): Main Sequence Properties: -------------------------------------------------------------------------------- Star Type M/M☉ R/R☉ T_eff (K) L/L☉ Lifetime (yr) -------------------------------------------------------------------------------- Red dwarf (M-type) 0.1 0.1 3000 0.0 3.16e+12 Sun (G-type) 1.0 1.0 5778 1.0 1.00e+10 Blue giant (B-type) 10.0 5.0 20000 3588.8 3.16e+07 Blue supergiant (O-type) 50.0 20.0 40000 918734.0 5.66e+05 Stellar Evolution Insights: • More massive stars are hotter, brighter, but shorter-lived • Luminosity scales roughly as M³⁻⁴ (mass-luminosity relation) • Lifetime scales as M/L ∝ M⁻²·⁵ (more massive = faster burning) • Red dwarfs will outlive the universe's current age • Massive stars explode as supernovae after millions of years
using Printf println("=== BLACK HOLE THERMODYNAMICS ===") println("Hawking Radiation and Event Horizon Physics") println() black_holes = [ ("Stellar-mass BH", 10.0), ("Intermediate BH", 1000.0), ("Sagittarius A*", 4e6), ("M87* (imaged BH)", 6.5e9), ("Galaxy cluster BH", 1e10) ] println("Black Hole Thermodynamic Properties:") println(repeat("-", 90)) @printf "%-20s %12s %12s %15s %15s\n" "Black Hole Type" "Mass (M☉)" "r_s (km)" "T_Hawking (K)" "Entropy (J/K)" println(repeat("-", 90)) for (bh_name, M_bh_solar) in black_holes M_bh = M_bh_solar * M_sun r_s = schwarzschild_radius(M_bh) T_hawk = hawking_temperature(M_bh) S_bh = bekenstein_hawking_entropy(M_bh) @printf "%-20s %12.1e %12.1f %15.2e %15.2e\n" bh_name M_bh_solar (r_s/1000) T_hawk S_bh end println() println("Black Hole Thermodynamic Insights:") println("• Larger black holes are colder (T ∝ 1/M)") println("• Entropy scales with area, not volume (S ∝ M²)") println("• Stellar-mass BHs evaporate faster than universe age") println("• Supermassive BHs will outlive all stars") println("• Information paradox: where does information go?") println("• Holographic principle: 3D information stored on 2D surface") println() println("Black Hole Evaporation:") M_stellar = 10 * M_sun τ_evap_years = 2e67 * (M_stellar / M_sun)^3 universe_age = 1.38e10 @printf "• Stellar-mass BH (10 M☉) evaporation time: ~%.1e years\n" τ_evap_years @printf "• Universe current age: %.1e years\n" universe_age @printf "• Ratio: %.1e times longer than universe age\n" (τ_evap_years / universe_age) println("• Black holes are effectively eternal on cosmic timescales!") println()
=== BLACK HOLE THERMODYNAMICS === Hawking Radiation and Event Horizon Physics Black Hole Thermodynamic Properties: ------------------------------------------------------------------------------------------ Black Hole Type Mass (M☉) r_s (km) T_Hawking (K) Entropy (J/K) ------------------------------------------------------------------------------------------ Stellar-mass BH 1.0e+01 29.5 6.17e-09 1.05e+79 Intermediate BH 1.0e+03 2954.1 6.17e-11 1.05e+83 Sagittarius A* 4.0e+06 11816506.2 1.54e-14 1.68e+90 M87* (imaged BH) 6.5e+09 19201822607.9 9.49e-18 4.43e+96 Galaxy cluster BH 1.0e+10 29541265550.6 6.17e-18 1.05e+97 Black Hole Thermodynamic Insights: • Larger black holes are colder (T ∝ 1/M) • Entropy scales with area, not volume (S ∝ M²) • Stellar-mass BHs evaporate faster than universe age • Supermassive BHs will outlive all stars • Information paradox: where does information go? • Holographic principle: 3D information stored on 2D surface Black Hole Evaporation: • Stellar-mass BH (10 M☉) evaporation time: ~2.0e+70 years • Universe current age: 1.4e+10 years • Ratio: 1.4e+60 times longer than universe age • Black holes are effectively eternal on cosmic timescales!

2. Biological Thermodynamics and Life

Thermodynamics of Living Systems

Living organisms are non-equilibrium thermodynamic systems that:

  • Maintain low entropy through continuous energy input

  • Convert chemical energy to work and heat

  • Create and maintain complex organized structures

  • Operate far from thermodynamic equilibrium

Cellular Energy Currency: ATP

ATP hydrolysis provides energy for cellular processes: ATP+H2OADP+Pi+energy\text{ATP} + \text{H}_2\text{O} \rightarrow \text{ADP} + \text{P}_i + \text{energy}

Standard Gibbs free energy: ΔG°=30.5\Delta G^° = -30.5 kJ/mol

Cellular conditions: ΔG50\Delta G ≈ -50 to 65-65 kJ/mol

Photosynthesis: Solar Energy Conversion

Overall reaction: 6CO2+6H2O+lightC6H12O6+6O26\text{CO}_2 + 6\text{H}_2\text{O} + \text{light} \rightarrow \text{C}_6\text{H}_{12}\text{O}_6 + 6\text{O}_2

Thermodynamic efficiency: ~1-3% (conversion of solar energy to chemical energy)

Metabolic Heat Generation

Basal metabolic rate for mammals: BMRM3/4\text{BMR} \propto M^{3/4}

where MM is body mass (Kleiber's law).

Protein Folding Thermodynamics

Protein folding is driven by:

  • Enthalpy: Hydrogen bonds, van der Waals interactions

  • Entropy: Hydrophobic effect, configurational entropy

  • Free energy minimization: ΔG=ΔHTΔS\Delta G = \Delta H - T\Delta S

using Printf const N_A = 6.02214076e23 # 1/mol, Avogadro's number # Biological thermodynamics functions function atp_energy_release() """Standard ATP hydrolysis energy in J/mol""" return 30.5e3 # J/mol (standard conditions) end function cellular_atp_energy() """ATP hydrolysis energy under cellular conditions in J/mol""" return 55e3 # J/mol (typical cellular conditions) end function basal_metabolic_rate(mass_kg) """Kleiber's law: BMR = 70 * M^0.75 kcal/day for mammals""" bmr_kcal_day = 70 * mass_kg^0.75 bmr_watts = bmr_kcal_day * 4184 / (24 * 3600) # Convert to watts return bmr_watts end function photosynthesis_efficiency() """Typical photosynthesis efficiency""" return 0.02 # 2% average efficiency end println("=== BIOLOGICAL THERMODYNAMICS ===") println("Energy and Entropy in Living Systems") println() # ATP energetics ΔG_ATP_standard = atp_energy_release() ΔG_ATP_cellular = cellular_atp_energy() T_body = 37 + 273.15 # K (body temperature) println("=== CELLULAR ENERGY CURRENCY (ATP) ===") @printf "• Standard ATP hydrolysis: ΔG° = %.1f kJ/mol\n" (ΔG_ATP_standard / 1000) @printf "• Cellular conditions: ΔG ≈ %.1f kJ/mol\n" (ΔG_ATP_cellular / 1000) @printf "• Body temperature: T = %.1f K = %.1f°C\n" T_body (T_body - 273.15) println() # Human ATP turnover human_mass = 70.0 # kg (average adult) bmr_human = basal_metabolic_rate(human_mass) daily_energy = bmr_human * 24 * 3600 # J/day atp_molecules_per_day = daily_energy / ΔG_ATP_cellular * N_A println("Human Energy Metabolism:") @printf "• Adult human mass: %.0f kg\n" human_mass @printf "• Basal metabolic rate: %.0f W\n" bmr_human @printf "• Daily energy expenditure: %.1f MJ/day\n" (daily_energy / 1e6) @printf "• ATP molecules hydrolyzed: %.2e molecules/day\n" atp_molecules_per_day @printf "• ATP turnover rate: %.2e molecules/second\n" (atp_molecules_per_day / (24 * 3600)) @printf "• Equivalent ATP mass: %.0f kg/day (recycled ~1000 times!)\n" (atp_molecules_per_day * 507 / N_A / 1000) println() # Metabolic scaling println("=== METABOLIC SCALING (KLEIBER'S LAW) ===") animals = [ ("Mouse", 0.025), ("Rat", 0.3), ("Cat", 4.0), ("Human", 70.0), ("Horse", 500.0), ("Elephant", 5000.0) ] println("Metabolic Rate Scaling (BMR ∝ M^0.75):") println(repeat("-", 60)) @printf "%-15s %10s %12s %15s\n" "Animal" "Mass (kg)" "BMR (W)" "BMR/Mass (W/kg)" println(repeat("-", 60)) for (animal, mass) in animals bmr = basal_metabolic_rate(mass) bmr_per_kg = bmr / mass @printf "%-15s %10.3f %12.1f %15.2f\n" animal mass bmr bmr_per_kg end println() println("Metabolic Insights:") println("• Larger animals have lower metabolic rate per unit mass") println("• Surface area to volume ratio affects heat loss") println("• Metabolic efficiency improves with size") println("• Evolutionary advantage of larger size in cold climates") println()
=== BIOLOGICAL THERMODYNAMICS === Energy and Entropy in Living Systems === CELLULAR ENERGY CURRENCY (ATP) === • Standard ATP hydrolysis: ΔG° = 30.5 kJ/mol • Cellular conditions: ΔG ≈ 55.0 kJ/mol • Body temperature: T = 310.1 K = 37.0°C Human Energy Metabolism: • Adult human mass: 70 kg • Basal metabolic rate: 82 W • Daily energy expenditure: 7.1 MJ/day • ATP molecules hydrolyzed: 7.76e+25 molecules/day • ATP turnover rate: 8.98e+20 molecules/second • Equivalent ATP mass: 65 kg/day (recycled ~1000 times!) === METABOLIC SCALING (KLEIBER'S LAW) === Metabolic Rate Scaling (BMR ∝ M^0.75): ------------------------------------------------------------ Animal Mass (kg) BMR (W) BMR/Mass (W/kg) ------------------------------------------------------------ Mouse 0.025 0.2 8.52 Rat 0.300 1.4 4.58 Cat 4.000 9.6 2.40 Human 70.000 82.0 1.17 Horse 500.000 358.4 0.72 Elephant 5000.000 2015.6 0.40 Metabolic Insights: • Larger animals have lower metabolic rate per unit mass • Surface area to volume ratio affects heat loss • Metabolic efficiency improves with size • Evolutionary advantage of larger size in cold climates
using Printf # Photosynthesis analysis println("=== PHOTOSYNTHESIS: SOLAR ENERGY CONVERSION ===") solar_irradiance = 1000 # W/m² (peak sunlight) photosynthesis_eff = photosynthesis_efficiency() leaf_areas = [0.001, 0.01, 0.1, 1.0] # m² (different leaf sizes) leaf_descriptions = ["Small leaf (1 cm²)", "Medium leaf (10 cm²)", "Large leaf (100 cm²)", "Plant canopy (1 m²)"] println("Plant Solar Energy Conversion:") println(repeat('-', 70)) @printf "%-20s %10s %12s %15s %15s\n" "System" "Area (cm²)" "Solar (W)" "Chemical (W)" "Daily Energy (kJ)" println(repeat('-', 70)) for (i, area) in enumerate(leaf_areas) solar_power = solar_irradiance * area chemical_power = solar_power * photosynthesis_eff daily_energy = chemical_power * 8 * 3600 / 1000 # 8 hours daylight in kJ @printf "%-20s %10.1f %12.3f %15.4f %15.2f\n" leaf_descriptions[i] (area*10000) solar_power chemical_power daily_energy end println() println("Photosynthesis Efficiency Analysis:") @printf "• Average efficiency: %.1f%% (solar → chemical energy)\n" (photosynthesis_eff * 100) println("• Theoretical maximum: ~11% (thermodynamic limit)") println("• Loss mechanisms: reflection, non-photosynthetic absorption,") println(" quantum yield losses, metabolic costs") println("• Still remarkably efficient for a biological process!") println() # Compare to human energy needs human_daily_energy = bmr_human * 24 * 3600 / 1000 # kJ/day forest_area_needed = human_daily_energy / (photosynthesis_eff * solar_irradiance * 8 * 3600 / 1000) println("Sustaining Human Life through Photosynthesis:") @printf "• Human daily energy need: %.0f kJ/day\n" human_daily_energy @printf "• Forest area required: %.1f m² per person\n" forest_area_needed @printf "• That's a %.1f × %.1f meter square of forest!\n" sqrt(forest_area_needed) sqrt(forest_area_needed) println("• Demonstrates the fundamental role of plants in ecosystems") println()
=== PHOTOSYNTHESIS: SOLAR ENERGY CONVERSION === Plant Solar Energy Conversion: ---------------------------------------------------------------------- System Area (cm²) Solar (W) Chemical (W) Daily Energy (kJ) ---------------------------------------------------------------------- Small leaf (1 cm²) 10.0 1.000 0.0200 0.58 Medium leaf (10 cm²) 100.0 10.000 0.2000 5.76 Large leaf (100 cm²) 1000.0 100.000 2.0000 57.60 Plant canopy (1 m²) 10000.0 1000.000 20.0000 576.00 Photosynthesis Efficiency Analysis: • Average efficiency: 2.0% (solar → chemical energy) • Theoretical maximum: ~11% (thermodynamic limit) • Loss mechanisms: reflection, non-photosynthetic absorption, quantum yield losses, metabolic costs • Still remarkably efficient for a biological process! Sustaining Human Life through Photosynthesis: • Human daily energy need: 7088 kJ/day • Forest area required: 12.3 m² per person • That's a 3.5 × 3.5 meter square of forest! • Demonstrates the fundamental role of plants in ecosystems

3. Modern Energy Systems and Climate Applications

Renewable Energy Thermodynamics

Solar Photovoltaic:

  • Theoretical maximum efficiency: ~33% (Shockley-Queisser limit)

  • Commercial silicon cells: ~20-22%

  • Multi-junction cells: >40% (concentrated sunlight)

Wind Energy:

  • Betz limit: Maximum 59.3% of kinetic energy can be extracted

  • Modern turbines: ~45-50% efficiency

Geothermal:

  • Efficiency limited by: Temperature difference between ground and surface

  • Typical efficiency: 10-15%

Energy Storage Thermodynamics

Battery Systems:

  • Lithium-ion: ~90-95% round-trip efficiency

  • Pumped hydro: ~80-85% efficiency

  • Compressed air: ~60-70% efficiency

Climate Thermodynamics

Earth's Energy Balance: Solar Input=Thermal Radiation Output\text{Solar Input} = \text{Thermal Radiation Output}

Stefan-Boltzmann for Earth: TEarth=((1α)S4σ)1/4T_{Earth} = \left(\frac{(1-\alpha)S}{4\sigma}\right)^{1/4}

where α\alpha is albedo and SS is solar constant.

Greenhouse Effect:

  • Atmosphere absorbs long-wave radiation

  • Re-radiates partially back to surface

  • Effective increase in surface temperature

Carbon Cycle Thermodynamics

CO₂ dissolution in oceans:

  • Temperature-dependent solubility

  • pH changes affect carbonate equilibrium

  • Ocean acidification consequences

using Printf println("=== RENEWABLE ENERGY THERMODYNAMICS ===") # Solar energy analysis function solar_cell_power(area, irradiance, efficiency) # Solar cell power output: P = Area × Irradiance × Efficiency return area * irradiance * efficiency end function wind_power(air_density, area, wind_speed, efficiency) # Wind turbine power: P = 0.5 ρ A v^3 η return 0.5 * air_density * area * wind_speed^3 * efficiency end # Solar photovoltaic analysis println("Solar Photovoltaic Systems:") solar_data = [ ("Residential (5 kW)", 25, 1000, 0.20), ("Commercial (100 kW)", 500, 1000, 0.22), ("Utility scale (10 MW)", 50000, 1000, 0.24), ("Concentrated PV", 100, 2000, 0.40) ] println(repeat("-", 70)) @printf "%-20s %10s %10s %10s %12s\n" "System Type" "Area (m²)" "Irrad. (W/m²)" "Efficiency" "Power (kW)" println(repeat("-", 70)) for (system, area, irradiance, efficiency) in solar_data power = solar_cell_power(area, irradiance, efficiency) / 1000 # Convert to kW @printf "%-20s %10.0f %10.0f %10.1f%% %12.1f\n" system area irradiance (efficiency*100) power end println() # Wind energy analysis println("Wind Energy Systems:") wind_data = [ ("Small residential", 1.2, 5, 0.35), ("Medium commercial", 1.2, 8, 0.45), ("Large offshore", 1.2, 12, 0.50), ("Offshore wind farm", 1.2, 15, 0.50) ] println(repeat("-", 80)) @printf "%-20s %12s %12s %10s %12s\n" "System Type" "Air Density" "Wind Speed" "Efficiency" "Power/m²" println(repeat("-", 80)) for (system, air_density, wind_speed, efficiency) in wind_data power_per_area = wind_power(air_density, 1.0, wind_speed, efficiency) @printf "%-20s %12.1f %12.0f %10.1f%% %12.0f\n" system air_density wind_speed (efficiency*100) power_per_area end println() println("Renewable Energy Insights:") println("• Solar: Power scales with area and efficiency") println("• Wind: Power scales with wind speed cubed (v^3)!") println("• Efficiency improvements have dramatic impact") println("• Geographic location crucial (sun/wind resources)") println("• Storage needed for intermittent sources") println() # Betz limit demonstration betz_limit = 16/27 # ≈ 0.593 println("Wind Energy Theoretical Limits:") @printf "• Betz limit: %.1f%% (maximum extractable kinetic energy)\n" (betz_limit * 100) println("• Modern turbines achieve ~75-85% of Betz limit") println("• Demonstrates fundamental thermodynamic constraints") println()
=== RENEWABLE ENERGY THERMODYNAMICS === Solar Photovoltaic Systems: ---------------------------------------------------------------------- System Type Area (m²) Irrad. (W/m²) Efficiency Power (kW) ---------------------------------------------------------------------- Residential (5 kW) 25 1000 20.0% 5.0 Commercial (100 kW) 500 1000 22.0% 110.0 Utility scale (10 MW) 50000 1000 24.0% 12000.0 Concentrated PV 100 2000 40.0% 80.0 Wind Energy Systems: -------------------------------------------------------------------------------- System Type Air Density Wind Speed Efficiency Power/m² -------------------------------------------------------------------------------- Small residential 1.2 5 35.0% 26 Medium commercial 1.2 8 45.0% 138 Large offshore 1.2 12 50.0% 518 Offshore wind farm 1.2 15 50.0% 1012 Renewable Energy Insights: • Solar: Power scales with area and efficiency • Wind: Power scales with wind speed cubed (v^3)! • Efficiency improvements have dramatic impact • Geographic location crucial (sun/wind resources) • Storage needed for intermittent sources Wind Energy Theoretical Limits: • Betz limit: 59.3% (maximum extractable kinetic energy) • Modern turbines achieve ~75-85% of Betz limit • Demonstrates fundamental thermodynamic constraints
# julia using Printf # Stefan–Boltzmann constant (W·m⁻²·K⁻⁴) const σ_SB = 5.670374419e-8 # Climate thermodynamics """Earth's equilibrium temperature: T = [(1-α)S/(4σ)]^(1/4)""" function earth_temperature(solar_constant, albedo) return ((1 - albedo) * solar_constant / (4 * σ_SB))^(1/4) end """Greenhouse warming effect in Kelvin""" function greenhouse_effect(T_no_atmosphere, T_with_atmosphere) return T_with_atmosphere - T_no_atmosphere end println("=== CLIMATE THERMODYNAMICS ===") println("Earth's Energy Balance and Greenhouse Effect") println() # Earth energy balance S = 1361 # W/m² (solar constant) albedo_earth = 0.30 # Earth's average albedo albedo_ice = 0.90 # Ice/snow albedo albedo_ocean = 0.06 # Ocean albedo albedo_forest = 0.15 # Forest albedo T_no_atmosphere = earth_temperature(S, albedo_earth) T_current = 288.15 # K (current global average) greenhouse_warming = greenhouse_effect(T_no_atmosphere, T_current) println("Earth Energy Balance Analysis:") @printf "• Solar constant: S = %.0f W/m²\n" S @printf "• Earth's albedo: α = %.2f\n" albedo_earth @printf "• Temperature without atmosphere: %.1f K = %.1f°C\n" T_no_atmosphere (T_no_atmosphere - 273.15) @printf "• Current global average: %.1f K = %.1f°C\n" T_current (T_current - 273.15) @printf "• Greenhouse effect: +%.1f K (+%.1f°C)\n" greenhouse_warming greenhouse_warming println() # Albedo feedback effects println("Albedo Feedback in Climate System:") surfaces = [ ("Fresh snow", 0.85), ("Sea ice", 0.70), ("Desert sand", 0.35), ("Forest", 0.15), ("Grassland", 0.20), ("Ocean", 0.06) ] println(repeat("-", 60)) @printf "%-15s %10s %15s %15s\n" "Surface Type" "Albedo" "T_equilibrium (K)" "T_equilibrium (°C)" println(repeat("-", 60)) for (surface, albedo) in surfaces T_eq = earth_temperature(S, albedo) T_eq_celsius = T_eq - 273.15 @printf "%-15s %10.2f %15.1f %15.1f\n" surface albedo T_eq T_eq_celsius end println() println("Climate Feedback Insights:") println("• Ice-albedo feedback: Melting ice → lower albedo → more warming") println("• Forest fires increase albedo temporarily") println("• Ocean absorption crucial for energy balance") println("• Clouds have complex albedo and greenhouse effects") println("• Small albedo changes cause significant temperature changes") println() # CO₂ and temperature relationship (simplified) println("Greenhouse Gas Effects:") co2_preindustrial = 280 # ppm co2_current = 420 # ppm co2_doubled = 560 # ppm # Rough climate sensitivity: ΔT ≈ 3°C per CO₂ doubling climate_sensitivity = 3.0 # K per CO₂ doubling warming_current = climate_sensitivity * log(co2_current / co2_preindustrial) / log(2) warming_doubled = climate_sensitivity * log(co2_doubled / co2_preindustrial) / log(2) @printf "• Pre-industrial CO₂: %.0f ppm\n" co2_preindustrial @printf "• Current CO₂: %.0f ppm\n" co2_current @printf "• Current warming: +%.1f°C (from CO₂ alone)\n" warming_current @printf "• Doubled CO₂ warming: +%.1f°C\n" warming_doubled println("• Climate sensitivity: fundamental thermodynamic property") println("• Logarithmic relationship: equal % increases → equal warming") println()
=== CLIMATE THERMODYNAMICS === Earth's Energy Balance and Greenhouse Effect Earth Energy Balance Analysis: • Solar constant: S = 1361 W/m² • Earth's albedo: α = 0.30 • Temperature without atmosphere: 254.6 K = -18.6°C • Current global average: 288.1 K = 15.0°C • Greenhouse effect: +33.6 K (+33.6°C) Albedo Feedback in Climate System: ------------------------------------------------------------ Surface Type Albedo T_equilibrium (K) T_equilibrium (°C) ------------------------------------------------------------ Fresh snow 0.85 173.2 -99.9 Sea ice 0.70 206.0 -67.2 Desert sand 0.35 249.9 -23.2 Forest 0.15 267.2 -5.9 Grassland 0.20 263.2 -9.9 Ocean 0.06 274.0 0.9 Climate Feedback Insights: • Ice-albedo feedback: Melting ice → lower albedo → more warming • Forest fires increase albedo temporarily • Ocean absorption crucial for energy balance • Clouds have complex albedo and greenhouse effects • Small albedo changes cause significant temperature changes Greenhouse Gas Effects: • Pre-industrial CO₂: 280 ppm • Current CO₂: 420 ppm • Current warming: +1.8°C (from CO₂ alone) • Doubled CO₂ warming: +3.0°C • Climate sensitivity: fundamental thermodynamic property • Logarithmic relationship: equal % increases → equal warming

4. Quantum and Nanoscale Thermodynamics

Quantum Thermodynamics

At the quantum scale, thermodynamics takes on new features:

Quantum Heat Engines:

  • Working medium consists of quantum states

  • Coherence effects can enhance efficiency

  • Quantum correlations play thermodynamic roles

Landauer's Principle: Emin=kBTln2E_{min} = k_B T \ln 2

Minimum energy to erase one bit of information.

Maxwell's Demon:

  • Information has thermodynamic cost

  • Measurement and memory erasure require energy

  • Connects information theory to thermodynamics

Nanoscale Thermodynamics

Brownian Motion:

  • Thermal fluctuations dominate at small scales

  • Random walk behavior

  • Einstein-Smoluchowski relation

Molecular Motors:

  • Convert chemical energy to mechanical work

  • Operate in high-friction, low-Reynolds-number environment

  • Examples: ATP synthase, kinesin, myosin

Fluctuation Theorems:

  • Jarzynski equality

  • Crooks fluctuation theorem

  • Non-equilibrium work relations

using Printf # Physical constants (SI) const k_B = 1.380649e-23 # Boltzmann constant (J/K) const h = 6.62607015e-34 # Planck constant (J·s) println("=== QUANTUM AND NANOSCALE THERMODYNAMICS ===") # Landauer's principle function landauer_energy(T) # minimum energy to erase one bit return k_B * T * log(2) end # Thermal de Broglie wavelength: λ = h/√(2π m k_B T) function thermal_de_broglie(T, mass) return h / sqrt(2π * mass * k_B * T) end # Einstein relation: D = k_B T / (6π η r) for spherical particle function diffusion_coefficient(T, radius, viscosity) return k_B * T / (6π * viscosity * radius) end println("=== INFORMATION THERMODYNAMICS ===") println("Landauer's Principle: Energy Cost of Information Processing") println() temperatures = [4, 77, 300, 373] # K (liquid helium, liquid N₂, room temp, boiling water) temp_names = ["Liquid He", "Liquid N₂", "Room temp", "Boiling H₂O"] println("Minimum Energy to Erase One Bit (Landauer Limit):") println(repeat("-", 60)) @printf "%-15s %8s %15s %15s\n" "Temperature" "T (K)" "Energy (J)" "Energy (eV)" println(repeat("-", 60)) for (i, T) in enumerate(temperatures) E_landauer = landauer_energy(T) E_eV = E_landauer / 1.602176634e-19 # Convert to eV @printf "%-15s %8.0f %15.2e %15.2e\n" temp_names[i] T E_landauer E_eV end println() println("Information Processing Insights:") println("• Colder computers are more energy-efficient") println("• Quantum computers cooled to millikelvin temperatures") println("• Modern processors dissipate ~10⁶ times Landauer limit") println("• Room for dramatic improvement in reversible computing") println() # Quantum vs classical regimes println("=== QUANTUM VS CLASSICAL REGIMES ===") println("Thermal de Broglie Wavelength") println() particles = [ ("Electron", 9.109e-31), ("Proton", 1.673e-27), ("H₂ molecule", 3.3e-27), ("Virus (100 nm)", 1e-15), ("Dust (1 μm)", 1e-12) ] T_room = 300 # K println("Thermal de Broglie wavelengths at T = $T_room K:") println(repeat("-", 70)) @printf "%-15s %12s %15s %15s\n" "Particle" "Mass (kg)" "λ_thermal (m)" "Quantum?" println(repeat("-", 70)) for (particle, mass) in particles λ_th = thermal_de_broglie(T_room, mass) quantum_regime = λ_th > 1e-10 ? "Yes" : "No" # Rough criterion @printf "%-15s %12.2e %15.2e %15s\n" particle mass λ_th quantum_regime end println() println("Quantum Regime Criteria:") println("• Thermal wavelength comparable to system size") println("• Light particles more likely to show quantum effects") println("• Lower temperatures enhance quantum behavior") println("• Macroscopic objects are classical") println() # Nanoscale Brownian motion println("=== NANOSCALE BROWNIAN MOTION ===") η_water = 1e-3 # Pa⋅s (water viscosity) T_body = 310 # K (body temperature) nano_objects = [ ("Small molecule", 1e-9), ("Protein", 5e-9), ("Virus", 50e-9), ("Bacterium", 1e-6), ("Cell", 10e-6) ] println("Diffusion in Water at Body Temperature:") println(repeat("-", 70)) @printf "%-15s %12s %15s %15s\n" "Object" "Radius (m)" "D (m²/s)" "Distance/s (μm)" println(repeat("-", 70)) for (object, radius) in nano_objects D = diffusion_coefficient(T_body, radius, η_water) distance_per_sec = sqrt(2 * D * 1) * 1e6 # RMS distance in 1 second, in μm @printf "%-15s %12.2e %15.2e %15.1f\n" object radius D distance_per_sec end println() println("Nanoscale Transport Insights:") println("• Smaller objects diffuse faster") println("• Thermal motion dominates at nanoscale") println("• Molecular motors work against Brownian motion") println("• Diffusion-limited reaction rates") println("• No Reynolds number effects (Stokes flow)") println()
=== QUANTUM AND NANOSCALE THERMODYNAMICS === === INFORMATION THERMODYNAMICS === Landauer's Principle: Energy Cost of Information Processing Minimum Energy to Erase One Bit (Landauer Limit): ------------------------------------------------------------ Temperature T (K) Energy (J) Energy (eV) ------------------------------------------------------------ Liquid He 4 3.83e-23 2.39e-04 Liquid N₂ 77 7.37e-22 4.60e-03 Room temp 300 2.87e-21 1.79e-02 Boiling H₂O 373 3.57e-21 2.23e-02 Information Processing Insights: • Colder computers are more energy-efficient • Quantum computers cooled to millikelvin temperatures • Modern processors dissipate ~10⁶ times Landauer limit • Room for dramatic improvement in reversible computing === QUANTUM VS CLASSICAL REGIMES === Thermal de Broglie Wavelength Thermal de Broglie wavelengths at T = 300 K: ---------------------------------------------------------------------- Particle Mass (kg) λ_thermal (m) Quantum? ---------------------------------------------------------------------- Electron 9.11e-31 4.30e-09 Yes Proton 1.67e-27 1.00e-10 Yes H₂ molecule 3.30e-27 7.15e-11 No Virus (100 nm) 1.00e-15 1.30e-16 No Dust (1 μm) 1.00e-12 4.11e-18 No Quantum Regime Criteria: • Thermal wavelength comparable to system size • Light particles more likely to show quantum effects • Lower temperatures enhance quantum behavior • Macroscopic objects are classical === NANOSCALE BROWNIAN MOTION === Diffusion in Water at Body Temperature: ---------------------------------------------------------------------- Object Radius (m) D (m²/s) Distance/s (μm) ---------------------------------------------------------------------- Small molecule 1.00e-09 2.27e-10 21.3 Protein 5.00e-09 4.54e-11 9.5 Virus 5.00e-08 4.54e-12 3.0 Bacterium 1.00e-06 2.27e-13 0.7 Cell 1.00e-05 2.27e-14 0.2 Nanoscale Transport Insights: • Smaller objects diffuse faster • Thermal motion dominates at nanoscale • Molecular motors work against Brownian motion • Diffusion-limited reaction rates • No Reynolds number effects (Stokes flow)

5. CoCalc for Modern Thermodynamics Research

Interdisciplinary Collaboration

Modern thermodynamics requires collaboration across multiple fields:

Astrophysics Teams:

  • Theoretical physicists modeling stellar evolution

  • Observational astronomers analyzing stellar spectra

  • Computational experts running stellar structure simulations

  • Real-time collaboration on complex calculations and data analysis

Biophysics Research:

  • Molecular biologists understanding protein folding

  • Biochemists measuring metabolic energetics

  • Physicists developing theoretical models

  • Live sharing of experimental data and theoretical predictions

Climate Science:

  • Atmospheric physicists modeling energy balance

  • Oceanographers studying thermal transport

  • Climate modelers integrating complex systems

  • Policy researchers analyzing mitigation strategies

Advanced Computational Tools

Julia for Scientific Computing:

  • High-performance numerical calculations

  • Excellent package ecosystem for physics and biology

  • Seamless integration with visualization libraries

  • Collaborative development of research codes

Real-Time Mathematical Typesetting:

  • LaTeX equations: S=kBlnΩS = k_B \ln \Omega, L=4πR2σTeff4L = 4\pi R^2 \sigma T_{eff}^4

  • Professional-quality scientific documents

  • Immediate feedback on mathematical derivations

  • Version control for tracking theoretical developments

Best Practices for Modern Research

Scientific Rigor:

  • Document all assumptions and approximations clearly

  • Validate models against experimental data

  • Perform uncertainty analysis on key results

  • Cross-check calculations using multiple approaches

Reproducible Science:

  • Version control for all code and data

  • Clear documentation of computational methods

  • Open sharing of analysis workflows

  • Collaborative peer review processes

Impact and Communication:

  • Connect fundamental physics to real-world applications

  • Visualize complex thermodynamic relationships

  • Engage with broader scientific community

  • Translate research for public understanding

Modern thermodynamics continues to expand our understanding of the universe, from the quantum realm to cosmic scales. CoCalc provides the collaborative tools needed to tackle these complex, interdisciplinary challenges and make breakthrough discoveries at the frontiers of science.