André Guzzon commited on
Commit ·
174f1f7
0
Parent(s):
Initial commit: Kitchen Thermodynamics scientific infrastructure
Browse files- scripts/falsification_checker.py +62 -0
- scripts/gradient_analyzer.py +81 -0
- scripts/thermal_force_calculator.py +100 -0
scripts/falsification_checker.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Verificador sistemático de falsificações das 12 predições clássicas
|
| 4 |
+
Baseado na série 'Cremation of Thermodynamics'
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
from dataclasses import dataclass
|
| 8 |
+
from typing import List, Dict
|
| 9 |
+
from enum import Enum
|
| 10 |
+
|
| 11 |
+
class FalsificationStatus(Enum):
|
| 12 |
+
CONFIRMED = "CONFIRMED"
|
| 13 |
+
PARTIAL = "PARTIAL"
|
| 14 |
+
UNVERIFIED = "UNVERIFIED"
|
| 15 |
+
|
| 16 |
+
@dataclass
|
| 17 |
+
class ClassicalPrediction:
|
| 18 |
+
number: int
|
| 19 |
+
statement: str
|
| 20 |
+
classical_mechanism: str
|
| 21 |
+
experiment: str
|
| 22 |
+
observation: str
|
| 23 |
+
status: FalsificationStatus
|
| 24 |
+
|
| 25 |
+
class FalsificationChecker:
|
| 26 |
+
"""
|
| 27 |
+
Tabela de falsificações do paper Kitchen Thermodynamics v6.0
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
PREDICTIONS = [
|
| 31 |
+
ClassicalPrediction(1, "Meltwater flows downward on heated inclined surface", "Gravity", "Iceberg", "Reverses to upward at t≈90s", FalsificationStatus.CONFIRMED),
|
| 32 |
+
ClassicalPrediction(2, "Maximum gradient (0-100°C) dissipates in τ_eq≈160s", "Thermal diffusion", "Iceberg", "Sustained >720s (4.56×τ_eq)", FalsificationStatus.CONFIRMED),
|
| 33 |
+
ClassicalPrediction(3, "Liquid fat flows downhill on heated incline", "Gravity", "Butter", "Climbs uphill for 25+ min", FalsificationStatus.CONFIRMED),
|
| 34 |
+
ClassicalPrediction(4, "Butter flow is radially symmetric (scalar)", "Isotropic heat diffusion", "Butter", "Curved vector-field trajectories", FalsificationStatus.CONFIRMED),
|
| 35 |
+
ClassicalPrediction(5, "Marangoni drives fluid toward cooler regions", "Surface tension gradient", "Iceberg", "Anti-Marangoni: flow toward heat", FalsificationStatus.CONFIRMED),
|
| 36 |
+
ClassicalPrediction(6, "Bulk motion determined by temperature (convection)", "Buoyancy", "Water", "Motion tracks flame state, not T", FalsificationStatus.CONFIRMED),
|
| 37 |
+
ClassicalPrediction(7, "Water at 100°C more agitated than at 99.9°C", "Kinetic energy", "Water", "100°C+flame OFF = still; 99.9°C+flame ON = motion", FalsificationStatus.CONFIRMED),
|
| 38 |
+
ClassicalPrediction(8, "Boiling is temperature-threshold phenomenon", "Nucleation at T_boil", "Milk", "Stillness→overflow→stillness in 0.3°C range", FalsificationStatus.CONFIRMED),
|
| 39 |
+
ClassicalPrediction(9, "Convection is passive process driven by buoyancy", "Density differences", "Water/Beans", "Motion collapses in seconds when flame OFF", FalsificationStatus.CONFIRMED),
|
| 40 |
+
ClassicalPrediction(10, "Heating always increases temperature", "First Law (dU = δQ)", "Beans Short", "Temperature drops 1.5°C in 41s with fire ON", FalsificationStatus.CONFIRMED),
|
| 41 |
+
ClassicalPrediction(11, "Bottom of pot is hottest point when heated from below", "Conduction", "Beans Short", "Bottom 16.6°C, liquid above 21.5°C (Δ=4.9°C)", FalsificationStatus.CONFIRMED),
|
| 42 |
+
ClassicalPrediction(12, "Temperature rises monotonically until boiling", "Heat capacity", "Beans Long", "46s plateau 0.3°C below baseline, then 17+min rise without flame", FalsificationStatus.CONFIRMED)
|
| 43 |
+
]
|
| 44 |
+
|
| 45 |
+
def summary(self) -> Dict:
|
| 46 |
+
total = len(self.PREDICTIONS)
|
| 47 |
+
confirmed = sum(1 for p in self.PREDICTIONS if p.status == FalsificationStatus.CONFIRMED)
|
| 48 |
+
return {
|
| 49 |
+
"total_predictions": total,
|
| 50 |
+
"confirmed_falsifications": confirmed,
|
| 51 |
+
"falsification_rate": confirmed / total,
|
| 52 |
+
"experiments_covered": len(set(p.experiment for p in self.PREDICTIONS))
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
if __name__ == "__main__":
|
| 56 |
+
checker = FalsificationChecker()
|
| 57 |
+
print("=" * 60)
|
| 58 |
+
print("KITCHEN THERMODYNAMICS — FALSIFICATION SUMMARY")
|
| 59 |
+
print("=" * 60)
|
| 60 |
+
s = checker.summary()
|
| 61 |
+
print(f"Total: {s['total_predictions']} | Falsificações: {s['confirmed_falsifications']} ({s['falsification_rate']*100:.1f}%)")
|
| 62 |
+
|
scripts/gradient_analyzer.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Analisador de Gradientes Térmicos
|
| 4 |
+
Calcula τ_eq (tempo de equilibração clássico) vs. observado
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import numpy as np
|
| 8 |
+
from dataclasses import dataclass
|
| 9 |
+
|
| 10 |
+
@dataclass
|
| 11 |
+
class GradientAnalysis:
|
| 12 |
+
characteristic_length_m: float
|
| 13 |
+
thermal_diffusivity_m2s: float
|
| 14 |
+
tau_eq_classical_s: float
|
| 15 |
+
tau_observed_s: float
|
| 16 |
+
ratio_observed_to_classical: float
|
| 17 |
+
falsifies_classical: bool
|
| 18 |
+
|
| 19 |
+
class GradientAnalyzer:
|
| 20 |
+
"""
|
| 21 |
+
Análise de sustentação de gradientes térmicos.
|
| 22 |
+
|
| 23 |
+
Clássico: τ_eq = L²/α (difusão térmica)
|
| 24 |
+
Observado: τ_obs >> τ_eq em regime de fluxo ativo
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
# Difusividade térmica da água
|
| 28 |
+
ALPHA_WATER = 1.4e-7 # m²/s
|
| 29 |
+
|
| 30 |
+
def __init__(self, alpha: float = None):
|
| 31 |
+
self.alpha = alpha or self.ALPHA_WATER
|
| 32 |
+
|
| 33 |
+
def analyze(self, length_m: float, tau_observed_s: float) -> GradientAnalysis:
|
| 34 |
+
"""
|
| 35 |
+
Compara tempo de equilibração clássico com observado.
|
| 36 |
+
"""
|
| 37 |
+
tau_eq = length_m**2 / self.alpha
|
| 38 |
+
ratio = tau_observed_s / tau_eq
|
| 39 |
+
|
| 40 |
+
return GradientAnalysis(
|
| 41 |
+
characteristic_length_m=length_m,
|
| 42 |
+
thermal_diffusivity_m2s=self.alpha,
|
| 43 |
+
tau_eq_classical_s=tau_eq,
|
| 44 |
+
tau_observed_s=tau_observed_s,
|
| 45 |
+
ratio_observed_to_classical=ratio,
|
| 46 |
+
falsifies_classical=ratio > 2.0 # Fator 2+ já é anômalo
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
def entropy_deficit_rate(self, delta_S_J_per_K: float,
|
| 50 |
+
duration_s: float) -> float:
|
| 51 |
+
"""
|
| 52 |
+
Taxa de déficit de entropia (negentropy).
|
| 53 |
+
dS/dt < 0 indica organização estrutural sustentada.
|
| 54 |
+
"""
|
| 55 |
+
return delta_S_J_per_K / duration_s
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
# Análise do Experimento 1
|
| 59 |
+
if __name__ == "__main__":
|
| 60 |
+
analyzer = GradientAnalyzer()
|
| 61 |
+
|
| 62 |
+
# Experimento 1: Iceberg
|
| 63 |
+
exp1 = analyzer.analyze(
|
| 64 |
+
length_m=0.15, # 15 cm
|
| 65 |
+
tau_observed_s=730 # >12 minutos
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
print("Experimento 1 - The Iceberg:")
|
| 69 |
+
print(f" L = {exp1.characteristic_length_m*100:.1f} cm")
|
| 70 |
+
print(f" τ_eq (clássico) = {exp1.tau_eq_classical_s:.1f} s")
|
| 71 |
+
print(f" τ_observado = {exp1.tau_observed_s:.1f} s")
|
| 72 |
+
print(f" Razão = {exp1.ratio_observed_to_classical:.2f}×")
|
| 73 |
+
print(f" FALSIFICA clássico? {exp1.falsifies_classical}")
|
| 74 |
+
|
| 75 |
+
# Déficit de entropia
|
| 76 |
+
dS_dt = analyzer.entropy_deficit_rate(
|
| 77 |
+
delta_S_J_per_K=180, # ΔS ≈ 180 J/K
|
| 78 |
+
duration_s=730
|
| 79 |
+
)
|
| 80 |
+
print(f" Taxa de déficit entropico: {dS_dt:.3f} J/(K·s)")
|
| 81 |
+
|
scripts/thermal_force_calculator.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
Thermal Force Calculator
|
| 4 |
+
F_thermal = -k_T * m * ∇T
|
| 5 |
+
|
| 6 |
+
Calibrado a partir do Experimento 2 (Butter) e aplicável a todos.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import numpy as np
|
| 10 |
+
from dataclasses import dataclass
|
| 11 |
+
from typing import Optional
|
| 12 |
+
|
| 13 |
+
@dataclass
|
| 14 |
+
class ThermalForceResult:
|
| 15 |
+
force_N: float
|
| 16 |
+
k_T: float # m·s⁻²·K⁻¹
|
| 17 |
+
overcomes_gravity: bool
|
| 18 |
+
ratio_to_gravity: float
|
| 19 |
+
|
| 20 |
+
class ThermalForceCalculator:
|
| 21 |
+
"""
|
| 22 |
+
Calculadora da força térmica atrativa proposta em Kitchen Thermodynamics.
|
| 23 |
+
|
| 24 |
+
Constante k_T calibrada experimentalmente: 6.4 × 10⁻³ m·s⁻²·K⁻¹
|
| 25 |
+
(obtida do Experimento 2 - Butter shearing threshold)
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
K_T_CALIBRATION = 6.4e-3 # m·s⁻²·K⁻¹
|
| 29 |
+
|
| 30 |
+
def __init__(self, k_T: Optional[float] = None):
|
| 31 |
+
self.k_T = k_T or self.K_T_CALIBRATION
|
| 32 |
+
|
| 33 |
+
def calculate(self, mass_kg: float, gradient_K_per_m: float,
|
| 34 |
+
gravity_ms2: float = 9.81,
|
| 35 |
+
incline_angle_deg: float = 0) -> ThermalForceResult:
|
| 36 |
+
"""
|
| 37 |
+
Calcula F_thermal = -k_T * m * ∇T
|
| 38 |
+
|
| 39 |
+
Args:
|
| 40 |
+
mass_kg: Massa do material (kg)
|
| 41 |
+
gradient_K_per_m: Gradiente de temperatura (K/m)
|
| 42 |
+
gravity_ms2: Aceleração gravitacional (m/s²)
|
| 43 |
+
incline_angle_deg: Ângulo da rampa (0 = horizontal)
|
| 44 |
+
"""
|
| 45 |
+
# Força térmica (direção: +∇T, ou seja, para temperatura mais alta)
|
| 46 |
+
F_thermal = self.k_T * mass_kg * gradient_K_per_m
|
| 47 |
+
|
| 48 |
+
# Componente gravitacional ao longo da rampa
|
| 49 |
+
theta = np.radians(incline_angle_deg)
|
| 50 |
+
F_gravity_parallel = mass_kg * gravity_ms2 * np.sin(theta)
|
| 51 |
+
|
| 52 |
+
# Verifica se supera gravidade
|
| 53 |
+
overcomes = F_thermal > F_gravity_parallel
|
| 54 |
+
ratio = F_thermal / F_gravity_parallel if F_gravity_parallel > 0 else float('inf')
|
| 55 |
+
|
| 56 |
+
return ThermalForceResult(
|
| 57 |
+
force_N=F_thermal,
|
| 58 |
+
k_T=self.k_T,
|
| 59 |
+
overcomes_gravity=overcomes,
|
| 60 |
+
ratio_to_gravity=ratio
|
| 61 |
+
)
|
| 62 |
+
|
| 63 |
+
def calibrate_from_shearing(self, mass_kg: float, gradient_K_per_m: float,
|
| 64 |
+
threshold_angle_deg: float) -> float:
|
| 65 |
+
"""
|
| 66 |
+
Recalibra k_T a partir de um experimento de limiar de cisalhamento.
|
| 67 |
+
|
| 68 |
+
No ponto de cisalhamento: F_thermal = F_gravity_parallel
|
| 69 |
+
k_T = g * sin(θ) / |∇T|
|
| 70 |
+
"""
|
| 71 |
+
theta = np.radians(threshold_angle_deg)
|
| 72 |
+
k_T_new = 9.81 * np.sin(theta) / gradient_K_per_m
|
| 73 |
+
return k_T_new
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
# Exemplo de uso com dados do Experimento 2
|
| 77 |
+
if __name__ == "__main__":
|
| 78 |
+
calc = ThermalForceCalculator()
|
| 79 |
+
|
| 80 |
+
# Experimento 2: Butter em rampa de 10°
|
| 81 |
+
result = calc.calculate(
|
| 82 |
+
mass_kg=0.01, # 10g de manteiga
|
| 83 |
+
gradient_K_per_m=267, # |∇T| ≈ 267 K/m
|
| 84 |
+
incline_angle_deg=10
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
print(f"Experimento 2 - Butter em rampa inclinada:")
|
| 88 |
+
print(f" F_thermal = {result.force_N:.6f} N")
|
| 89 |
+
print(f" k_T = {result.k_T:.2e} m·s⁻²·K⁻¹")
|
| 90 |
+
print(f" Supera gravidade? {result.overcomes_gravity}")
|
| 91 |
+
print(f" Razão F_thermal/F_gravity = {result.ratio_to_gravity:.3f}")
|
| 92 |
+
|
| 93 |
+
# Recalibração a partir do limiar observado (r_threshold ≈ 10cm)
|
| 94 |
+
k_T_exp = calc.calibrate_from_shearing(
|
| 95 |
+
mass_kg=0.01,
|
| 96 |
+
gradient_K_per_m=267,
|
| 97 |
+
threshold_angle_deg=10
|
| 98 |
+
)
|
| 99 |
+
print(f"\nCalibração experimental: k_T = {k_T_exp:.2e} m·s⁻²·K⁻¹")
|
| 100 |
+
|