Index: sansmodels/src/sans/models/PolymerExclVolume.py
===================================================================
--- sansmodels/src/sans/models/PolymerExclVolume.py	(revision ec1c5540bf9c8569d36dada948bf6b12cd3bf1be)
+++ sansmodels/src/sans/models/PolymerExclVolume.py	(revision ec1c5540bf9c8569d36dada948bf6b12cd3bf1be)
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+
+##############################################################################
+#	This software was developed by the University of Tennessee as part of the
+#	Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+#	project funded by the US National Science Foundation.
+#
+#	If you use DANSE applications to do scientific research that leads to
+#	publication, we ask that you acknowledge the use of the software with the
+#	following sentence:
+#
+#	"This work benefited from DANSE software developed under NSF award DMR-0520547."
+#
+#	copyright 2008, University of Tennessee
+##############################################################################
+from sans.models.BaseComponent import BaseComponent
+from scipy.special import gammainc,gamma
+import copy    
+    
+class PolymerExclVolume(BaseComponent):
+    """ 
+    Class that evaluates a PolymerExclVolModel model. 
+    This file was auto-generated from ..\c_extensions\polyexclvol.h.
+    Refer to that file and the structure it contains
+    for details of the model.
+    List of default parameters:
+         scale           = 0.01 
+         rg              = 100.0 [A]
+         m               = 3.0 
+         background      = 0.0 [1/cm]
+
+    """
+        
+    def __init__(self):
+        """ Initialization """
+        
+        # Initialize BaseComponent first, then sphere
+        BaseComponent.__init__(self)
+        
+        ## Name of the model
+        self.name = "PolymerExclVolume"
+        ## Model description
+        self.description =""" Compute the scattering intensity from polymers with excluded volume effects.
+		scale: scale factor times volume fraction,
+		or just volume fraction for absolute scale data
+		rg: radius of gyration
+		m = Porod exponent
+		background: incoherent background
+		"""
+        ## Define parameters
+        self.params = {}
+        self.params['scale']        = 1.0
+        self.params['rg']           = 60.0
+        self.params['m']            = 3.0
+        self.params['background']   = 0.0
+
+       
+        ## Parameter details [units, min, max]
+        self.details = {}
+        self.details['scale'] = ['', None, None]
+        self.details['rg'] = ['[A]', None, None]
+        self.details['m'] = ['', None, None]
+        self.details['background'] = ['[1/cm]', None, None]
+
+        ## fittable parameters
+        self.fixed=[]
+        
+        ## non-fittable parameters
+        self.non_fittable=[]
+        
+        ## parameters with orientation
+        self.orientation_params =[]
+        
+    def _polymerexclvol(self, x):
+        
+        sc = self.params['scale']
+        rg = self.params['rg']
+        mm  = self.params['m']
+        bg = self.params['background']
+    
+        nu = 1.0 / mm
+    
+        Xx = x * x * rg * rg *(2.0 * nu + 1.0) * (2.0 * nu + 2.0) / 6.0
+        onu = 1.0 / nu
+        o2nu = 1.0 /(2.0 * nu)
+        Ps =(1.0 / (nu * pow(Xx,o2nu))) * (gamma(o2nu)*gammainc(o2nu,Xx) - \
+                        1.0 / pow(Xx,o2nu) * gamma(onu)*gammainc(onu,Xx))
+
+        if x == 0:
+            Ps = 1.0
+
+        return (sc * Ps + bg);
+
+    def run(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q-value (float or [float, float] as [r, theta])
+            @return: (guinier value)
+        """
+        if x.__class__.__name__ == 'list':
+            return self._guinier(x[0])
+        elif x.__class__.__name__ == 'tuple':
+            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
+        else:
+            return self._polymerexclvol(x)
+   
+    def runXY(self, x = 0.0):
+        """ Evaluate the model
+            @param x: input q-value (float or [float, float] as [qx, qy])
+            @return: guinier value
+        """
+        if x.__class__.__name__ == 'list':
+            q = math.sqrt(x[0]**2 + x[1]**2)
+            return self._polymerexclvol(x)
+        elif x.__class__.__name__ == 'tuple':
+            raise ValueError, "Tuples are not allowed as input to BaseComponent models"
+        else:
+            return self._polymerexclvol(x)
+        
+
+   
+# End of file
Index: sansmodels/src/sans/models/test/polyexclvol_default_igor.txt
===================================================================
--- sansmodels/src/sans/models/test/polyexclvol_default_igor.txt	(revision ec1c5540bf9c8569d36dada948bf6b12cd3bf1be)
+++ sansmodels/src/sans/models/test/polyexclvol_default_igor.txt	(revision ec1c5540bf9c8569d36dada948bf6b12cd3bf1be)
@@ -0,0 +1,131 @@
+#PolymerExclVolume model 
+#Data was calculated from Igor/NIST 
+#package using SansView default values
+0.001	0.998801
+0.00105251	0.998672
+0.00110778	0.998529
+0.00116596	0.99837
+0.00122718	0.998195
+0.00129163	0.998001
+0.00135945	0.997785
+0.00143084	0.997547
+0.00150598	0.997283
+0.00158506	0.996991
+0.0016683	0.996667
+0.0017559	0.996309
+0.00184811	0.995912
+0.00194516	0.995473
+0.00204731	0.994986
+0.00215481	0.994448
+0.00226797	0.993852
+0.00238707	0.993192
+0.00251242	0.992462
+0.00264435	0.991653
+0.00278321	0.990759
+0.00292937	0.98977
+0.0030832	0.988675
+0.0032451	0.987464
+0.00341551	0.986125
+0.00359487	0.984644
+0.00378365	0.983007
+0.00398234	0.981197
+0.00419146	0.979197
+0.00441156	0.976988
+0.00464323	0.974548
+0.00488705	0.971854
+0.00514369	0.968881
+0.0054138	0.965601
+0.00569809	0.961984
+0.00599731	0.957997
+0.00631224	0.953605
+0.00664372	0.94877
+0.0069926	0.94345
+0.0073598	0.937601
+0.00774628	0.931175
+0.00815306	0.924123
+0.0085812	0.91639
+0.00903182	0.90792
+0.0095061	0.898654
+0.0100053	0.888531
+0.0105307	0.877486
+0.0110837	0.865457
+0.0116657	0.852378
+0.0122783	0.838186
+0.0129231	0.822819
+0.0136017	0.806219
+0.014316	0.788334
+0.0150678	0.769119
+0.015859	0.74854
+0.0166918	0.726576
+0.0175683	0.703223
+0.0184909	0.678493
+0.0194619	0.652424
+0.0204839	0.625076
+0.0215596	0.596538
+0.0226917	0.566929
+0.0238833	0.5364
+0.0251375	0.505131
+0.0264575	0.473333
+0.0278469	0.441243
+0.0293092	0.409122
+0.0308483	0.377244
+0.0324682	0.345891
+0.0341732	0.315341
+0.0359677	0.285861
+0.0378565	0.257691
+0.0398444	0.23104
+0.0419368	0.206075
+0.044139	0.182913
+0.0464568	0.161625
+0.0488964	0.142232
+0.0514641	0.124708
+0.0541666	0.108991
+0.057011	0.0949896
+0.0600048	0.0825877
+0.0631559	0.0716579
+0.0664723	0.0620666
+0.069963	0.0536799
+0.0736369	0.0463687
+0.0775038	0.0400111
+0.0815737	0.0344944
+0.0858574	0.0297157
+0.090366	0.0255826
+0.0951113	0.0220122
+0.100106	0.0189313
+0.105363	0.0162751
+0.110896	0.0139869
+0.116719	0.0120168
+0.122848	0.0103217
+0.129299	0.00886379
+0.136089	0.00761043
+0.143236	0.00653329
+0.150757	0.00560785
+0.158674	0.00481295
+0.167006	0.00413032
+0.175776	0.00354422
+0.185007	0.00304106
+0.194722	0.00260918
+0.204947	0.00223851
+0.21571	0.00192041
+0.227037	0.00164746
+0.238959	0.00141325
+0.251508	0.0012123
+0.264715	0.0010399
+0.278616	0.000892001
+0.293247	0.000765121
+0.308646	0.000656279
+0.324854	0.000562913
+0.341913	0.000482824
+0.359868	0.000414126
+0.378765	0.000355199
+0.398655	0.000304655
+0.41959	0.000261302
+0.441623	0.000224117
+0.464814	0.000192222
+0.489223	0.000164866
+0.514913	0.000141403
+0.541953	0.000121279
+0.570412	0.000104018
+0.600366	8.92138e-05
+0.631893	7.65164e-05
+0.665075	6.56261e-05
Index: sansmodels/src/sans/models/test/utest_extra_models.py
===================================================================
--- sansmodels/src/sans/models/test/utest_extra_models.py	(revision ec1c5540bf9c8569d36dada948bf6b12cd3bf1be)
+++ sansmodels/src/sans/models/test/utest_extra_models.py	(revision ec1c5540bf9c8569d36dada948bf6b12cd3bf1be)
@@ -0,0 +1,21 @@
+"""
+    Unit tests for extra models
+"""
+import unittest
+class TestPolymerExclVolume(unittest.TestCase):
+    """
+        Unit tests for PolymerexclVolume (non-shape) function
+    """
+    def setUp(self):
+        from sans.models.PolymerExclVolume import PolymerExclVolume
+        self.model= PolymerExclVolume()
+        
+    def test1D(self):          
+        # the values are from Igor pro calculation    
+        self.assertAlmostEqual(self.model.run(0.001), 0.998801, 6)
+        self.assertAlmostEqual(self.model.run(0.21571), 0.00192041, 6)
+        self.assertAlmostEqual(self.model.runXY(0.41959), 0.000261302, 6)
+        
+        
+if __name__ == '__main__':
+    unittest.main()
