Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# sympy.physics.gaussopt.gaussian_conj

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
```Conjugation relation for gaussian beams.

Parameters
==========

s_in : the distance to optical element from the waist
z_r_in : the rayleigh range of the incident beam
f : the focal length of the optical element

Returns(more...)
```

```        def gaussian_conj(s_in, z_r_in, f):
"""
Conjugation relation for gaussian beams.

Parameters
==========

s_in : the distance to optical element from the waist
z_r_in : the rayleigh range of the incident beam
f : the focal length of the optical element

Returns
=======

a tuple containing (s_out, z_r_out, m)
s_out : the distance between the new waist and the optical element
z_r_out : the rayleigh range of the emergent beam
m : the ration between the new and the old waists

Examples
========

>>> from sympy.physics.gaussopt import gaussian_conj
>>> from sympy import symbols
>>> s_in, z_r_in, f = symbols('s_in z_r_in f')

>>> gaussian_conj(s_in, z_r_in, f)
1/(-1/(s_in + z_r_in**2/(-f + s_in)) + 1/f)

>>> gaussian_conj(s_in, z_r_in, f)
z_r_in/(1 - s_in**2/f**2 + z_r_in**2/f**2)

>>> gaussian_conj(s_in, z_r_in, f)
1/sqrt(1 - s_in**2/f**2 + z_r_in**2/f**2)
"""
s_in, z_r_in, f = map(sympify, (s_in, z_r_in, f))
s_out = 1 / ( -1/(s_in + z_r_in**2/(s_in - f)) + 1/f )
m = 1/sqrt((1 - (s_in/f)**2) + (z_r_in/f)**2)
z_r_out = z_r_in / ((1 - (s_in/f)**2) + (z_r_in/f)**2)
return (s_out, z_r_out, m)
```

```from sympy import atan2, factor, Float, I, Matrix, N, oo, pi, sqrt, symbols

from sympy.physics.gaussopt import (BeamParameter, CurvedMirror,
CurvedRefraction, FlatMirror, FlatRefraction, FreeSpace, GeometricRay,
RayTransferMatrix, ThinLens, conjugate_gauss_beams,
```
```    s_in, z_r_in, f = symbols('s_in z_r_in f')
assert gaussian_conj(
s_in, z_r_in, f) == 1/(-1/(s_in + z_r_in**2/(-f + s_in)) + 1/f)
assert gaussian_conj(
s_in, z_r_in, f) == z_r_in/(1 - s_in**2/f**2 + z_r_in**2/f**2)
assert gaussian_conj(
s_in, z_r_in, f) == 1/sqrt(1 - s_in**2/f**2 + z_r_in**2/f**2)
```