Re: [Camfr-users] Defining the angle of dependence.
Brought to you by:
pbienst
From: Peter B. <Pet...@ug...> - 2008-08-26 17:32:36
|
The reason is that the code in set_theta actually sets the transverse part of the wavevector, which is dependent on lambda: void Planar::set_theta(Complex theta_radians) { kt = (2*pi / global.lambda * core->n()) * sin(theta_radians); } So, you should always set the wavelength first before defining the angle. I will update the documentation to reflect this. Thanks for spotting this! Peter On Tuesday 26 August 2008 18:37:13 vra...@di... wrote: > Hi everybody, > > we have a question on setting the angle of dependence. The code below is > written to show the differences between setting the angle of dependence > before and in the loop over wavelength. Why are the results different? > > Thank you for the answer! > > Vratislav > > ################################################# > # CAMFR test, 28. 8. 2008 > # Aim: to test CAMFR in setting angle properly > ################################################# > > from camfr import * > > # Define constants. > theta = 80. > angle = theta * pi / 180. > set_lambda(1.) > set_polarisation(TE) > > # Define structure. > air_m = Material(1.0) > layer_m = Material(3.4) > > Air = Planar(air_m) > Layer = Planar(layer_m) > > Structure = Stack(Air(0) + Layer(1.) + Air(0)) > > # Calculation - frequency dependence (with or without set_theta). > > Result = [] > for lambdaa in arange(0.1,4.,0.01): > set_lambda(lambdaa) > Structure.inc().set_theta(angle) > Structure.calc() > T = abs(Structure.T12(0,0))**2 > Result.append((lambdaa,T)) > > Structure.inc().set_theta(angle) > for lambdaa in arange(0.1,4.,0.01): > set_lambda(lambdaa) > Structure.calc() > T = abs(Structure.T12(0,0))**2 > Result.append((lambdaa,T)) > > plot_vector(Result) -- ------------------------------------------------ Peter Bienstman Ghent University, Dept. of Information Technology Sint-Pietersnieuwstraat 41, B-9000 Gent, Belgium tel: +32 9 264 34 46, fax: +32 9 264 35 93 WWW: http://photonics.intec.UGent.be email: Peter.Bienstman@UGent.be ------------------------------------------------ |