Example #1
0
        water = SLD(0.0, "acmw")
    structures.append(air(0, 0) | lipids[i] | water(0, 3.3))

for i in range(len(cont)):
    lipids[i].vol[0].setp(vary=False)
    lipids[i].vol[1].setp(vary=True, bounds=(V_t * 0.8, V_t * 1.2))
    lipids[i].d[0].setp(vary=True, bounds=(5, 12))
    max_d_t = 1.54 + 1.265 * t_length
    lipids[i].d[1].setp(vary=True, bounds=(min_d_t, max_d_t))
    lipids[i].vol[1].constraint = lipids[i].d[1] * float(apm)
    structures[i][-1].rough.setp(vary=True, bounds=(3.3, 6))

lipids = rh.set_constraints(
    lipids,
    structures,
    hold_tails=True,
    hold_rough=True,
    hold_phih=True,
)

models = []
t = len(cont)

for i in range(t):
    models.append(ReflectModel(structures[i]))
    models[i].scale.setp(vary=True, bounds=(0.005, 10))
    models[i].bkg.setp(datasets[i].y[-1], vary=True, bounds=(1e-4, 1e-10))

objectives = []
t = len(cont)
for i in range(t):
Example #2
0
structures = []
for i in range(sp.size):
    structures.append(air(0, 0) | lipids[i] | des(0, 3.3))

t = sp.size
for i in range(t):
    lipids[i].vol[0].setp(vary=True, bounds=(V_h * 0.8, V_h * 1.2))
    lipids[i].vol[1].setp(vary=True, bounds=(V_t * 0.8, V_t * 1.2))
    lipids[i].d[0].setp(vary=True, bounds=(7, 20))
    max_d_t = 1.54 + 1.265 * t_length
    lipids[i].d[1].setp(vary=True, bounds=(min_d_t, max_d_t))
    structures[i][-1].rough.setp(vary=True, bounds=(2.5, 6))

lipids = rh.set_constraints(lipids,
                            structures,
                            hold_tails=False,
                            hold_rough=False)

models = []
t = sp.size

for i in range(t):
    models.append(ReflectModel(structures[i]))
    models[i].scale.setp(vary=True, bounds=(0.005, 10))
    models[i].bkg.setp(datasets[i].y[-1], vary=False)

objectives = []
t = sp.size
for i in range(t):
    objectives.append(
        Objective(models[i], datasets[i], transform=Transform("YX4")))