微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

射法自然对流边值问题

如何解决射法自然对流边值问题

我正在尝试解决边界值问题的一个特殊情况,即自然对流的边界层方程:

enter image description here

感谢这个论坛的贡献者@LutzLehmann,这组方程是通过使用 scipy 库中的函数 solve_bvp 求解的。

不幸的是,我没有在这些特定的边界条件下获得正确的结果:

enter image description here

在这种情况下,求解器的初始猜测似乎不起作用,我想知道什么更适合。

代码如下:

import numpy as np
from scipy.integrate import solve_bvp
import matplotlib.pyplot as plt


Pr = 5

def odesys(t,u):
    F,dF,ddF,θ,dθ = u
    return [dF,θ-0.25/Pr*(2*dF*dF-3*F*ddF),dθ,0.75*F*dθ]

def bcs(u0,u1): return [u0[0],u0[1],u1[1],u0[3]-1,u1[3]]

x = np.linspace(0,8,25)
u = [x*x,np.exp(-x),0*x+1,1-x,0*x-1]

res = solve_bvp(odesys,bcs,x,u,tol=1e-5)

print(res.message)

plt.subplot(2,1,1)
plt.plot(res.x,res.y[3],color='#801010',label='$\Delta T$')
plt.legend()
plt.grid()

plt.subplot(2,2)
plt.plot(res.x,res.y[1],'-',color='C0',label="$F'$")
plt.legend()
plt.grid()

这是获得的错误图:

enter image description here

有人可以为这个问题提出一个更好的初始案例来帮助我吗?

感谢您的帮助,

PS:对于命题:

u = [0.5*x*x*np.exp(-x),x*np.exp(-x),-np.exp(-x)]

我明白了:

enter image description here

与文献相比,我期待这个结果(其中 g 是方程组中的 theta):

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。