UltraScan III
us_hydrosim.cpp
Go to the documentation of this file.
1 //
3 #include "us_hydrosim.h"
4 #include "us_constants.h"
5 #include "us_math2.h"
6 #include "us_model.h"
7 
9 {
10  s = 0.0;
11  D = 0.0;
12  f = 0.0;
13  f_f0 = 1.0;
14  a = 0.0;
15  b = 0.0;
16  volume = 0.0;
17 }
18 
20 {
21  mw = 50000.0;
22  density = DENS_20W;
25  temperature = 20.0;
26 temperature = 25.0;
27  axial_ratio = 10.0;
28  analyteGUID = QString();
29 }
30 
32 {
33  US_Math2::SolutionData solution;
34  double vbar20 = vbar + 4.25e-4 * ( temperature - 20.0 );
35  solution.density = density;
36  solution.viscosity = viscosity;
37  solution.vbar = vbar;
38  solution.vbar20 = vbar20;
39 //qDebug() << " Hydrosim Calc dens visc vbar temp vbar20"
40 // << density << viscosity << vbar << temperature << vbar20;
41 
42  US_Math2::data_correction( temperature, solution );
43 
48 
49 //qDebug() << " Math2 visc visc_wt visc_tb"
50 // << solution.viscosity << solution.viscosity_wt << solution.viscosity_tb;
51  double vol_per_molecule = solution.vbar * mw / AVOGADRO;
52  double rad_sphere =
53  pow( vol_per_molecule * 3.0 / ( 4.0 * M_PI ), 1.0 / 3.0 );
54 
55  sphere.f_f0 = 1.0;
56  sphere.a = 1.0e+08 * rad_sphere;
57 
58  // Recaluclate volume to put into cubic angstroms:
59  vol_per_molecule = ( 4.0 / 3.0 ) * M_PI * pow( rad_sphere * 1.0e+08, 3.0 );
60 
61  // Sphere:
62  sc_sph.mw = mw;
63  sc_sph.f_f0 = sphere.f_f0;
64  sc_sph.s = 0.0;
65  sc_sph.D = 0.0;
66  sc_sph.f = 0.0;
67  sc_sph.vbar20 = vbar20;
69 
70  sphere.s = sc_sph.s;
71  sphere.D = sc_sph.D;
72  sphere.f = sc_sph.f;
73  sphere.b = sphere.a;
74  sphere.volume = vol_per_molecule;
75 
76  // Oblate ellipsoid:
77  oblate.f_f0 = sqrt( sq( axial_ratio ) - 1.0 ) /
78  ( pow( axial_ratio, 2.0 / 3.0 ) * atan( sqrt( sq( axial_ratio ) - 1.0 )));
79 
80  double bo = 1.0e+08 * rad_sphere / pow( axial_ratio, 2.0 / 3.0 );
81  double ao = axial_ratio * bo;
82 
83  sc_obl.mw = mw;
84  sc_obl.f_f0 = oblate.f_f0;
85  sc_obl.s = 0.0;
86  sc_obl.D = 0.0;
87  sc_obl.f = 0.0;
88  sc_obl.vbar20 = vbar20;
90 
91  oblate.s = sc_obl.s;
92  oblate.D = sc_obl.D;
93  oblate.f = sc_obl.f;
94  oblate.a = ao;
95  oblate.b = bo;
96  oblate.volume = vol_per_molecule;
97 
98  // Prolate ellipsoid, ratio = ap/bp (a = semi-major axis)
99 
100  prolate.f_f0 = pow( axial_ratio, -1.0 / 3.0 )
101  * sqrt( sq( axial_ratio ) - 1.0 )
102  / log( axial_ratio + sqrt( sq( axial_ratio ) - 1.0 ) );
103 
104  double ap = 1.0e+08 * ( rad_sphere * pow( axial_ratio, 2.0 / 3.0 ) );
105  double bp = ap / axial_ratio;
106 
107  sc_pro.mw = mw;
108  sc_pro.f_f0 = prolate.f_f0;
109  sc_pro.s = 0.0;
110  sc_pro.D = 0.0;
111  sc_pro.f = 0.0;
112  sc_pro.vbar20 = vbar20;
113  US_Model::calc_coefficients( sc_pro );
114 
115  prolate.s = sc_pro.s;
116  prolate.D = sc_pro.D;
117  prolate.f = sc_pro.f;
118  prolate.a = ap;
119  prolate.b = bp;
120  prolate.volume = vol_per_molecule;
121 
122  // Long rod:
123  rod.f_f0 = pow( 2.0 / 3.0, 1.0 / 3.0 )
124  * pow( axial_ratio, 2.0 / 3.0 )
125  / ( log( 2.0 * axial_ratio ) - 0.3 );
126 
127  double br = 1.0e+08 * pow( 2.0 / ( 3.0 * axial_ratio ), 1.0 / 3.0 )
128  * rad_sphere;
129 
130  double ar = axial_ratio * br;
131 
132  sc_rod.mw = mw;
133  sc_rod.f_f0 = rod.f_f0;
134  sc_rod.s = 0.0;
135  sc_rod.D = 0.0;
136  sc_rod.f = 0.0;
137  sc_rod.vbar20 = vbar20;
138  US_Model::calc_coefficients( sc_rod );
139 
140  rod.s = sc_rod.s;
141  rod.D = sc_rod.D;
142  rod.f = sc_rod.f;
143  rod.a = ar;
144  rod.b = br;
145  rod.volume = vol_per_molecule;
146 //qDebug() << "SPHERE hyd ff0 mw" << sphere.f_f0 << mw
147 // << " s D f" << sphere.s << sphere.D << sphere.f;
148 //qDebug() << "SPHERE mod ff0 mw" << sc_sph.f_f0 << sc_sph.mw
149 // << " s D f" << sc_sph.s << sc_sph.D << sc_sph.f;
150 //qDebug() << "OBLATE hyd ff0 mw" << oblate.f_f0 << mw
151 // << " s D f" << oblate.s << oblate.D << oblate.f;
152 //qDebug() << "OBLATE mod ff0 mw" << sc_obl.f_f0 << sc_obl.mw
153 // << " s D f" << sc_obl.s << sc_obl.D << sc_obl.f;
154 //qDebug() << "PROLATE hyd ff0 mw" << prolate.f_f0 << mw
155 // << " s D f" << prolate.s << prolate.D << prolate.f;
156 //qDebug() << "PROLATE mod ff0 mw" << sc_pro.f_f0 << sc_pro.mw
157 // << " s D f" << sc_pro.s << sc_pro.D << sc_pro.f;
158 //qDebug() << "ROD hyd ff0 mw" << rod.f_f0 << mw
159 // << " s D f" << rod.s << rod.D << rod.f;
160 //qDebug() << "ROD mod ff0 mw" << sc_rod.f_f0 << sc_rod.mw
161 // << " s D f" << sc_rod.s << sc_rod.D << sc_rod.f;
162 }
163 
164 /*
165 // x is axial_ratio
166  double x = 1.1;
167 
168  // From: K.E. van Holde, Biophysical Chemistry, 2nd edition, chapter 4.1
169  // Calculate frictional ratio as a function of axial ratio
170  for ( int i = 0; i < ARRAYSIZE; i++, x += 0.1 )
171  {
172  prolate[ i ] = pow( x, -1.0 / 3.0 ) * sqrt( sq( x ) - 1.0 ) /
173  log( x + sqrt( sq( x ) - 1.0 ) );
174 
175  oblate[ i ] = sqrt( sq( x ) - 1.0 ) /
176  ( pow( x, 2.0 / 3.0 ) * atan( sqrt( sq( x ) - 1.0 ) ) );
177 
178  rod[ i ] = pow( 2.0 / 3.0, 1.0 / 3.0 ) * pow( x, 2.0 / 3.0 ) /
179  ( log( 2.0 * x ) - 0.3 );
180 
181  ratio_x[ i ] = x;
182  }
183 */