source: sasmodels/example/model_ellipsoid_hayter_msa.py @ 1f7792e

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 1f7792e was 1f7792e, checked in by Gonzalez, Miguel <gonzalez@…>, 7 years ago

Commented path to sasmodels

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4# To Sasview/documents/scripts
5
6import sys
7#sys.path.append('path_to_sasmodels')
8
9from bumps.names import *
10from sasmodels.core import load_model
11from sasmodels.bumps_model import Model, Experiment
12from sasmodels.data import load_data, plot_data
13import numpy as np
14import matplotlib.pyplot as plt
15
16
17""" IMPORT THE DATA USED """
18data = load_data('data.txt')
19
20#setattr(data, 'qmin', 0.0)
21#setattr(data, 'qmax', 10.0)
22
23""" DEFINE THE MODEL """
24kernel = load_model('ellipsoid*hayter_msa', dtype="double")
25
26pars = dict(scale=6.4, background=0.06, sld=0.33, sld_solvent=2.15, radius_polar=14.0, 
27            radius_equatorial=24.0, volfraction=0.075, charge=66.373, temperature=298.0, 
28            concentration_salt=0.001, dielectconst=71.0)
29           
30model = Model(kernel, **pars)
31
32""" PARAMETER RANGES (ONLY THOSE PARAMETERS ARE FITTED) """
33model.scale.range(0, inf)
34model.background.range(-inf, inf)
35#model.sld.range(-inf, inf)
36model.sld_solvent.range(-inf, inf)
37#model.radius_polar.range(0, inf)
38#model.radius_equatorial.range(0, inf)
39#model.volfraction.range(0,0.74)
40#model.charge.range(0, inf)
41#model.temperature.range(0,1000)
42#model.concentration_salt.range(0, 1)
43#model.dielectconst.range(0,inf)
44
45
46M = Experiment(data=data, model=model)
47
48problem = FitProblem(M)
49
Note: See TracBrowser for help on using the repository browser.