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