[英]Solving a system of first order differential equations and second order differential equations (Non-linear)
[英]Stable solution of a 4th order non linear differential equations
我已经在 python 中使用 bvp 求解器解决了以下 bvp 问题。
d4y/dx4= 0.00033*V/(0.000001-y)^(2), y(0)=y'(0)=y(1)=y'(1)=0
在上面的 eqn 'V' 是使用 for 循环改变的参数。 有趣的是,对于 V>Vo,上述微分方程的解应该是不稳定的。 对于 V>Vo,bvp 求解器仍然会产生一些错误的值。 一旦出现这种不稳定性,如何让求解器停止计算?
对于归一化方程(改变y
和V
的比例)
y''''*(1e-6-y)**2 = 3.3e-4*V
(1e6*y)''''*(1-1e6*y)**2 = 3.3e14*V
u = 1e6*y, c = 3.3e14*V
u'''' = c/(1-u)**2
我得到c=70.099305
的临界值,即V0=0.2124e-12
。 对于非常小的c
解决方案同样小并且接近y(t)=c/24*(t*(1-t))**2
。 对于c
接近临界值,网格细化集中在接近y=0.4
的最大值处。
c=70.099305
def f(t,u): return [u[1],u[2],u[3],c/(1-u[0])**2]
def bc(u0,u1): return [u0[0], u0[1], u1[0], u1[1]]
t = np.linspace(0,1,5);
u = np.zeros([4,len(t)])
res = solve_bvp(f,bc,t,u, tol=1e-4, max_nodes=5000)
print(res.message)
%matplotlib inline
if res.success:
plt.figure(figsize=(10,5))
t = np.linspace(0,1,502)
plt.plot(t, c/24*(t*(1-t))**2,c='y', lw=3)
plt.plot(t,res.sol(t)[0],'b')
plt.plot(res.x,res.y[0],'xr')
plt.grid(); plt.show()
蓝色 - 数值解,黄色 - 小c
的近似值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.