summaryrefslogtreecommitdiff
path: root/isCavityStable.m
diff options
context:
space:
mode:
Diffstat (limited to 'isCavityStable.m')
-rw-r--r--isCavityStable.m19
1 files changed, 19 insertions, 0 deletions
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