Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

计算流函数、势函数 相关的问题 #2

Open
NMC-DAVE opened this issue Apr 13, 2020 · 1 comment
Open

计算流函数、势函数 相关的问题 #2

NMC-DAVE opened this issue Apr 13, 2020 · 1 comment

Comments

@NMC-DAVE
Copy link
Member

NMC-DAVE commented Apr 13, 2020

来自 Zhenchen LIU的问题:

在使用 https://github.com/nmcdev/nmc_met_base/blob/master/nmc_met_base/psi_phi.py 上发布的 Python 版 计算流函数、势函数 相关的问题,希望跟您交流:

1)第94行 “pq = optimize.minimize(ja,x,method='L-BFGS-B',jac=grad_ja,” 中的 ja、grad_ja 是否调用的子函数,这边写法是否应该是 有输入参数?

2)第88-89、185-186等含有“.shape[0]/2”的行,类似于“ x[:x.shape[0]/2] = IPSI.reshape(M1*N1)”中的下标引用“x.shape[0]/2”报错“#TypeError: slice indices must be integers or None or have an index method”,感觉可能要加个“int()”,

3)我用自己的数据,会在第94行报错如下:。
不知道是否是我的数据问题。基于3),冒昧问一声,这个系列程序是否有对应的 样本数据,可供试验。^_^

@NMC-DAVE
Copy link
Member Author

NMC-DAVE commented Apr 13, 2020

1) ja、grad_ja 是函数名称,不需要直接给出输入参数;
2)错误已经修正;
3)运行了一个例子,已经通了,可以参考:

M = 64
N = 64
IPSI = np.zeros((M, N))
IPHI = np.zeros((M, N))
DX = np.zeros((M, N)) + 2.5
DY = np.zeros((M, N)) + 2.5
U = np.random.rand(M-1, N-1)
V = np.random.rand(M-1, N-1)
psi,phi = psi_lietal(IPSI,IPHI,DX,DY,U,V)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant