线性水库模型的解析解与数值解对比

线性水库模型的解析解与数值解对比

1. 解析解

1.1 模型:

在这里插入图片描述

1.2 解析解

在这里插入图片描述

在这里插入图片描述

2. Code

import numpy as  np
import matplotlib.pyplot as plt
#全局字体样式
plt.rcParams['font.sans-serif'] = ['Times new roman']
#全局字体大小
plt.rcParams['font.size'] = 15
#负号正常显示
plt.rcParams['axes.unicode_minus'] = False
fig1=plt.figure(1)
h0=0
a=0.131
S=0.25
t1=np.arange(0,30,1)
t=np.array([0,5,7,10,12,30])
W=np.array([0,0,0.01,0,0.02,0])
plt.step(t,-W,lw=3,color='C9')
plt.xlabel(r'$t(day)$',fontsize=18)
plt.ylabel(r'$I(m/d)$',fontsize=18)
ax=plt.gca()
axloc=['bottom','top','left','right']
for i in axloc:
    ax.spines[i].set_linewidth(2)
ht=[]
for ti in t1:
    if ti<=t[0]:
        h=np.exp(-(a/S)*ti)*(h0)
        ht.append(h)
    else:
        inner_sum = 0
        tii=np.array([ti])
        i=np.sum(tii.reshape(-1,1)>t,axis=1)[0]
        for j in range(1,i):
            inner_sum+=W[j]/a*(np.exp((a/S)*t[j])-np.exp((a/S)*t[j-1]))
        h=np.exp(-(a/S)*ti)*(W[i]/a*(np.exp((a/S)*ti)-np.exp((a/S)*t[i-1]))+inner_sum+h0)
        ht.append(h)
        
        
fig2=plt.figure(2)
plt.plot(t1,ht,lw=3,color='C9')
df1=np.loadtxt(r'C:\Users\Administrator\Desktop\Gelhar.txt')
plt.scatter(df1[:,0],df1[:,1],color='red',facecolor='none',linewidths=2,s=80)
plt.legend(["Analytical Solution","Numerical Solution"])
plt.xlabel(r'$t(day)$',fontsize=18)
plt.ylabel(r'$z(m)$',fontsize=18)
ax=plt.gca()
axloc=['bottom','top','left','right']
for i in axloc:
    ax.spines[i].set_linewidth(2)
plt.show()

2.1 result

在这里插入图片描述
在这里插入图片描述

附上comsol数值模型,有需要可以下载:
Gelhar模型——comsol数值模型

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小孟的CDN

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值