import numpy as np
import escape as esc
from escape.utils import show
import escape.utils.mdb as mdb
esc.require('0.9.3')
Yu. Khaydukov, R. Morari, O. Soltwedel, T. Keller, G. Christiani, G. Logvenov, M. Kupriyanov, A. Sidorenko, and B. Keimer
Citation: Journal of Applied Physics 118, 213905 (2015); doi: 10.1063/1.4936789 View online: http://dx.doi.org/10.1063/1.4936789
Here we present results of fitting of experimental data presented in the publication (see above). We have chosen data for two samples which CuNi layers differ in thickness and roughness, to present the capabilities of simultaneous fit with shared parameters. Instead of fitting of SLDs we are going to fit mass densities of layer compounds.
wlx = 1.540562
cap_density=esc.par("Cap Density", 2.32, userlim=[0.9, 2.4], units="g/cm^3")
cuni_density=esc.par("CuNi Density", 8.93, userlim=[8.5, 9.0], units="g/cm^3")
nb_density=esc.par("Nb Density", 8.57, userlim=[8.2, 8.9], units="g/cm^3")
sio2_density=esc.par("SiO2 Density", 2.62, userlim=[1.7, 2.82], units="g/cm^3")
si_density=esc.par("Si Density", 2.32, userlim=[2.2, 2.4], units="g/cm^3", fixed=True)
nb_thkn = esc.par("Nb Thkn", 10.0, units="nm", userlim=[9, 12])
cap_thkn=esc.par("Cap Thkn", 10.0, units="nm", userlim=[9, 12])
sio2_thkn=esc.par("Sio2 Thkn", 3.0, units="nm", userlim=[0, 5])
cap_rough_10 = esc.par("Cap rough 5/10", 0.2, units="nm", userlim=[0, 3])
cap_rough_21 = esc.par("Cap rough 5/21", 0.2, units="nm", userlim=[0, 3])
nb_rough = esc.par("Nb rough", 0.2, units="nm", userlim=[0, 2])
sio2_rough = esc.par("SiO2 rough", 0.2, units="nm", userlim=[0, 1])
sub_rough = esc.par("Substrate rough", 0.2, units="nm", userlim=[0, 2])
cuni_thkn_10 = esc.par("CuNi Thkn 5/10", 15.0, units="nm", userlim=[15, 25])
cuni_rough_10 = esc.par("CuNi rough 5/10", 0.2, units="nm", userlim=[0, 2])
cuni_thkn_21 = esc.par("CuNi Thkn 5/21", 30.0, units="nm", userlim=[25, 35])
cuni_rough_21 = esc.par("CuNi rough 5/21", 0.2, units="nm", userlim=[0, 2])
cap = mdb.amorphous("Si", sldscale=1e-4, density=cap_density, source=mdb.Source.XRAYS, wavelength=wlx)
cuni = mdb.amorphous("CuNi", sldscale=1e-4, density=cuni_density, source=mdb.Source.XRAYS, wavelength=wlx)
nb = mdb.amorphous("Nb", sldscale=1e-4, density=nb_density, source=mdb.Source.XRAYS, wavelength=wlx)
sio2 = mdb.amorphous("SiO2", sldscale=1e-4, density=sio2_density, source=mdb.Source.XRAYS, wavelength=wlx)
sub = mdb.amorphous("Si", sldscale=1e-4, density=si_density, source=mdb.Source.XRAYS, wavelength=wlx)
cap_layer_10 = esc.layer("Layer: Cap 5/10", cap, cap_thkn, cap_rough_10)
cap_layer_21 = esc.layer("Layer: Cap 5/21", cap, cap_thkn, cap_rough_21)
cuni_layer_10 = esc.layer("Layer: CuNi 5/10", cuni, cuni_thkn_10, cuni_rough_10)
cuni_layer_21 = esc.layer("Layer: CuNi 5/21", cuni, cuni_thkn_21, cuni_rough_21)
sio2_layer = esc.layer("Layer: SiO2", sio2, sio2_thkn, sio2_rough)
nb_layer = esc.layer("Layer: nb", nb, nb_thkn, nb_rough)
substr = esc.substrate("Substrate: Si", sub, sub_rough)
sample_10 = esc.multilayer("CuNi/Nb/Si_10", esc.air("Air"), substr)
sample_10.add(cap_layer_10)
sample_10.add(cuni_layer_10)
sample_10.add(nb_layer)
sample_10.add(sio2_layer)
sample_21 = esc.multilayer("CuNi/Nb/Si_21", esc.air("Air"), substr)
sample_21.add(cap_layer_21)
sample_21.add(cuni_layer_21)
sample_21.add(nb_layer)
sample_21.add(sio2_layer)
Qz=esc.var("qz")
Qz0=esc.var("qz0")
fwhm_10=esc.par("FWHM_10", 0.005, userlim=[0.003, 0.03], fixed=False)
fwhm_21=esc.par("FWHM_21", 0.005, userlim=[0.003, 0.03], fixed=False)
specrefl_10 = esc.specrefl("Specrefl_10", Qz, sample_10, "matrix")
specrefl_10 = esc.average_normal(specrefl_10, fwhm_10, Qz, Qz0)
specrefl_21 = esc.specrefl("Specrefl_21", Qz, sample_21, "matrix")
specrefl_21 = esc.average_normal(specrefl_21, fwhm_21, Qz, Qz0)
B10=esc.par("Bgr 10", 1, scale=1e-6, userlim=[0, 5])
B21=esc.par("Bgr 21", 1, scale=1e-6, userlim=[0, 5])
I10=specrefl_10+B10
I21=specrefl_21+B21
qz, y, err=np.loadtxt("data/JAP15/XRR/Silicon/s10/ASCII/Si10.dat", unpack=True, skiprows=2)
qz=qz*10
dobj10 = esc.data("S10.dat", qz, y, err, copy=True)
qz, y, err=np.loadtxt("data/JAP15/XRR/Silicon/s21/ASCII/Si21.dat", unpack=True, skiprows=2)
qz=qz*10
dobj21 = esc.data("S21.dat", qz, y, err, copy=True)
mobj10 = esc.model("Model 10", I10, dobj10, residuals_scale="q4", weight_type="data")
mobj21 = esc.model("Model 21", I21, dobj21, residuals_scale="q4", weight_type="data")
opt = esc.diffevol("DiffEvol", [mobj10, mobj21], popsize=15, maxiter=150,
mutation=0.5, crossover=0.5, minconv=1e-3, nupdate=1,
polish_final_maxiter=50, polish_candidate_maxiter=0)
opt()
show(opt, ylog=True)
opt
Name: DiffEvol Parameters number: 16 Parameter Value +- Error Units Fixed FWHM_10 0.03 +- 0 arbitr. 0 Cap Thkn 11.767 +- 0.0076306 nm 0 Cap rough 5/10 1.1922 +- 0.0072556 nm 0 CuNi Thkn 5/10 15 +- 0 nm 0 CuNi rough 5/10 1.2429 +- 0.0029998 nm 0 Nb Thkn 10.247 +- 0.0038646 nm 0 Nb rough 0.82993 +- 0.039391 nm 0 Sio2 Thkn 4.5213 +- 0.036256 nm 0 SiO2 rough 0.51451 +- 0.0025637 nm 0 Substrate rough 0.54007 +- 0.04778 nm 0 Bgr 10 1.1812 +- 0.16273 x1e-06 arbitr. 0 FWHM_21 0.03 +- 0 arbitr. 0 Cap rough 5/21 3 +- 0.019528 nm 0 CuNi Thkn 5/21 33.96 +- 0.0059434 nm 0 CuNi rough 5/21 1.0903 +- 0.0031379 nm 0 Bgr 21 1.9439 +- 0.2501 x1e-06 arbitr. 0