鄭素佩,靳放,封建湖,林云云
雙曲型方程激波捕捉的物理信息神經網絡(PINN)算法
鄭素佩,靳放*,封建湖,林云云
(長安大學 理學院,陜西 西安 710064)
雙曲型方程的數值求解算法研究一直是偏微分方程研究的熱點,其中,雙曲型方程的間斷捕捉是難點。受物理信息神經網絡(physics-informed neural networks,PINN)啟發,構造了改進的PINN算法,近似求解雙曲型方程的間斷問題。將坐標構造的數據集作為神經網絡的輸入,將PINN算法中的損失函數作為訓練輸出值與參考解(基于細網格的熵相容格式數據)或準確解的誤差值,通過網絡優化,最小化損失函數,得到最優網絡參數。最后用數值算例驗證了算法的可行性,數值結果表明,本文算法能捕捉激波,分辨率高,且未產生偽振蕩。
雙曲守恒律方程;網絡預測;物理信息神經網絡(PINN);激波捕捉
雙曲守恒律方程是一類較特殊的偏微分方程,可用于描述流體受力運動的歐拉方程、導電流體在磁場中運動的磁流體方程、海洋流體運動的淺水波方程等實際問題。雙曲守恒律方程的顯著特性之一是即使初始條件是光滑的,其解也可能是間斷的。正確理解雙曲守恒律方程的特性,并設計合理的數值格式,對數值模擬實際問題非常重要。目前已有許多有效的方法,如迎風格式、Lax-Friedrichs格式、ENO/WENO(essentially non-oscillatory/weighted essentially non-oscillatory)格式[1]、熵守恒格式、熵穩定格式[2]及在這些格式上改進的算法[3-5]。
除以上傳統數值求解算法外,近年來,深度學習在求解偏微分方程中的應用研究也取得了大量成果[6-8]。深度學習作為一種現代數值計算方法被應用于醫學影像、自然語言處理、工程等領域[9],被認為是一種最先進的分類和擬合函數工具。萬能近似定理[10]表明,如果前饋神經網絡具有線性輸出層和至少一層“擠壓”激活函數隱藏層,那么只要給予網絡足夠數量的隱藏單元,就可以任意(高)精度逼近任何從一個有限維空間到另一個有限維空間的Borel可測函數[11]。CHEN等[12]指出,用一個單一的隱藏層神經網絡可以任意精度逼近任何函數,這說明神經網絡實際上可以以任意高的精度逼近原函數,甚至逼近非線性算子,即神經網絡是通用的函數逼近器。目前,最具代表性的基于深度學習求解偏微分方程的工作是物理信息神經網絡(physics-informed neural networks,PINN)[13],并廣受關注[14-16]。PINN可利用前饋神經網絡直接處理原始偏微分方程,通過將偏微分方程作為正則化項加入損失函數,即在神經網絡中加入了偏微分方程的物理規律。經此處理使得訓練過程中只需要少量的數據便可得到可靠的結果,加快了訓練的過程。PINN在處理連續問題及反問題時取得了很大成功,但在處理具有不連續解的雙曲守恒律方程時性能較差。例如,當被用于處理Burgers方程時,為防止偽振蕩,通常需添加黏性項。如果黏性項消失或黏度系數很小,PINN就很難訓練,亦無法捕獲激波。
對于雙曲守恒律方程,由于其解易發展為間斷,因此,在間斷附近需慎用傳統數值算法。為此,本文基于PINN的思想,將坐標構造的數據集作為神經網絡的輸入,將損失函數作為訓練的輸出值與所給數據的誤差值,提出了一種改進的PINN算法,用于求解雙曲守恒律方程的間斷問題,數值結果表明,所提算法可以捕獲激波且未產生偽振蕩。
一維方程組:





對于特征多項式方程:


對于二維方程組:


由鏈式法則,式(2)可改寫為擬線性形式

二階熵守恒格式在光滑解區域效果很好,但在間斷區域會產生振蕩。ROE[17]在熵守恒格式基礎上通過添加數值黏性項,得到了一類熵穩定格式。用此格式求解雙曲守恒律方程,當跨越激波時,會產生激波強度三次方量級的熵增,因此,需添加耗散項,以控制激波處的熵增。ISMAIL等[2]將左右特征速度差分的絕對值添加至數值黏性項,讓其產生足夠的熵耗散,以消除熵增量,確保格式的熵穩定。熵相容格式的數值通量式為

PINN算法利用前饋神經網絡,通過在損失函數中加入偏微分方程,將偏微分方程作為正則項,將物理信息引入神經網絡,在處理連續問題及反問題時取得了成功,但在處理具有不連續解的雙曲守恒律方程時性能較差。由于激波由多條壓縮波相交而成,可導致熵增等,所以僅用方程控制損失函數,無法解釋其包含的物理特征,造成PINN算法在求解雙曲守恒律方程間斷問題時效果不好。為此本文提出了改進的PINN算法。


最小,其中,


PINN中原損失函數的定義為

其中,



圖1 改進的PINN算法的網絡結構

圖2 無黏Burgers方程訓練集、測試集預測值與精確解的比較
用類PINN算法求解一維、二維雙曲型方程間斷問題。在所有算例優化過程中,只對隱藏層使用tanh激活函數,輸出層未使用激活函數。為檢驗訓練模型的性能并防止過擬合,以下所有算例的數據均按空間層均勻選取,按8∶2的比例將時間層分為訓練集和測試集,其中測試集數據由隔點取樣方法得到。
算例1 無黏Burgers方程

滿足初始條件:



圖3 無黏Burgers方程壓縮波訓練集、測試集預測值與精確解的比較
Fig.3 Comparison of prediction training set, prediction test set and exact solution of compressible waves of non-viscosity Burgers equation
算例3 線性對流方程

滿足初始條件:
其中,


圖4 線性對流方程壓縮波訓練集、測試集預測值與精確解的比較
Fig.4 Comparison of prediction training sets, prediction test sets and exact solutions for linear convection equations
算例4 一維Euler方程Sod激波管問題。
一維Euler方程

其中,




圖5 Euler方程壓縮波訓練集、測試集預測值與精確解的比較
Fig.5 Comparison of prediction training sets, prediction test sets and exact solutions of Euler equations
算例5 二維無黏Burgers方程

邊界條件為



圖6 二維無黏Burgers方程訓練集、測試集預測值與精確解的比較
受PINN啟發,提出了一種求解雙曲守恒律方程的改進的PINN算法。數值結果表明,經過多次訓練,本文方法可用于求解雙曲型方程靜態激波問題、由連續狀態發展為的激波問題、多波形問題、二維多激波問題。此外發現,在網絡中加入正則化項不能提高網絡的性能,有時反而令結果更糟,隨機與非隨機取樣訓練集與測試集均不影響效果。如何提高網絡的精度以及如何將深度學習與雙曲守恒律方程更好地結合,尚待進一步研究。
[1] LIU X D, OSHER S, CHAN T. Weighted essentially non-oscillatory schemes[J]. Journal of Computational Physics, 1994, 115(1): 200-212. DOI:10.1006/jcph.1994.1187
[2] ISMAIL F, ROE P L. Affordable, entropy-consistent Euler flux functions II: Entropy production at shocks[J]. Journal of Computational Physics, 2009, 228(15): 5410-5436. DOI:10.1016/j.jcp. 2009.04.021
[3] 王令,鄭素佩. 基于移動網格的熵穩定格式求解淺水波方程[J]. 水動力學研究與進展(A輯), 2020, 35(2): 188-193. DOI:10.16076/j.cnki.cjhd.2020. 02.006
WANG L, ZHENG S P. Solving shallow water wave equation based on moving grid entropy stable scheme[J]. Chinese Journal of Hydrodynamics(A), 2020, 35(2): 188-193. DOI:10.16076/j.cnki.cjhd.2020.02.006
[4] 程曉晗,聶玉峰,蔡力,等. 基于移動網格的熵穩定格式[J]. 計算物理, 2017, 34(2): 175-182. DOI:10. 19596/j.cnki.1001-246x.2017.02.007
CHENG X H, NIE Y F, CAI L, et al. Entropy stable scheme based on moving meshes for hyperbolic conservation laws[J]. Chinese Journal of Computational Physics, 2017, 34(2): 175-182. DOI:10.19596/j.cnki.1001-246x.2017.02.007
[5] TANG H Z, TANG T. Adaptive mesh methods for one- and two-dimensional hyperbolic conservation laws[J]. SIAM Journal on Numerical Analysis,2003,41(2): 487-515. DOI:10.1137/S003614290138437X
[6] HAN J Q, ARNULF J, E W N. Solving high-dimensional partial differential equations using deep learning[J]. Proceedings of the National Academy of Sciences, 2018, 115(34): 8505-8510. DOI:10. 1073/pnas.1718942115
[7] SIRIGNANO J, SPILIOPOULOS K. DGM: A deep learning algorithm for solving partial differential equations[J]. Journal of Computational Physics, 2018, 375: 1339-1364. DOI:10.1016/j.jcp.2018. 08.029
[8] SUN L N, GAO H, PAN S W, et al. Surrogate modeling for fluid flows based on physics-constrained deep learning without simulation data[J]. Computer Methods in Applied Mechanics and Engineering, 2020, 361: 112732. DOI:10.1016/j.cma.2019. 112732
[9] 黃婕,張豐,杜震洪,等. 基于RNN-CNN集成深度學習模型的PM2.5小時濃度預測[J]. 浙江大學學報(理學版), 2019, 46(3): 370-379. DOI:10.3785/j.issn.1008-9497.2019.03.016
HUANG J, ZHANG F, DU Z H, et al. Hourly concentration prediction of PM2.5based on RNN-CNN ensemble deep learning model[J]. Journal of Zhejiang University(Science Edition), 2019, 46(3): 370-379. DOI:10.3785/j.issn.1008-9497. 2019.03.016
[10]HORNIK K, STINCHCOMBE M, WHITE H. Universal approximation of an unknown mapping and its derivatives using multilayer feedforward networks[J]. Neural Networks, 1990, 3(5): 551-560. DOI:10.1016/0893-6080(90)90005-6
[11]ALLAN P. Approximation theory of the MLP model in neural networks[J]. Acta Numerica, 1999, 8: 143-195. DOI:10.1017/S0962492900002919
[12]CHEN T, CHEN H. Universal approximation to nonlinear operators by neural networks with arbitrary activation functions and its application to dynamical systems[J]. IEEE Transactions on Neural Networks, 1995, 6(4): 911-917. DOI:10.1109/72.392253
[13]RAISSI M, PERDIKARIS P, KARNIADAKIS G E. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations[J]. Journal of Computational Physics, 2019, 378: 686-707. DOI:10.1016/j.jcp.2018.10.045
[14]JAGTAP A D, KAWAGUCHI K, KARNIADAKIS G E. Adaptive activation functions accelerate convergence in deep and physics-informed neural networks[J]. Journal of Computational Physics, 2020, 404: 109136. DOI:10.1016/j.jcp.2019.109136
[15]LU L, MENG X H, MAO Z P, et al. DeepXDE: A deep learning library for solving differential equations[J]. SIAM Review, 2021, 63(1): 208-228. DOI:10.1137/19M1274067
[16]MAO Z P, JAGTAP A D, KARNIADAKIS G E. Physics-informed neural networks for high-speed flows[J]. Computer Methods in Applied Mechanics and Engineering, 2020, 360: 112789. DOI:10. 1016/j.cma.2019.112789
[17]ROE P L. Affordable,entrope-consisted,Euler flux function (with application to the carbuncle phenomenon)[C]// Proceedings of 11th International Conference on Hyperbolic Problems: Theory, Numerics, Applications. Lyon: Springe, 2006.
PINN-type algorithm for shock capturing of hyperbolic equations
ZHENG Supei, JIN Fang, FENG Jianhu, LIN Yunyun
,,710064,)
The numerical solution of hyperbolic equation is a well-know hot topic in the field of numerical solution of partial differential equation, among which the discontinuous capturing of hyperbolic equation is always a difficult problem. Inspired by physical-informed neural networks (PINN), this paper presents a PINN-type algorithm to approximately solve discontinuity problem of hyperbolic equations. It takes the data set constructed by coordinate as the input of neural network. The loss function in PINN algorithm is converted to the error between the output value of the training network and the reference solution (entropy compatible format data based on the fine grid) or the exact solution. Then the loss function is minimized by network optimization to obtain the optimal network parameters. Finally, some numerical examples are demonstrated to verify the feasibility of the proposed algorithm. The numerical results show that the proposed algorithm can capture shock waves, and it has high resolution, without nonphysical oscillations.
hyperbolic conservation laws equation; network prediction; PINN; shock capturing
O 241.8
A
1008?9497(2023)01?056?07
2021?11?12.
國家自然科學基金資助項目(11971075);陜西省自然科學基金青年項目(2020JQ-338,2020JQ-342).
鄭素佩(1978—),ORCID:https://orcid.org/0000- 0003-2502-6998,女,博士,副教授,主要從事微分方程數值算法研究.
通信作者,ORCID:https://orcid.org/0000-0002-4387-5445,E-mail:jinfang53@163.com.
