当前位置:首页>python>数学建模与Python:能量模拟-从分子运动到宏观热力学

数学建模与Python:能量模拟-从分子运动到宏观热力学

  • 2026-03-12 21:55:53
数学建模与Python:能量模拟-从分子运动到宏观热力学

本系列受到 Allen B. Downey 的《Modeling and Simulation in Python》https://greenteapress.com/wp/modsimpy/ 的启发,旨在通过 Python 编程语言,帮助新手同学来探索数学建模的基础内容。

知识背景

热力学是物理学中研究能量、热量、功、熵和自发过程的学科。对于初学者来说,内能(Internal Energy)温度(Temperature)压力(Pressure)这些概念往往比较抽象。

但在微观层面,这一切都变得非常直观:

  • 内能就是所有分子动能的总和。
  • 温度是分子平均动能的量度。
  • 压力是大量分子频繁撞击容器壁所产生的平均力。

在本章中,我们将通过构建一个理想气体分子动力学(Molecular Dynamics, MD)模型,从微观粒子的随机运动出发,模拟出一个宏观的隔热系统,并可视化其能量和压力的变化。

概念介绍

1. 理想气体模型

为了简化计算,我们假设:

  • 分子是刚性小球,只发生弹性碰撞。
  • 分子之间没有相互作用力(除了碰撞瞬间)。
  • 分子与容器壁发生弹性碰撞(动能守恒)。

2. 能量守恒(热力学第一定律)

在一个隔热(Adiabatic)的刚性容器中,系统与外界没有热量交换,也没有做功。根据热力学第一定律:

系统的总内能  应当保持不变。

3. 压力的微观解释

压力  定义为单位面积上受到的力 

在微观上,力来自于分子撞击墙壁时的动量改变。根据牛顿第二定律:

因此,我们可以通过统计一段时间内所有分子撞击墙壁造成的动量变化总和,来计算瞬时压力。

代码实现

我们使用 Python 模拟 200 个气体分子在一个二维封闭容器中的运动。

核心算法

  1. 初始化:随机生成分子的位置和速度。
  2. 运动:在每个时间步 dt 内,分子沿直线匀速运动。
  3. 碰撞检测:检查分子是否碰到墙壁。如果碰到,反转其垂直于墙壁的速度分量(弹性碰撞),并记录动量变化。
  4. 统计:计算当前的系统总动能和对墙壁的压力。

完整代码

你可以直接运行 code/05_gas_simulation.py 来生成模拟动画。

import numpy as npimport matplotlib.pyplot as pltfrom matplotlib.animation import FuncAnimation# 理想气体分子动力学模拟# 1. 系统参数N = 200# 分子数量BOX_SIZE = 10.0# 容器边长V_MAX = 2.0# 最大初始速度MASS = 1.0# 分子质量RADIUS = 0.1# 分子半径DT = 0.05# 时间步长STEPS = 500# 模拟步数# 2. 初始化状态# 随机位置 (避开边界)pos = np.random.uniform(RADIUS, BOX_SIZE - RADIUS, size=(N, 2))# 随机速度vel = np.random.uniform(-V_MAX, V_MAX, size=(N, 2))# 存储历史数据用于绘图history = {'pos': [], 'ke': [], 'pressure': []}# 3. 模拟循环defstep(pos, vel):# 更新位置    pos += vel * DT    # 碰撞检测:与墙壁碰撞 (弹性碰撞)# x 方向边界    mask_x_left = pos[:, 0] < RADIUS    mask_x_right = pos[:, 0] > BOX_SIZE - RADIUS    # 动量变化用于计算压力 (F = dp/dt)    impulse = 0.0if np.any(mask_x_left):        pos[mask_x_left, 0] = RADIUS        vel[mask_x_left, 0] *= -1        impulse += np.sum(2 * MASS * np.abs(vel[mask_x_left, 0]))        if np.any(mask_x_right):        pos[mask_x_right, 0] = BOX_SIZE - RADIUS        vel[mask_x_right, 0] *= -1        impulse += np.sum(2 * MASS * np.abs(vel[mask_x_right, 0]))        # y 方向边界    mask_y_bottom = pos[:, 1] < RADIUS    mask_y_top = pos[:, 1] > BOX_SIZE - RADIUS    if np.any(mask_y_bottom):        pos[mask_y_bottom, 1] = RADIUS        vel[mask_y_bottom, 1] *= -1        impulse += np.sum(2 * MASS * np.abs(vel[mask_y_bottom, 1]))        if np.any(mask_y_top):        pos[mask_y_top, 1] = BOX_SIZE - RADIUS        vel[mask_y_top, 1] *= -1        impulse += np.sum(2 * MASS * np.abs(vel[mask_y_top, 1]))        # 计算瞬时动能 (内能)# KE = 0.5 * m * v^2    ke = 0.5 * MASS * np.sum(vel**2)    # 计算瞬时压力 (P = F/A, 这里是二维, P = F/L)# F = impulse / DT# L = 4 * BOX_SIZE    pressure = impulse / DT / (4 * BOX_SIZE)    return pos, vel, ke, pressure# 运行模拟for _ in range(STEPS):    pos, vel, ke, p = step(pos, vel)    history['pos'].append(pos.copy())    history['ke'].append(ke)    history['pressure'].append(p)# 动态可视化plt.style.use('dark_background')fig = plt.figure(figsize=(126))gs = fig.add_gridspec(22)# --- 左图:气体分子运动 ---ax_box = fig.add_subplot(gs[:, 0])ax_box.set_xlim(0, BOX_SIZE)ax_box.set_ylim(0, BOX_SIZE)ax_box.set_aspect('equal')ax_box.set_title("Ideal Gas Simulation (Adiabatic)", color='white', fontsize=14)# 绘制容器边界rect = plt.Rectangle((00), BOX_SIZE, BOX_SIZE, ec='white', fc='none', lw=2)ax_box.add_patch(rect)# 绘制分子particles, = ax_box.plot([], [], 'o', color='#3498db', markersize=4, alpha=0.8)# --- 右上图:动能 (温度) ---ax_temp = fig.add_subplot(gs[01])ax_temp.set_xlim(0, STEPS)# 动能范围预估ke_mean = np.mean(history['ke'])ax_temp.set_ylim(ke_mean * 0.8, ke_mean * 1.2)ax_temp.set_ylabel("Internal Energy (J)")ax_temp.set_title("System Energy (Temperature)", color='white', fontsize=12)line_ke, = ax_temp.plot([], [], '-', color='#e74c3c', lw=2)# --- 右下图:压力 ---ax_press = fig.add_subplot(gs[11])ax_press.set_xlim(0, STEPS)ax_press.set_ylim(0, max(history['pressure']) * 1.2)ax_press.set_ylabel("Pressure (Pa)")ax_press.set_xlabel("Time Step")ax_press.set_title("Wall Pressure", color='white', fontsize=12)line_press, = ax_press.plot([], [], '-', color='#2ecc71', lw=1, alpha=0.6)# 压力移动平均线line_press_avg, = ax_press.plot([], [], '-', color='white', lw=2, label='Avg Pressure')# 动画更新函数defupdate(frame):# 降采样:每 2 步取 1 帧# 总步数 500 / 2 = 250 帧 < 300    skip = 2    idx = frame * skipif idx >= STEPS: idx = STEPS - 1# 1. 更新粒子位置    p = history['pos'][idx]    particles.set_data(p[:, 0], p[:, 1])    # 2. 更新能量曲线    line_ke.set_data(range(idx+1), history['ke'][:idx+1])    # 3. 更新压力曲线    press_data = history['pressure'][:idx+1]    line_press.set_data(range(idx+1), press_data)    # 计算压力的移动平均 (窗口大小 20)if idx > 20:        avg_p = np.convolve(press_data, np.ones(20)/20, mode='valid')        line_press_avg.set_data(range(19, idx+1), avg_p)    return particles, line_ke, line_press, line_press_avgframes = STEPS // 2ani = FuncAnimation(fig, update, frames=frames, interval=30, blit=True)ani.save('../images/05_gas_simulation.gif', writer='pillow', fps=20)print("Simulation animation saved to ../images/05_gas_simulation.gif")

可视化结果与分析

下面的动态面板展示了模拟的全过程:

Ideal Gas Simulation
  • 左图(分子运动):你可以看到蓝色的气体分子在容器内做无规则的热运动(布朗运动),并不断撞击墙壁。
  • 右上图(内能/温度):红线显示了系统的总动能。你会发现它是一条完美的水平直线。这验证了能量守恒定律——在没有外力做功和热交换的情况下,理想气体的内能是恒定的。
  • 右下图(压力):绿线是瞬时压力,白线是移动平均压力。虽然每个瞬间的撞击力度是随机波动的(噪声),但从统计平均来看,压力稳定在一个恒定的数值。这就解释了为什么宏观上我们能测量到稳定的气压。

绝热压缩与膨胀:活塞模型

在前面的模拟中,容器体积是固定的。现在,让我们引入一个可移动的活塞(Piston),通过改变容器体积来对气体做功。

1. 物理过程

  • 压缩过程(Compression):活塞向内移动,分子撞击活塞时会被反弹回来,且速度增加(类似于你用网球拍击球,球速会变快)。外界对气体做功,气体内能增加,温度升高。
  • 膨胀过程(Expansion):活塞向外移动,分子撞击活塞时反弹速度减小(类似于球打在后退的球拍上)。气体对外界做功,内能减少,温度降低。

2. 代码实现

我们需要修改碰撞检测逻辑,处理动墙(Moving Wall)碰撞:

其中  是活塞速度。

完整代码如下:

import numpy as npimport matplotlib.pyplot as pltfrom matplotlib.animation import FuncAnimation# 理想气体绝热压缩/膨胀模拟# 1. 系统参数N = 100# 分子数量BOX_WIDTH_INIT = 10.0BOX_HEIGHT = 10.0V_MAX = 2.0# 初始速度MASS = 1.0RADIUS = 0.1DT = 0.05STEPS = 600# 活塞运动参数PISTON_SPEED = 0.02# 活塞速度 (正值压缩,负值膨胀)# 我们设计一个周期运动:压缩 -> 膨胀defget_piston_pos(step):# 简单的正弦运动模拟活塞# 周期 600 步    phase = step / STEPS * 2 * np.pi# 宽度在 5.0 到 10.0 之间变化return7.5 + 2.5 * np.cos(phase)defget_piston_vel(step):# 位置的导数    phase = step / STEPS * 2 * np.pireturn-2.5 * np.sin(phase) * (2 * np.pi / STEPS / DT)# 2. 初始化状态pos = np.random.uniform(RADIUS, BOX_WIDTH_INIT - RADIUS, size=(N, 2))pos[:, 1] = np.random.uniform(RADIUS, BOX_HEIGHT - RADIUS, size=N) # y 轴范围固定vel = np.random.uniform(-V_MAX, V_MAX, size=(N, 2))# 存储历史history = {'pos': [], 'ke': [], 'pressure': [], 'volume': [], 'box_width': []}# 3. 模拟循环for step_idx in range(STEPS):# 当前容器宽度 (由活塞位置决定)    current_width = get_piston_pos(step_idx)    next_width = get_piston_pos(step_idx + 1)# 活塞瞬时速度    v_piston = (next_width - current_width) / DT    # 更新分子位置    pos += vel * DT    # 碰撞检测    impulse = 0.0# --- 右侧活塞墙壁 (动墙) ---# 只有 x > current_width - RADIUS 的分子可能碰撞    mask_piston = pos[:, 0] > current_width - RADIUS    if np.any(mask_piston):# 修正位置        pos[mask_piston, 0] = current_width - RADIUS        # 弹性碰撞公式 (动墙)# v_new = 2 * v_wall - v_old# 这里 v_wall = v_piston        v_old_x = vel[mask_piston, 0]        v_new_x = 2 * v_piston - v_old_x        vel[mask_piston, 0] = v_new_x        # 动量变化 (相对于静止参考系)# 但计算压力时通常用相对动量变化,或者直接用 F = ma# 这里简化:压力来自于分子对活塞的冲量# 冲量 I = m * (v_new - v_old)        impulse += np.sum(MASS * np.abs(v_new_x - v_old_x))        # --- 左侧、上侧、下侧 (静墙) ---    mask_left = pos[:, 0] < RADIUSif np.any(mask_left):        pos[mask_left, 0] = RADIUS        vel[mask_left, 0] *= -1    mask_bottom = pos[:, 1] < RADIUSif np.any(mask_bottom):        pos[mask_bottom, 1] = RADIUS        vel[mask_bottom, 1] *= -1    mask_top = pos[:, 1] > BOX_HEIGHT - RADIUSif np.any(mask_top):        pos[mask_top, 1] = BOX_HEIGHT - RADIUS        vel[mask_top, 1] *= -1# 记录数据    ke = 0.5 * MASS * np.sum(vel**2)    pressure = impulse / DT / BOX_HEIGHT # 只计算活塞受到的压力 P=F/L        history['pos'].append(pos.copy())    history['ke'].append(ke)    history['pressure'].append(pressure)    history['box_width'].append(current_width)    history['volume'].append(current_width * BOX_HEIGHT)# 动态可视化plt.style.use('dark_background')fig = plt.figure(figsize=(1010))# 调整布局,增加 hspace 防止重叠gs = fig.add_gridspec(31, height_ratios=[211], hspace=0.4)# --- 上图:活塞运动 ---ax_box = fig.add_subplot(gs[0])ax_box.set_xlim(012)ax_box.set_ylim(010)ax_box.set_aspect('equal')ax_box.set_title("Adiabatic Compression/Expansion", color='white', fontsize=14)ax_box.set_xlabel("Volume Change (Piston Movement)")# 容器边界wall_top = ax_box.axhline(BOX_HEIGHT, color='white', lw=2)wall_bottom = ax_box.axhline(0, color='white', lw=2)wall_left = ax_box.axvline(0, color='white', lw=2)# 活塞piston_line = ax_box.axvline(BOX_WIDTH_INIT, color='#e74c3c', lw=4, label='Piston')# 分子particles, = ax_box.plot([], [], 'o', color='#3498db', markersize=5, alpha=0.8)# --- 中图:温度 (动能) ---ax_temp = fig.add_subplot(gs[1])ax_temp.set_xlim(0, STEPS)ax_temp.set_ylim(np.min(history['ke'])*0.8, np.max(history['ke'])*1.2)ax_temp.set_ylabel("Internal Energy (Temp)")ax_temp.grid(True, linestyle='--', alpha=0.3)line_ke, = ax_temp.plot([], [], '-', color='#f1c40f', lw=2)# --- 下图:压力 ---ax_press = fig.add_subplot(gs[2])ax_press.set_xlim(0, STEPS)ax_press.set_ylim(0, np.max(history['pressure'])*1.5)ax_press.set_ylabel("Pressure on Piston")ax_press.set_xlabel("Time Step")ax_press.grid(True, linestyle='--', alpha=0.3)line_press, = ax_press.plot([], [], '-', color='#2ecc71', lw=1, alpha=0.5)line_press_avg, = ax_press.plot([], [], '-', color='white', lw=2)defupdate(frame):# 降采样:每 3 步取 1 帧# 总步数 600 / 3 = 200 帧 < 300    skip = 3    idx = frame * skipif idx >= STEPS: idx = STEPS - 1# 1. 更新活塞和分子    width = history['box_width'][idx]    piston_line.set_xdata([width, width])        p = history['pos'][idx]    particles.set_data(p[:, 0], p[:, 1])    # 2. 更新曲线# xdata 对应模拟步数,而不是帧数    current_step = idx    xdata = range(current_step + 1)        line_ke.set_data(xdata, history['ke'][:current_step+1])        press_data = history['pressure'][:current_step+1]    line_press.set_data(xdata, press_data)    if current_step > 10:        avg_p = np.convolve(press_data, np.ones(10)/10, mode='valid')        line_press_avg.set_data(range(9, current_step+1), avg_p)        return piston_line, particles, line_ke, line_press, line_press_avgframes = STEPS // 3ani = FuncAnimation(fig, update, frames=frames, interval=30, blit=True)ani.save('../images/05_piston_simulation.gif', writer='pillow', fps=20)print("Piston animation saved to ../images/05_piston_simulation.gif")

3. 可视化结果

Adiabatic Piston Simulation
  • 上图:展示了活塞(红线)的周期性运动。你可以看到当活塞向左压缩时,分子运动明显变剧烈;当活塞向右膨胀时,分子运动变缓慢。
  • 中图(温度/内能):黄线显示了系统的温度变化。压缩升温,膨胀降温,这正是柴油发动机点火(压缩引燃)和冰箱制冷(膨胀吸热)的基本原理。
  • 下图(压力):绿线显示了气体对活塞的压力。体积越小,压力越大(波义耳定律),且温度升高进一步加剧了压力的上升。

总结

通过这个模拟,我们成功地架起了微观粒子运动与宏观热力学定律之间的桥梁:

  1. 微观随机性(分子的混乱运动)导致了宏观稳定性(稳定的压力和温度)。
  2. 能量守恒在微观碰撞中得到了严格的体现。
  3. 压力本质上是大量分子撞击效应的统计平均。

这种分子动力学模拟方法不仅可以用于理想气体,通过引入分子间作用力等等,还可以模拟液体、固体甚至相变过程。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 18:18:23 HTTP/2.0 GET : https://f.mffb.com.cn/a/479385.html
  2. 运行时间 : 0.097183s [ 吞吐率:10.29req/s ] 内存消耗:5,032.20kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=5ed9c6a64202bbf91cab82e954c23104
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000573s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000692s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000265s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000276s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000487s ]
  6. SELECT * FROM `set` [ RunTime:0.000198s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000516s ]
  8. SELECT * FROM `article` WHERE `id` = 479385 LIMIT 1 [ RunTime:0.000427s ]
  9. UPDATE `article` SET `lasttime` = 1774606703 WHERE `id` = 479385 [ RunTime:0.011914s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000403s ]
  11. SELECT * FROM `article` WHERE `id` < 479385 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000617s ]
  12. SELECT * FROM `article` WHERE `id` > 479385 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002020s ]
  13. SELECT * FROM `article` WHERE `id` < 479385 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001273s ]
  14. SELECT * FROM `article` WHERE `id` < 479385 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002637s ]
  15. SELECT * FROM `article` WHERE `id` < 479385 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003623s ]
0.098849s