From 0c533a1250ec1a1c6966db7854beb2b8fe5ea78e Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Tue, 17 Sep 2013 16:01:08 -0400 Subject: cavity stability finction --- isCavityStable.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 isCavityStable.m diff --git a/isCavityStable.m b/isCavityStable.m new file mode 100644 index 0000000..86dbd99 --- /dev/null +++ b/isCavityStable.m @@ -0,0 +1,19 @@ +function ret=isCavityStable (abcd_cavity) + % finds if a cavity is stable baced on its abcd matrix + % see eq.4 for stability condition + % doi:10.1088/1464-4258/7/1/002 + % http://dx.doi.org/10.1088/1464-4258/7/1/002 + + A=abcd_cavity(1,1); + B=abcd_cavity(1,2); + C=abcd_cavity(2,1); + D=abcd_cavity(2,2); + + u= (A+D+2)/4 + if ( (0 < u) && (u < 1) ) + ret = true; + else + ret = false; + end + +end -- cgit v1.2.3