11.07.2015 Views

Sedimentation Equilibrium of Mixtures of Charged Colloids

Sedimentation Equilibrium of Mixtures of Charged Colloids

Sedimentation Equilibrium of Mixtures of Charged Colloids

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6The C++ codeComputer programmes are renowned for their readability. I fear this one isno exception. It did not have this form when it worked for the first time, onthe contrary. As a clear and simple version made by my supervisor, I wasallowed to use it. But I let it grow, steadily, to prepare it for bigger tasks. Itbecame more capable in solving problems, and when parts lost their purpose,it sometimes kept them as a trophy. I know it may not be the most elegant,accurate or efficient programme you have ever seen, but I think it is. In thebeginning it could not cope with two components, but now it can calculatesuspensions <strong>of</strong> up to 99 components, at least, or do series <strong>of</strong> calculations.The parameters are easily changed in the highlighted area, and one can evenmake distributions <strong>of</strong> the parameters in an equal facile manner. If one wantsto save time, do no try to understand every step, or read it chronologically,just believe the comments. From now on, everyone can calculate pr<strong>of</strong>iles <strong>of</strong>polydisperse suspensions <strong>of</strong> charged colloids. The secrets <strong>of</strong> the C++ codewill be revealed:The program calculates numerical solutions forandρ i (x) = a i exp[− x L i+ Z i φ(x)] (6.1)d 2dx 2 φ(x) = κ2 sinh φ(x) + 4πλ Bn∑Z i ρ i (x) (6.2)in the following way. At first, the parameters i, Z i , L i , σ i , λ B , ρ s (in κ), mustbe∫chosen. The parameter a i is determined by a normalization that provides1 dxρi (x) = ¯ρHi , where ¯ρ i must be chosen. Also, two other parameters,φ tol and φ reltol , can be adjusted that determine the desired precision <strong>of</strong> thesolution. For Z i , L i and σ i a distribution can be chosen, and even a function49i=1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!