9 K
= 2 * pi
* C
/ LAMBDA
11 def setParameters(_ly
, _lz
, _c
, _lambda
):
19 K
= 2 * pi
* C
/ LAMBDA
22 return pi
* C
* sqrt(1/LLY
+ m
**2 / LLZ
)
25 return (LZ
- z
) / LZ
* sin(pi
* y
/ LY
) * sin(K
* t
)
29 val
*= LLZ
* (4 * LLY
- LLAMBDA
)
30 val
/= (LLZ
* LLAMBDA
+ m
**2 * LLY
* LLAMBDA
- 4 * LLY
* LLZ
)
35 val
-= K
/ w(m
) * (2 / (m
* pi
) + D(m
)) * sin(w(m
) * t
)
39 return gamma(m
, t
) * sin(pi
* y
/ LY
) * sin(m
* pi
* z
/ LZ
)
43 for m
in xrange(1, _M
+ 1):
51 return U(y
, z
, t
) + psi(y
, z
, t
)
54 return Um(y
, z
, t
, _M
) + psi(y
, z
, t
)
56 def remainder_length(eps
):
57 G
= sqrt(4 * LY
**2 - LAMBDA
**2)/LAMBDA
* (LZ
/ LY
)
58 M
= LAMBDA
* G
**2 + 2 * LZ
59 M
+= sqrt((LAMBDA
* G
**2 + 2 * LZ
)**2 + 8 * pi
* LAMBDA
* LZ
* eps
* G
**2)
60 M
/= (pi
* LAMBDA
* eps
)
63 return int(round(M
+ 0.49))
65 def analyze_remainder(M
, eps
, y
, z
, t
):
69 for m
in xrange(1, M
+1):
70 curr_sum
+= um(y
, z
, t
, m
)
71 if (abs(curr_sum
- prev_sum
) > eps
):