Ignore:
Timestamp:
Mar 25, 2008 11:05:04 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
f629e346
Parents:
829eee9
Message:

Fixed new models - still need validation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/DABModel.py

    r829eee9 r3db3895  
    11#!/usr/bin/env python 
    22"""  
    3     Provide F(x) = scale/( 1 + (x*L)^2 )^(2) 
     3    Provide F(x) = scale/( 1 + (x*L)^2 )^(2) + background 
    44    DAB (Debye Anderson Brumberger) function as a BaseComponent model 
    55""" 
     
    1313        Class that evaluates a DAB model. 
    1414         
    15         F(x) = scale/( 1 + (x*L)^2 )^(2) +bkd 
     15        F(x) = scale/( 1 + (x*L)^2 )^(2) + background 
    1616         
    1717        The model has three parameters:  
    18             L     =  Correlation Length 
    19             scale  =  scale factor 
    20             bkd    =  incoherent background 
     18            L             =  Correlation Length 
     19            scale         =  scale factor 
     20            background    =  incoherent background 
    2121    """ 
    2222         
     
    2828         
    2929        ## Name of the model 
    30         self.name = " DAB_Model " 
     30        self.name = "DAB_Model" 
    3131 
    3232        ## Define parameters 
    3333        self.params = {} 
    34         self.params['L']     = 40.0 
    35         self.params['scale'] = 10.0 
    36         self.params['bkd']   = 0.0 
     34        self.params['length']             = 50.0 
     35        self.params['scale']              = 1.0 
     36        self.params['background']         = 0.0 
    3737 
    3838        ## Parameter details [units, min, max] 
    3939        self.details = {} 
    40         self.details['L']    = ['A', None, None] 
    41         self.details['scale'] = ['', None, None] 
    42         self.details['bkd']   = ['cm^{-1}', None, None] 
     40        self.details['length']            = ['', None, None] 
     41        self.details['scale']             = ['', None, None] 
     42        self.details['background']        = ['', None, None] 
    4343                
    4444    def _DAB(self, x): 
    4545        """ 
    46             Evaluate  F(x) = scale/( 1 + (x*L)^2 )^(2) + bkd 
     46            Evaluate  F(x) = scale/( 1 + (x*L)^2 )^(2) + background 
    4747            
    4848        """ 
    49         return self.params['scale']/math.pow(( 1 + math.pow(x * self.params['L'],2)),2) \ 
    50          + self.params['bkd'] 
     49        return self.params['scale']/math.pow(( 1 + math.pow(x * self.params['length'],2)),2) \ 
     50         + self.params['background'] 
    5151        
    5252    
    5353    def run(self, x = 0.0): 
    5454        """ Evaluate the model 
    55             @param x: simple value 
     55            @param x: input q-value (float or [float, float] as [r, theta]) 
    5656            @return: (DAB value) 
    5757        """ 
     
    6565    def runXY(self, x = 0.0): 
    6666        """ Evaluate the model 
    67             @param x: simple value 
     67            @param x: input q-value (float or [float, float] as [qx, qy]) 
    6868            @return: DAB value 
    6969        """ 
Note: See TracChangeset for help on using the changeset viewer.