Files
2025AsianB/org/q1.py
2025-11-20 10:45:27 +08:00

104 lines
4.3 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import InterpolatedUnivariateSpline
# ------------------------------------------------
# 1. 可见光区 PDMS 折射率数据(题目给定)
# ------------------------------------------------
wl_visible = np.array([
0.3500,0.3535,0.3570,0.3605,0.3640,0.3675,0.3710,0.3745,0.3780,0.3815,
0.3850,0.3885,0.3920,0.3955,0.3990,0.4025,0.4060,0.4095,0.4130,0.4165,
0.4200,0.4235,0.4270,0.4305,0.4340,0.4375,0.4410,0.4445,0.4480,0.4515,
0.4550,0.4585,0.4620,0.4655,0.4690,0.4725,0.4760,0.4795,0.4830,0.4865,
0.4900,0.4935,0.4970,0.5005,0.5040,0.5075,0.5110,0.5145,0.5180,0.5215,
0.5250,0.5285,0.5320,0.5355,0.5390,0.5425,0.5460,0.5495,0.5530,0.5565,
0.5600,0.5635,0.5670,0.5705,0.5740,0.5775,0.5810,0.5845,0.5880,0.5915,
0.5950,0.5985,0.6020,0.6055,0.6090,0.6125,0.6160,0.6195,0.6230,0.6265,
0.6300,0.6335,0.6370,0.6405,0.6440,0.6475,0.6510,0.6545,0.6580,0.6615,
0.6650,0.6685,0.6720,0.6755,0.6790,0.6825,0.6860,0.6895,0.6930,0.6965,
0.7000
])
n_visible = np.array([
1.4585377,1.45761865,1.456730118,1.455870728,1.455039187,1.454234276,1.453454840,
1.452699788,1.451968089,1.451258766,1.450570894,1.449903597,1.449256044,1.448627445,
1.448017051,1.447424151,1.446848069,1.446288159,1.445743811,1.445214441,1.444699493,
1.444198438,1.443710771,1.443236009,1.442773692,1.442323382,1.441884657,1.441457118,
1.441040380,1.440634076,1.440237854,1.439851378,1.439474326,1.439106388,1.438747267,
1.438396681,1.438054357,1.437720031,1.437393455,1.437074386,1.436762592,1.436457851,
1.436159948,1.435868677,1.435583840,1.435305247,1.435032713,1.434766062,1.434505122,
1.434249731,1.433999730,1.433754966,1.433515292,1.433280566,1.433050651,1.432825415,
1.432604730,1.432388473,1.432176524,1.431968770,1.431765097,1.431565400,1.431369574,
1.431177518,1.430989136,1.430804333,1.430623017,1.430445102,1.430270501,1.430099132,
1.429930914,1.429765771,1.429603626,1.429444407,1.429288044,1.429134467,1.428983610,
1.428835410,1.428689802,1.428546727,1.428406125,1.428267940,1.428132115,1.427998598,
1.427867334,1.427738274,1.427611368,1.427486568,1.427363827,1.427243100,1.427124343,
1.427007511,1.426892565,1.426779463,1.426668165,1.426558634,1.426450831,1.426344720,
1.426240266,1.426137434,1.426036190
])
# ------------------------------------------------
# 2. 插值构建连续 n(λ)
# ------------------------------------------------
interp_n = InterpolatedUnivariateSpline(wl_visible, n_visible)
# ------------------------------------------------
# 3. 红外区 n,k 数据(示例,可替换为真实数据)
# ------------------------------------------------
def pdms_nk(lambda_um):
"""
示例:构建红外折射率 n,k实际请替换 refractiveindex.info 数据)
"""
n = 1.385 + 0.015 * np.exp(-(lambda_um - 10)**2 / 20)
k = 0.15 * np.exp(-(lambda_um - 10)**2 / 5) # 红外区 PDMS 有吸收峰
# 可见光区用插值得到的 n
n[lambda_um < 0.7] = interp_n(lambda_um[lambda_um < 0.7])
k[lambda_um < 0.7] = 0 # 可见光透明
return n + 1j*k
# ------------------------------------------------
# 4. TMM 计算发射率
# ------------------------------------------------
def layer_matrix(n_complex, d_um, lambda_um):
k0 = 2 * np.pi / (lambda_um * 1e-6)
delta = k0 * n_complex * (d_um * 1e-6)
q = n_complex
M11 = np.cos(delta)
M12 = 1j / q * np.sin(delta)
M21 = 1j * q * np.sin(delta)
M22 = np.cos(delta)
return np.array([[M11, M12], [M21, M22]])
def emissivity(lambda_um, d_um):
n0 = 1.0 # 空气
ns = 1.0 # 基底(可修改)
nk = pdms_nk(lambda_um)
M = layer_matrix(nk, d_um, lambda_um)
M11, M12 = M[0,0], M[0,1]
M21, M22 = M[1,0], M[1,1]
numerator = M11 + M12*ns - M21/n0 - M22*ns/n0
denominator = M11 + M12*ns + M21/n0 + M22*ns/n0
R = np.abs(numerator/denominator)**2
T = (ns/n0) / np.abs(denominator)**2
return 1 - R - T
# ------------------------------------------------
# 5. 计算发射率与绘图
# ------------------------------------------------
lambda_range = np.linspace(0.35, 20, 2000)
d_pdms = 10 # 10 μm 厚度
eps = emissivity(lambda_range, d_pdms)
plt.figure(figsize=(10,5))
plt.plot(lambda_range, eps, label=f'd = {d_pdms} μm')
plt.xlabel("Wavelength (μm)")
plt.ylabel("Emissivity")
plt.title("PDMS Thin-film Emissivity Spectrum")
plt.grid(True)
plt.legend()
plt.show()