Blame view
tf_cavity/tf_cavity.py
1.52 KB
2ae5099ce first commit |
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 |
#!/usr/bin/python # -*- coding: utf-8 -*- '''TF of FP cavity in reflection ---------- X(s) ----- | -tau⋅s | -------------->|1-R|----->(X)----->|e |------ | ----- ^ ---------- | | | | | | V ---- ---- ---- |-R| |-R| |-R| ---- ---- ---- | ^ | | | ---------- | Y(s) V ----- | | -tau⋅s | | <-----(X)<-----|1-R|<--------------|e |<----- ----- ---------- ''' from sympy import * init_printing() w, r, L, c = symbols('omega, r, L, c', imaginary=False, real=True) tau = L/c fsr = 1/(2*tau) #TF of cavity in reflection def Fr(w): s = 1j*w return r*(exp(-2*tau*s)-1)/(1-r**2*exp(-2*tau*s)) dw = symbols('dw', imaginary=False, real=True) Fr_dw_0 = simplify(simplify(Fr(2*pi*fsr+dw).series(dw, 0, 2).expand().coeff(dw))*dw) '''results ⎛ -2.0⋅ⅈ⋅L⋅ω ⎞ ⎜ ───────────⎟ ⎜ c ⎟ r⋅⎝-1 + ℯ ⎠ F(w) = ───────────────────── -2.0⋅ⅈ⋅L⋅ω ─────────── 2 c - r ⋅ℯ + 1 ''' |