source: sasmodels/example/sesans_parameters_css-hs.py @ 3415f4f

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 3415f4f was 3415f4f, checked in by awashington, 8 years ago

Fix parameter names in sesans_parameters_css

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"""
2This is a data file  used to load in sesans data and fit it using the bumps engine
3"""
4from bumps.names import *
5
6import sesansfit
7
8# Enter the model name to use
9model_name = "core_shell_sphere*hardsphere"
10
11# DO NOT MODIFY THIS LINE
12model = sesansfit.get_bumps_model(model_name)
13
14# Enter any custom parameters
15phi = Parameter(0.45, name='phi')
16pen = Parameter(0.95, name='solvent penetration')
17custom_params = {"phi" : phi, "pen" : pen}
18
19# SESANS data file
20sesans_file = "core_shell.ses"
21
22# Initial parameter values (if other than defaults)
23initial_vals = {
24    "sld_core" : 1.0592,
25    "sld_solvent" : 2.88,
26    "radius" : 890,
27    "thickness" : 130
28}
29
30# Ranges for parameters if other than default
31param_range = {
32    "phi" : [0.2, 0.5],
33    "pen" : [0,1],
34    "radius" : [500, 3000],
35    "thickness" : [0,200]
36}
37
38# Constraints
39# model.param_name = f(other params)
40# EXAMPLE: model.scale = model.radius*model.radius*(1 - phi) - where radius and scale are model functions and phi is
41# a custom parameter
42model.scale = phi*(1-phi)
43model.volfraction = phi
44model.shell_sld = pen*2.88
45
46# Send to the fitting engine
47problem = sesansfit.sesans_fit(sesans_file, model_name, initial_vals, custom_params, param_range)
Note: See TracBrowser for help on using the repository browser.