Skip to content

Commit c1d34ae

Browse files
authored
Merge pull request #73 from bleykauf/feature/add-arrival-time
Add arrival time
2 parents 6e9fe3d + c6af190 commit c1d34ae

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

aisim/convert.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,31 @@ def phase_error_to_grav(phase, T, keff):
129129
gravitational acceleration in in m/s^2
130130
"""
131131
return phase / keff / (T**2)
132+
133+
134+
def arrival_time(z, t0=0.0, z0=0.0, v0=0.0, g=9.80665):
135+
"""
136+
Calculate time when the atomic ensemble reaches a certaini position.
137+
138+
Parameters
139+
----------
140+
z : float
141+
position in m
142+
t0 : float
143+
time reference in s (at which z0 and v0 are known)
144+
z0, v0 : float
145+
initial position and velocity (in m and m/s, respectively), i.e. position and
146+
velocity at t_ref
147+
g : float
148+
gravitational acceleration in m/s**2
149+
150+
Returns
151+
-------
152+
t : list of float
153+
The two times when atoms reach the position z in seconds.
154+
"""
155+
t12 = [
156+
(v0 - np.sqrt(v0**2 + 2 * g * (z0 - z))) / g + t0,
157+
(v0 + np.sqrt(v0**2 + 2 * g * (z0 - z))) / g + t0,
158+
]
159+
return t12

docs/coverage.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)