CpcSim > User's Manual

Basics
An Example
To sum up...

Basics

The binary executable file named "cpcsim", that was installed in $HOME/bin, reads input data in XML format. The input file contains information about the compounds to be separated, the separation protocol, and the detection of the analytes. "cpcsim" produces text files (one per detector) and a lot of text in the standard output. The latter must be caught in a file named "log.txt". A typical input file "param.xml" is processed by

    cpcsim param.xml > log.txt
   

The detectors produce numeric tables that are better visualized as graphs. Graphs are produced by Perl programs (.pl extension). Gnuplot is used behind the scenes for curve drawing and ImageMagick for image transformation. Like "cpcsim", the Perl programs are installed in $HOME/bin and are initially located in the Bin directory of the CpcSim distribution.

Detectors are of two kinds: those who only record what flows out of the column (effluent detectors) and those that are able to report the content of all cells at a given time (full detectors). For graph production, only the output of the full detector is used. "draweffl.pl" deals with column effluent and "drawfull.pl" with full column content. They read the files produced by cpcsim and convert them series of image files that can be put together to obtain animated pictures. Two series of images may be glued side-by-side by "comp.pl". Animated pictures can be converted to MPEG movies.

The concentration of each chemical species in the column is related to a program internal variable. The correspondance between species name and variable name is reported in the "log.txt" file and can easily be retrieved using the "columheads.pl" utility program. Variable names must be known by the user in order to write parameter files for "draweffl.pl" and "drawfull.pl".

An example

Sample parameter files are available in the Bzlkmob directory of the CpcSim distribution.

The aim of this paragraph is not to explain the role of all the parts of all parameter files you will find in Bzlkmob, but to give the user an overview of program usage.

The problem that treated here is the separation of three analytes named S1, S2 and S3, injected as their sodium salts in phe mobile phase. Benzalkonium cation is used as anion exchanger and is initially associated with chloride anions that act as retainer. Its concentration in the stationary phase is 0.2 (arbitrary unit, au) The displacer is a solution of sodium iodide at concentration 0.1 au. The column contain 40 cells and the chromatographic development will be modeled as 130 repetions of the "equilibration" - "pumping" cycle.

In order to simulate the overall process, open a shell window and set Bzlkmob as the current directory.

    cpcsim param.txt > log.txt
   

writes lines like

    front: 1
    front: 2
    front: 3
    .
    .
    front: 40
   

that refer to the progression of the displacer front inside of the column. Then nothing happens for a while, until the command interpreters invites you to type again. Three files have been created:

The "effl" parameter file is used by draweffl to produce a series of images that reflect the time evolution of the concentration of the analytes, of the displacer and of the retainer. The command

    columnheads.pl
   

produces the following output:

    I mob ==> x1
    Cl mob ==> x2
    S1 mob ==> x3
    S2 mob ==> x4
    S3 mob ==> x5
    Na mob ==> x6
    I stat ==> x7
    Cl stat ==> x8
    S1 stat ==> x9
    S2 stat ==> x10
    S3 stat ==> x11
    Bzlk stat ==> x12
    OK
   

Because we are interested in plotting the time evolution of the concentration of mobile phase anions, only variables x1 to x5 are relevant here. The "effl" file reflects this:

    source = zz2.txt
    rootname = PNG/effl
    firstindex = 1000
    ymax = 0.11
    ymin = 0
    imagetype = png
    pngsize = 0.3
    animation = Y
    outfile = effl.mng
    delay = 20
    algebra = x1, x2, x3, x4, x5
    colors = 1, 2, 3, 4, 5
    showAnim = N
   

The command

    draweffl.pl effl
   

produces image files effl1000.png to effl1169.png in the PNG directory and a effl.mng MNG animation file.

As well, the command

    drawfull.pl full
   

produces image files full1000.png to full1169.png in the PNG directory and a "full.mng" MNG animation file. The parameter file "full" makes reference to stationary species variable names x7 to x11, that are negated so that the upper part of the graph corresponds to the mobile phase and and lower part to the stationary phase. Colors related to the same species in each phase are the same, so that the graphs are easily interpreted. The "full" parameter file:

    source = zz2.txt
    rootname = PNG/full
    firstindex = 1000
    ymax = 0.11
    ymin = -0.21
    imagetype = png
    pngsize = 0.3
    animation = Y
    outfile = full.mng
    delay = 20
    algebra = x1, x2, x3, x4, x5, -x7, -x8, -x9, -x10, -x11
    colors = 1, 2, 3, 4, 5, 1, 2, 3, 4, 5
    showAnim = N
   

thus produces full.mng.

Putting both sets of graphs side-by-side in so-called composite graphs is achieved by

    comp.pl comp
   

that produces comp.mng

The commands

    cd PNG
    mogrify -format jpeg comp*.png
    cd ..
    stammer.pl stammer
    ppmtompeg genmpeg
   

should produce a MPEG movie that tells the whole story. Mogrify converts the comp*.png command to the JPEG format. Stammer.pl replicates individual JPEG files. Pmmtompeg builds the film.mpeg movie. The speed of picture change depends on the "factor" parameter in the stammer command file.

To sum up...

    cd Bzlkmob
    cpcsim param.xml > log.txt
    draweffl.pl effl
    drawfull.pl full
    comp.pl comp
    cd PNG
    mogrify -format jpeg comp*.png
    cd ..
    stammer.pl stammer
    ppmtompeg genmpeg
   

Jean-Marc Nuzillard
jm.nuzillard@univ-reims.fr

October 21st 2005