2
from fluidity_tools import stat_parser as stat
3
from math import log, pi, cos, sin, cosh, sinh, exp
4
from numpy import sqrt, interp
5
from scipy.integrate import quad
12
rho0 = 4500. # kg/m**3
13
rhou = 2*rho0 # kg/m**3
27
wavelength = wavelengthfactor*D
28
return 2.0*pi/wavelength
30
def nond_wavenumber():
31
wavelength = wavelengthfactor
32
return 2.0*pi/wavelength
35
delta_rho = (rhou-rho0)*g
39
return -1.0*(((delta_rho*k**2*mu + k**2*mu*rhog)*D*sinh(D*k)**2 - (delta_rho*k**2*mu + k**2*mu*rhog)*D*cosh(D*k)**2 \
40
- (delta_rho*k*mu + k*mu*rhog)*sinh(D*k)*cosh(D*k) - sqrt((delta_rho**2*k**2 + 2*delta_rho*k**2*rhog \
41
+ k**2*rhog**2)*D**2*cosh(D*k)**4 - 2*(delta_rho**2*k + 2*delta_rho*k*rhog + k*rhog**2)*D*sinh(D*k)**3*cosh(D*k) \
42
+ 2*(delta_rho**2*k + 2*delta_rho*k*rhog + k*rhog**2)*D*sinh(D*k)*cosh(D*k)**3 \
43
+ ((delta_rho**2*k**2 - 2*delta_rho*k**2*rhog + k**2*rhog**2)*D**2 - 4*delta_rho*rhog)*sinh(D*k)**4 \
44
- (2*(delta_rho**2*k**2 + k**2*rhog**2)*D**2 - delta_rho**2 - 2*delta_rho*rhog \
45
- rhog**2)*sinh(D*k)**2*cosh(D*k)**2)*k*mu)/(delta_rho*rhog*sinh(D*k)**2))
48
delta_rho = (rhou-rho0)*g
52
return -1.0*(((delta_rho*k**2*mu + k**2*mu*rhog)*D*sinh(D*k)**2 - (delta_rho*k**2*mu + k**2*mu*rhog)*D*cosh(D*k)**2 \
53
- (delta_rho*k*mu + k*mu*rhog)*sinh(D*k)*cosh(D*k) + sqrt((delta_rho**2*k**2 + 2*delta_rho*k**2*rhog \
54
+ k**2*rhog**2)*D**2*cosh(D*k)**4 - 2*(delta_rho**2*k + 2*delta_rho*k*rhog \
55
+ k*rhog**2)*D*sinh(D*k)**3*cosh(D*k) + 2*(delta_rho**2*k + 2*delta_rho*k*rhog \
56
+ k*rhog**2)*D*sinh(D*k)*cosh(D*k)**3 + ((delta_rho**2*k**2 - 2*delta_rho*k**2*rhog \
57
+ k**2*rhog**2)*D**2 - 4*delta_rho*rhog)*sinh(D*k)**4 - (2*(delta_rho**2*k**2 + k**2*rhog**2)*D**2 \
58
- delta_rho**2 - 2*delta_rho*rhog - rhog**2)*sinh(D*k)**2*cosh(D*k)**2)*k*mu)/(delta_rho*rhog*sinh(D*k)**2))
61
return min(t0_eta(), t0_xi())
64
return rho0*g*D*t0()/mu0
76
delta_rho = (rhou-rho0)*nond_factor()/rho0
77
rhog = nond_factor() # use this as a proxy for the nondimensional factorisation
78
return ((0.5*(exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k + k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog - sqrt((delta_rho**2\
79
- 2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 + 2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k + 2*delta_rho*k*rhog\
80
+ k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog + delta_rho**2 + 2*delta_rho*rhog +\
81
rhog**2)*sinh(k)**2)*k))/((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho -\
82
rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 -\
83
2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4\
84
+ k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) +\
85
2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 -\
86
2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 +\
87
2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3\
88
- rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2\
89
+ sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
90
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
91
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
92
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
93
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)))\
94
- exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k + k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog + sqrt((delta_rho**2 -\
95
2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 + 2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k + 2*delta_rho*k*rhog\
96
+ k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog + delta_rho**2 + 2*delta_rho*rhog +\
97
rhog**2)*sinh(k)**2)*k))/((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho -\
98
rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 -\
99
2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4\
100
+ k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) +\
101
2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 -\
102
2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 +\
103
2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3\
104
- rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2\
105
+ sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
106
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
107
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
108
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
109
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
110
rhog**2*sinh(k)**2*cosh(k)**2))))*G0 + (((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
111
rhog*sinh(k)*cosh(k)**2)/(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho -\
112
rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 -\
113
2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4\
114
+ k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) +\
115
2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 -\
116
2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 +\
117
2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3\
118
- rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2\
119
+ sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
120
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
121
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
122
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
123
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
124
rhog**2*sinh(k)**2*cosh(k)**2)))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
125
k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
126
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
127
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
128
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
129
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)))\
130
+ 1)*exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k + k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog + sqrt((delta_rho**2 -\
131
2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 + 2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k + 2*delta_rho*k*rhog +\
132
k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog + delta_rho**2 + 2*delta_rho*rhog + rhog**2)*sinh(k)**2)*k)) -\
133
(k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)*exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k\
134
+ k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog - sqrt((delta_rho**2 - 2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 +\
135
2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k + 2*delta_rho*k*rhog + k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog +\
136
delta_rho**2 + 2*delta_rho*rhog + rhog**2)*sinh(k)**2)*k))/(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
137
rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 -\
138
sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4\
139
+ 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 -\
140
2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) +\
141
4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2\
142
- 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) -\
143
k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2\
144
+ (delta_rho*k - k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 +\
145
delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 -\
146
2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 -\
147
4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) +\
148
2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
149
rhog**2*sinh(k)**2*cosh(k)**2)))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
150
k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
151
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
152
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
153
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
154
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
155
rhog**2*sinh(k)**2*cosh(k)**2))))*F0))*cos(k*x)
158
k = nond_wavenumber()
161
delta_rho = (rhou-rho0)*nond_factor()/rho0
162
rhog = nond_factor() # use this as a proxy for the nondimensional factorisation
163
return ((((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
164
rhog*sinh(k)*cosh(k)**2)*exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k + k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog -\
165
sqrt((delta_rho**2 - 2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 + 2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k +\
166
2*delta_rho*k*rhog + k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog + delta_rho**2 + 2*delta_rho*rhog +\
167
rhog**2)*sinh(k)**2)*k))/(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho -\
168
rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 -\
169
2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4\
170
+ k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) +\
171
2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 -\
172
2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 +\
173
2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3\
174
- rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2\
175
+ sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
176
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
177
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
178
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
179
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
180
rhog**2*sinh(k)**2*cosh(k)**2)))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
181
k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
182
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
183
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
184
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
185
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)))\
186
- (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
187
rhog*sinh(k)*cosh(k)**2)*exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k + k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog +\
188
sqrt((delta_rho**2 - 2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 + 2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k +\
189
2*delta_rho*k*rhog + k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog + delta_rho**2 + 2*delta_rho*rhog +\
190
rhog**2)*sinh(k)**2)*k))/(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho -\
191
rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 -\
192
2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4\
193
+ k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) +\
194
2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 -\
195
2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 +\
196
2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3\
197
- rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2\
198
+ sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
199
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
200
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
201
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
202
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
203
rhog**2*sinh(k)**2*cosh(k)**2)))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
204
k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
205
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
206
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
207
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
208
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
209
rhog**2*sinh(k)**2*cosh(k)**2))))*G0 + 2*(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
210
rhog*sinh(k)*cosh(k)**2)/(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho -\
211
rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 -\
212
2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4\
213
+ k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) +\
214
2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 -\
215
2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 +\
216
2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3\
217
- rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2\
218
+ sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
219
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
220
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
221
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
222
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
223
rhog**2*sinh(k)**2*cosh(k)**2)))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
224
k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
225
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
226
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
227
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
228
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)))\
229
+ 1)*(k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
230
rhog*sinh(k)*cosh(k)**2)*exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k + k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog +\
231
sqrt((delta_rho**2 - 2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 + 2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k +\
232
2*delta_rho*k*rhog + k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog + delta_rho**2 + 2*delta_rho*rhog +\
233
rhog**2)*sinh(k)**2)*k))/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 +\
234
sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4\
235
+ 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 -\
236
2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) +\
237
4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2\
238
- 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) -\
239
k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)**2*exp(-delta_rho*rhog*t*sinh(k)**2/((delta_rho*k +\
240
k*rhog)*sinh(k)*cosh(k) + delta_rho*k**2 + k**2*rhog - sqrt((delta_rho**2 - 2*delta_rho*rhog + rhog**2)*sinh(k)**4 + delta_rho**2*k**2 +\
241
2*delta_rho*k**2*rhog + k**2*rhog**2 + 2*(delta_rho**2*k + 2*delta_rho*k*rhog + k*rhog**2)*sinh(k)*cosh(k) + (4*delta_rho*k**2*rhog +\
242
delta_rho**2 + 2*delta_rho*rhog + rhog**2)*sinh(k)**2)*k))/(((k*rhog*sinh(k)**2*cosh(k) - k*rhog*cosh(k)**3 + rhog*sinh(k)**3 -\
243
rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k - k*rhog)*cosh(k)**2 -\
244
sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4\
245
+ 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 -\
246
2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k) +\
247
4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2\
248
- 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 + rhog**2*sinh(k)**2*cosh(k)**2)) - (k*rhog*sinh(k)**2*cosh(k) -\
249
k*rhog*cosh(k)**3 + rhog*sinh(k)**3 - rhog*sinh(k)*cosh(k)**2)/((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2\
250
+ (delta_rho*k - k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 +\
251
delta_rho**2*k**2*cosh(k)**4 - 2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 -\
252
2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 + k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 -\
253
4*delta_rho*k*rhog*sinh(k)**3*cosh(k) + 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) +\
254
2*k*rhog**2*sinh(k)*cosh(k)**3 + delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
255
rhog**2*sinh(k)**2*cosh(k)**2)))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
256
k*rhog)*cosh(k)**2 - sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
257
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
258
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
259
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
260
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
261
rhog**2*sinh(k)**2*cosh(k)**2))*((delta_rho - rhog)*sinh(k)*cosh(k) - (delta_rho*k - k*rhog)*sinh(k)**2 + (delta_rho*k -\
262
k*rhog)*cosh(k)**2 + sqrt(delta_rho**2*k**2*sinh(k)**4 - 2*delta_rho**2*k**2*sinh(k)**2*cosh(k)**2 + delta_rho**2*k**2*cosh(k)**4 -\
263
2*delta_rho*k**2*rhog*sinh(k)**4 + 2*delta_rho*k**2*rhog*cosh(k)**4 + k**2*rhog**2*sinh(k)**4 - 2*k**2*rhog**2*sinh(k)**2*cosh(k)**2 +\
264
k**2*rhog**2*cosh(k)**4 - 2*delta_rho**2*k*sinh(k)**3*cosh(k) + 2*delta_rho**2*k*sinh(k)*cosh(k)**3 - 4*delta_rho*k*rhog*sinh(k)**3*cosh(k)\
265
+ 4*delta_rho*k*rhog*sinh(k)*cosh(k)**3 - 2*k*rhog**2*sinh(k)**3*cosh(k) + 2*k*rhog**2*sinh(k)*cosh(k)**3 +\
266
delta_rho**2*sinh(k)**2*cosh(k)**2 - 4*delta_rho*rhog*sinh(k)**4 + 2*delta_rho*rhog*sinh(k)**2*cosh(k)**2 +\
267
rhog**2*sinh(k)**2*cosh(k)**2))))*F0))*cos(k*x)
271
return max(nond_F(0.0,t), nond_G(0.0,t))
273
def numerical_amp(statn, t):
274
return interp([t], statn["ElapsedTime"]["value"], statn["Fluid"]["FreeSurface"]["max"])[0]
276
def nond_error_amp(statn, t):
277
return abs(nond_amp(t)-numerical_amp(statn, t))