“与我们观测的不同部分的微小不均匀不同,宇宙整体辐射背景波动是随着宇宙的膨胀,在宇宙时间尺度上缓慢变化的,以Planck卫星的精度,直到一百万年后都未必能测出这种变化,你却想在今天晚上发现它百分之五的波动?!知道这意味着什么吗?这意味着整个宇宙像一个坏了的日光灯管那样闪烁!”
最近在为我的新诗集寻找 cover,但却始终没有合适的想法。
突然想到了三体中的“整个宇宙都将为你闪烁”,如果模拟出来,也许是一副合适的 cover.
模拟宇宙背景辐射
可以通过计算和生成一个包含小扰动的均匀辐射场来实现。这些扰动源自大爆炸后初期的量子涨落,并被称为"温度涨落"。
import numpy as np
import matplotlib.pyplot as plt
# 1. 创建一个均匀的背景温度场
size = 500 # 图像大小
mean_temperature = 2.725 # CMB 的平均温度 (K)
background = np.ones((size, size)) * mean_temperature
# 2. 添加高斯噪声 (模拟温度涨落)
# 这些涨落是小的,因此标准差较小
temperature_fluctuations = np.random.normal(scale=0.1, size=(size, size)) # 温度涨落的标准差为 0.1 K
cmb_simulation = background + temperature_fluctuations
# 3. 可视化 CMB 模拟结果
plt.imshow(cmb_simulation, cmap='inferno', origin='lower', interpolation='nearest')
plt.colorbar(label='Temperature (K)')
plt.title('Simulated Cosmic Microwave Background')
plt.show()
模拟闪烁
在静态 CMB 温度场的基础上,叠加一个随时间变化的全局亮度波动(例如正弦波或方波)。
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
# 参数设置
size = 500 # 图像分辨率
mean_temp = 2.725 # CMB 平均温度 (K)
fluctuation_scale = 0.1 # 初始温度涨落幅度
frames = 100 # 动画帧数
interval = 50 # 帧间隔 (ms)
# 初始化 CMB 背景和波动场
background = np.ones((size, size)) * mean_temp
static_fluctuations = np.random.normal(scale=fluctuation_scale, size=(size, size))
# 创建动态调制的亮度波动函数(例如正弦波)
def dynamic_modulation(frame, amplitude=0.5, frequency=0.1):
time = frame / 10.0
return amplitude * np.sin(2 * np.pi * frequency * time)
# 创建动画
fig = plt.figure(figsize=(8, 8))
ax = plt.imshow(background, cmap='inferno', origin='lower', vmin=2.5, vmax=3.0)
plt.colorbar(label='Temperature (K)')
plt.title('The Universe Flashes for You')
def update(frame):
# 全局亮度调制(正弦波)
global_modulation = dynamic_modulation(frame, amplitude=0.2, frequency=0.5)
# 局部干扰(中心向外扩散的波纹)
x, y = np.meshgrid(np.arange(size), np.arange(size))
center = size // 2
distance = np.sqrt((x - center)**2 + (y - center)**2)
pulse = 0.3 * np.sin(2 * np.pi * (distance / 50 - frame / 20)) * np.exp(-distance / 100)
# 合成动态 CMB
cmb_dynamic = background + static_fluctuations + global_modulation + pulse
ax.set_array(cmb_dynamic)
return ax,
ani = FuncAnimation(fig, update, frames=frames, interval=interval, blit=True)
plt.show()

Comments | 1 条评论
0mawam