source: sasview/src/sas/models/include/cylinder.h @ 25f223b

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 25f223b was 8836849, checked in by pkienzle, 10 years ago

Allow inf for default parameter bounds (closes #330)

  • Property mode set to 100644
File size: 2.9 KB
Line 
1#if !defined(cylinder_h)
2#define cylinder_h
3#include "parameters.hh"
4
5/** Structure definition for cylinder parameters
6 * [PYTHONCLASS] = CylinderModel
7 * [DISP_PARAMS] = radius, length, cyl_theta, cyl_phi
8   [DESCRIPTION] = <text> f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2))
9                                /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)]
10
11                P(q,alpha)= scale/V*f(q)^(2)+bkg
12                V: Volume of the cylinder
13                R: Radius of the cylinder
14                L: Length of the cylinder
15                J1: The bessel function
16                alpha: angle betweenthe axis of the
17                cylinder and the q-vector for 1D
18                :the ouput is P(q)=scale/V*integral
19                from pi/2 to zero of...
20                f(q)^(2)*sin(alpha)*dalpha+ bkg
21                </text>
22        [FIXED]= <text>cyl_phi.width; cyl_theta.width; length.width;radius.width</text>
23        [ORIENTATION_PARAMS]= <text>cyl_phi; cyl_theta; cyl_phi.width; cyl_theta.width;M0_sld_cyl; M_theta_cyl; M_phi_cyl;M0_sld_solv; M_theta_solv; M_phi_solv; Up_frac_i; Up_frac_f; Up_theta;</text>
24        [MAGNETIC_PARAMS]= <text> M0_sld_cyl; M_theta_cyl; M_phi_cyl; M0_sld_solv; M_theta_solv; M_phi_solv; Up_frac_i; Up_frac_f; Up_theta; </text>
25
26 **/
27class CylinderModel{
28public:
29  // Model parameters
30
31  /// Scale factor
32  //  [DEFAULT]=scale=1.0
33  Parameter scale;
34
35  /// Radius of the cylinder [A]
36  //  [DEFAULT]=radius=20.0 [A] 0.0 inf
37  Parameter radius;
38
39  /// Length of the cylinder [A]
40  //  [DEFAULT]=length=400.0 [A] 0.0 inf
41  Parameter length;
42
43  /// Contrast [1/A^(2)]
44  //  [DEFAULT]=sldCyl=4.0e-6 [1/A^(2)]
45  Parameter sldCyl;
46
47  /// sldCyl [1/A^(2)]
48  //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)]
49  Parameter sldSolv;
50
51  /// Incoherent Background [1/cm] 0.00
52  //  [DEFAULT]=background=0.0 [1/cm]
53  Parameter background;
54
55  /// Orientation of the cylinder axis w/respect incoming beam [deg]
56  //  [DEFAULT]=cyl_theta=60.0 [deg]
57  Parameter cyl_theta;
58
59  /// Orientation of the cylinder in the plane of the detector [deg]
60  //  [DEFAULT]=cyl_phi=60.0 [deg]
61  Parameter cyl_phi;
62
63  /// M0_sld_cyl
64  //  [DEFAULT]=M0_sld_cyl=0.0e-6 [1/A^(2)]
65  Parameter M0_sld_cyl;
66
67  /// M_theta_cyl
68  //  [DEFAULT]=M_theta_cyl=0.0 [deg]
69  Parameter M_theta_cyl;
70
71  /// M_phi_cyl
72  //  [DEFAULT]=M_phi_cyl=0.0 [deg]
73  Parameter M_phi_cyl;
74
75  /// M0_sld_solv
76  //  [DEFAULT]=M0_sld_solv=0.0e-6 [1/A^(2)]
77  Parameter M0_sld_solv;
78
79  /// M_theta_solv
80  //  [DEFAULT]=M_theta_solv=0.0 [deg]
81  Parameter M_theta_solv;
82
83  /// M_phi_solv
84  //  [DEFAULT]=M_phi_solv=0.0 [deg]
85  Parameter M_phi_solv;
86
87  /// Up_frac_i
88  //  [DEFAULT]=Up_frac_i=0.5 [u/(u+d)]
89  Parameter Up_frac_i;
90
91  /// Up_frac_f
92  //  [DEFAULT]=Up_frac_f=0.5 [u/(u+d)]
93  Parameter Up_frac_f;
94
95  /// Up_theta
96  //  [DEFAULT]=Up_theta=0.0 [deg]
97  Parameter Up_theta;
98
99  // Constructor
100  CylinderModel();
101
102  // Operators to get I(Q)
103  double operator()(double q);
104  double operator()(double qx, double qy);
105  double calculate_ER();
106  double calculate_VR();
107  double evaluate_rphi(double q, double phi);
108};
109
110#endif
Note: See TracBrowser for help on using the repository browser.