wiki:ProposedClasses

UltraScan III Data Structures

#include <QtCore>

class US_Data
{
   public:
      enum DataType { RADIAL_ABSORBANCE, 
                      WAVELENGTH_ABSORBANCE,
                      WAVELENGTH_INTENSITY,
                      RADIAL_INTENSITY,
                      FLUORESCENCE_INTENSITY,
                      INTERFERENCE, 
                      SIMULATED
                    };
                      
      // A ScanBase structure does not stand alone.  It needs
      // to be an element of a vector of scans in a triple.

      class ScanBase
      {
         public:
            double   time;
            double   rpm;
            double   omega2t;
            double   temperature;
            QVector< double > concentration;
      };


      // A triple is the base class for experimental or 
      // simulated data.  Cell-Channel-Wavelength.

      class TripleBase
      {
         public:
            QString  uuid;
            QString  runID;
            QString  editID;
            DataType type;
            QChar    cell;
            QChar    channel;
            QString  wavelength;
            double   meniscus;
            double   bottom;
            double   delta_r;

            // Return a vector of radii
            QVector* radiusVector( void );
      };

      // Used for input/output of astfem programs
      class Triple : TripleBase
      {
         public:
            QVector< ScanBase > scans;

            // Calculate the rmsd value between two triples
            static double rmsd( const Triple&, const Triple& ) const;
      };


      class EditedTriple : TripleBase
      {
         public:
            QString  description;
            double   plateau_radius;
            double   baseline;
            bool     floatingData;

            QVector< double     > plateau_values
            QVector< QByteArray > interpolated
            QVector< ScanBase   > scans;
      };
};

class US_EXTERN US_FemGlobal
{
   public:

   class MfemInitial
   {
   public:
      vector< double > radius;
      vector< double > concentration;
   };

   class MfemScan
   {
      public:
      double           time;
      double           omega2t;
      uint             rpm;
      double           temperature;
      vector< double > conc;
   };

   class MfemData
   // A data set comprised of scans from one sample taken at constant speed
   {
      public:
      QString id;               // description of this dataset
      uint    cell;             // cell position in rotor
      uint    channel;          // channel number from centerpiece
      uint    wavelength;       // single wavelength at which data was acquired
                                // (for UV/Vis)
      uint    rpm;              // constant rotor speed

      double  s20w_correction;  // this is the number with which a s20,w value
                                // needs to be multiplied to get the s value in
                                // experimental space
                                // sT,B = s20,W * s20W_correction:
                                // sT,B = [s_20,W * [(1-vbar*rho)_T,B * eta_20,W]
                                //    /   [(1-vbar*rho)_20,W * eta_T,B]

      double  D20w_correction;  // this is the number with which a D20,w value
                                // needs to be multiplied to get the s value in
                                // experimental space
                                // DT,B = D20,W * D20w_correction
                                // DT,B = [D20,W * T * eta_20,W]
                                //    / [293.15 * eta_T,B]
      double viscosity;         // viscosity of solvent
      double density;           // density of solvent
      double vbar;              // temperature corrected vbar
      double avg_temperature;   // average temperature of all scans
      double vbar20;            // vbar at 20C
      double meniscus;          // corrected for speed dependent rotor stretch
      double bottom;            // corrected for speed dependent rotor stretch
      vector< double >   radius;
      vector< MfemScan > scan;
   };
 
   class SimulationComponent
   {
   public:
      uchar       analyteGUID[ 16 ];    // GUID for the analyte in the MySQL DB
      double      molar_concentration;
      double      signal_concentration; // To be assigned prior to simulation
      double      vbar20;
      double      mw;
      double      s;
      double      D;
      double      sigma;  // Concentration dependency of s
      double      delta;  // Concentration dependency of D  
      double      f_f0;
      QString     shape;
      QString     name;
      MfemInitial c0;     // The radius/concentration points for a user-defined
                          // initial concentration grid
   };

   class Association
   {
   public:
      double keq;
      double k_off;

      // A list of all system components involved in this reaction
      vector< uint > reaction_components;   

      // Stoichiometry of components in chemical equation.
      // Positive for reactant, negative for product
      vector< int >  stoichiometry; 
   };

   class ModelSystem
   {
   public:
      double                        compressibility;
      QString                       description;
      vector< SimulationComponent > buffer;
      vector< SimulationComponent > components;
      vector< Association >         associations;
   };

   enum MeshType { ASTFEM, CLAVERIE, MOVING_HAT, USER, ADAPTIVE };
   enum GridType { FIXED, MOVING };

   class SpeedProfile
   {
   public:
      uint   duration_hours;
      uint   duration_minutes;
      uint   delay_hours;
      double delay_minutes;
      uint   scans;
      uint   acceleration;
      uint   rotorspeed;
      bool   acceleration_flag;
   };

   class SimulationParameters
   {
   public:

      // The radii from a user-selected mesh file (mesh == USER)
      vector< double > mesh_radius;

      // Note: the radius points of c0 do not have to match the radii in the
      // mesh file. The radius values of the c0 vector will be interpolated
      // onto whatever mesh the user has selected.  however, the first and last
      // point of either the c0 or mesh_radius should match the meniscus,
      // otherwise they will be ignored or interpolated to the actual meniscus
      // and bottom position set by the user, which will take precedence.

      vector< SpeedProfile > speed_step;
      uint      simpoints;         // number of radial grid points used in sim
      MeshType  meshType;
      GridType  gridType;
      double    radial_resolution; // The radial datapoint increment/resolution
                                   // of the final data

      double    meniscus;          // Meniscus position at first constant speed
                                   // For multiple speeds, the user must measure
                                   // the meniscus at the first constant speed
                                   // and use that to initialize the routine

      double    bottom;            // Bottom of cell position without rotor stretch
      double    rnoise;            // Random noise
      double    tinoise;           // Time invariant noise
      double    rinoise;           // Radially invariant noise
      int       rotor;             // Rotor serial number in database
      bool      band_forming;      // True for band-forming centerpieces
      double    band_volume;       // Loading volume (of lamella) in a
                                   // Band-forming centerpiece

      // First band sedimentation scan is initializer for concentration
      bool      band_firstScanIsConcentration;
   };
};

class US_EXTERN US_Constraints
{
   public:

   class Constraint
   {
      public:
      bool   fit;
      double low;
      double high;
   };

   class SimulationComponentConstraints
   {
      public:
      Constraint vbar20;
      Constraint mw;
      Constraint s;
      Constraint D;
      Constraint sigma;
      Constraint delta;
      Constraint concentration;
      Constraint f_f0;
   };

   class AssociationConstraints
   {
      public:
      Constraint keq;
      Constraint koff;
   };

   class ModelSystemConstraints

   {
      public:
      vector< SimulationComponentConstraints > component_constraints;
      vector< AssociationConstraints >         association_constraints;

      // Number of radial grid points used in simulation
      uint   simpoints;

      US_FemGlobal::MeshType  mesh;

      // Use moving or fixed time grid   (bool?)
      int    moving_grid;

      // loading volume (of lamella) in a band-forming centerpiece
      double band_volume;
   };
};



Last modified 9 years ago Last modified on Mar 23, 2010 6:20:29 PM