function - 对 u(x,t) 数组应用周期性边界条件
问题描述
所以我认为我错误地应用了周期性边界条件。这是 Lax Wendroff 方法
def LW_hflux_eq(a,c,delt,delx,u0,flux):
x = np.linspace(0,L,round(L/delx))
t = np.linspace(0,(L/a)/4,round(((L/a)/4)/delt))
u_arr = np.zeros((len(x),len(t)+1))
# Intial Condition
u_arr[:,0] = u0
countx = np.arange(1,len(x)-1)
countt = np.arange(0,len(t))
#Lax-Wendroff (no limiter)
for l in countt:
for j in countx:
u_arr[j,l+1] = u_arr[j,l] - c*(u_arr[j,l]+(((1-c)/2)*(u_arr[j+1,l]-u_arr[j,l])*flux) - (u_arr[j-1,l]+((1-c)/2)*(u_arr[j,l]-u_arr[j-1,l])*flux))
u_arr[-1,l+1] = u_arr[-2,l]
u_arr[0,l+1] = u_arr[-1,l]
return u_arr
返回前的最后两行是 PBC。我这样做正确吗?应用此功能时,我遇到了奇怪的错误。试图找到它的根本原因。
谢谢!
解决方案
推荐阅读
- flutter - 在操场上运行的 Graphql_flutter 突变在运行设备/模拟器上不起作用
- php - WooCommerce 管理员产品自定义复选框字段不保存价值
- wordpress - BuddyPress 通知列表锚标签 URL 设置错误
- oracle - Oracle 时间戳格式“DD-MON-RR HH.MI.SSXFF AM”中 X 的含义
- single-sign-on - 如何在 MS Teams 个人应用程序中配置 SSO 到 SAP Fiori 应用程序
- mysql - 如何在 GORM 上使用 mysql Union All?
- java - 在 Eclipse IDE 中获取“错误:无法找到或加载主类 aQute.launcher.Launcher”,即使它在命令行中工作也是如此
- java - Chaquopy 将 java 类中的值传递给 python 函数并使用它
- stripe-payments - Stripe Connect 快速入职流程
- javascript - 数据表 - 防止事件冒泡