source: sasview/sansmodels/src/sans/models/FractalAbsModel.py @ d734a3b1

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since d734a3b1 was 9ce41c6, checked in by Gervaise Alina <gervyh@…>, 15 years ago

wrote unittest for all model untested , haven' test critial point error handling

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[9ce41c6]1#!/usr/bin/env python
2"""
3   
4    Provide F(x)= P(|x|)*S(|x|) + bkd
5    Fractal as a BaseComponent model
6"""
7
8from sans.models.FractalModel import FractalModel
9import math
10
11class FractalAbsModel(FractalModel):
12    """
13        Class that evaluates a Fractal function.
14       
15        F(|x|)= P(|x|)*S(|x|) + bkd
16        The model has Seven parameters:
17            scale        =  Volume fraction
18            radius       =  Block radius
19            fractal_dim  =  Fractal dimension
20            corr_length  =  correlation Length
21            block_sld    =  SDL block
22            solvent_sld  =  SDL solvent
23            background   =  background
24           
25    """
26    def __init__(self):
27        """ Initialization """
28        # Initialize FractalModel
29
30        FractalModel.__init__(self)
31        ## Name of the model
32        self.name = "Absolute Number Density Fractal"
33        self.description="""
34        I(x)= P(|x|)*S(|x|) + bkd
35       
36        p(x)= scale* V^(2)*delta^(2)* F(x*radius)^(2)
37        F(x) = 3*[sin(x)-x cos(x)]/x**3
38       
39        The model has Seven parameters:
40        scale        =  Volume fraction
41        radius       =  Block radius
42        fractal_dim  =  Fractal dimension
43        corr_length  =  correlation Length
44        block_sld    =  SDL block
45        solvent_sld  =  SDL solvent
46        background   =  background
47        """
48    def _Fractal(self, x):
49        return FractalModel._Fractal(self, math.fabs(x))
Note: See TracBrowser for help on using the repository browser.