documentation:script_examples
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:script_examples [2012/10/04 02:21] – macke | documentation:script_examples [2013/04/03 22:21] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ==== Add Lorentzian to the refractive index ==== | ||
| + | < | ||
| + | |||
| + | -- energy is a predefined variable | ||
| + | e = energy | ||
| + | |||
| + | -- Ni L2 | ||
| + | alpha1 = 85000.2; | ||
| + | beta1 = 2.97885; | ||
| + | e01 = 870.5; | ||
| + | |||
| + | -- Ni L3 | ||
| + | alpha2 | ||
| + | beta2 = 0.853558; | ||
| + | e02 = 852.216; | ||
| + | |||
| + | -- calculate classical lorentzians | ||
| + | del1 = alpha1 * (e*e - e01*e01) / ((e01*e01 - e*e)*(e01*e01 - e*e) + beta1*beta1 * e*e); | ||
| + | bet1 = alpha1 * beta1*e | ||
| + | | ||
| + | del2 = alpha2 * (e*e - e02*e02) / ((e02*e02 - e*e)*(e02*e02 - e*e) + beta2*beta2 * e*e); | ||
| + | bet2 = alpha2 * beta2*e | ||
| + | |||
| + | -- subtract current lorentzian in the substrate and add a new one with a new amplitude par[0] | ||
| + | delta[0] = delta[0] - del1 + del1*par[0]; | ||
| + | beta[0] | ||
| + | |||
| + | delta[0] = delta[0] - del2 + del2*par[1]; | ||
| + | beta[0] | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Special conditions for the element specific mode==== | ||
| + | |||
| + | Sample is PrNiO3 on LSAT | ||
| + | |||
| + | < | ||
| + | |||
| + | -- roughness of the interface between substrate and first layer should be the same for each element. | ||
| + | s = La: | ||
| + | Sr: | ||
| + | Al: | ||
| + | Ta: | ||
| + | Ni: | ||
| + | Pr: | ||
| + | O: | ||
| + | |||
| + | -- thickness should be the same for the first layer. Fit only Ni. | ||
| + | s = Ni: | ||
| + | Pr: | ||
| + | O: | ||
| + | </ | ||
| + | |||
| + | ==== Calculate reflectivities for an animation | ||
| + | |||
| + | This code was used to get an animation for a talk. The code must be copied and executed in the " | ||
| + | Beta of one layer is changed with a sinus function. The output is written to the debug window. This data can be used e.g. in gnuplot. | ||
| + | |||
| + | < | ||
| + | betatemp = beta[0] | ||
| + | for j=0,50,1 do | ||
| + | beta[0] = betatemp + math.sin(j / 50. * 2. * 3.141)*betatemp*0.5; | ||
| + | CalculateReflectivity() | ||
| + | for i=0,299,1 do | ||
| + | write(solution_qz[i], | ||
| + | end | ||
| + | write("" | ||
| + | end | ||
| + | beta[0] = betatemp; | ||
| + | |||
| + | </ | ||