From 5fd9b5510e7a00295e6e6184a2e73953a2b182ab Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Wed, 13 Apr 2011 10:51:05 -0400 Subject: moved cavity calculations to separate folder Ignore-this: b94054824a279aa64b0da28d0cc41bf9 darcs-hash:20110413145105-067c0-44e9a3c8220b834fe364debabeac7495e1533e44 --- cavity.m | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 cavity.m (limited to 'cavity.m') diff --git a/cavity.m b/cavity.m deleted file mode 100644 index 0e38d07..0000000 --- a/cavity.m +++ /dev/null @@ -1,21 +0,0 @@ -function answ=q_diff_after_cavity(q_initial) - # A B C D should be defined as global variables outside as well - # they represent elements of cavity ABCD matrix - global A B C D ; - q_diff=(A*(q_initial(1)+q_initial(2)*1i)+B)/(C*(q_initial(1)+q_initial(2)*1i) +D)-(q_initial(1)+q_initial(2)*1i) ; - answ=[real(q_diff), imag(q_diff)]; -endfunction - - -## looks like it always return some result even if cavity is unstable ## -function answ=find_q_at_the_mirror(q_initial_guess) - [q_array,info]=fsolve("q_diff_after_cavity", [real(q_initial_guess),imag(q_initial_guess)]); - if ( info == 1 ) - answ=q_array(1)+q_array(2)*1i ; - else - error("unable to find waste at mirror of the cavity, may be cavity is unstable") - quit() - endif -endfunction - - -- cgit v1.2.3