-
Notifications
You must be signed in to change notification settings - Fork 5
/
jcb.py
81 lines (51 loc) · 1.4 KB
/
jcb.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 9 13:59:33 2017
@author: pianarol
"""
import numpy as np
import math
###function gss ###
def gss(t,s):
'''JCB_GSS - Linear Least Square fitting of Jacob solution
Syntax: p = hp.jcb.gss(t,s,tmin,tmax)
p(1) = a = slope of Jacob straight line
p(2) = t0 = intercept of the Jacob straight line
t = time
s = drawdown
tmin = optional argument: start of the fitting period
tmax = optional argument: end of the fitting period
Description:
First guess for the parameters of Jacob solution
See also: jcb_dim, jcb_dmo, jcb_rpt'''
tmin = t[0]
tmax = t[len(t)-1]
logt = []
for i in range(0, len(t)):
logt.append(math.log10(t[i]))
t1 = []
for i in range(0, len(logt)):
t1.append(1)
g = np.transpose([logt, t1])
g1 = np.transpose(g)
p1 = np.linalg.inv(np.dot(g1,g))
p2 = np.dot(p1,g1)
p = np.dot(p2,s)
a = p[0]
c = p[1]
t0 = math.pow(10, -c/a)
p[1] = t0
return a,t0
###function dls ###
def dls(td):
'''JCB_DLS - Jacob dimensionless drawdown
Syntax: s,d = hp.jcb.dls(td)
Description:
provides the dimensionless drawdown and derivative at reduced time td
See also: jcb_dmo
'''
s = []
for i in range(0, len(td)):
s.append(0.5*(math.log(4*td[i])-0.5772))
return s