The R package provides an interface to the ion optics simulation program SIMION for parameter optimization using design of experiments (DoE) and response surface methodology (RSM). This is an alternative way to optimize parameters in SIMION and might be more efficient than SIMION's simplex optimization or genetic algorithms.
A typical RSM optimization workflow includes:
The optimization closely follows the approach of the TOFWERK Thuner and underlying Umetrics MODDE-Q software. See the Thuner and MODDE manuals for a detailed overview of the tuning methods. Notable differences to Thuner/MODDE are:
if (!require("remotes")) { install.packages("remotes") }
remotes::install_github("pasturm/SIMIONtuneR")
-- SIMIONtuneR variables
to your workbench user program.segment.flym()
code to your workbench user program.runner.jobrun(i, ...)
function. resolution
and sensitivity
(the variables you want to optimize) in the segment.terminate_run()
function of your workbench user program. The parameters for tuning and for communicating between SIMION and R are
configured in a configuration file.
For example, open SIMIONtuneR_config.toml and adjust the parameters according to your needs. In particular, the name of the SIMION
workbench file, and the factors and controls sections needs to be adjusted.
The names of the controls need to be the same as the parameters of the
runner.jobrun(i, ...)
function in the lua workbench user program.
library(SIMIONtuneR)
run_SIMIONtuneR("SIMIONtuneR_config.toml")
The tuning results are plotted using plotly and the experiment and result files are written to disk.
With nogui = FALSE
SIMION log messages are shown and with write = FALSE
no
output files are written. This can be helpful for debugging.
Usually, the starting values are taken from the configuration file. But you can
also start from a previous best point. To do so, set resume = TRUE
and the starting values from the bestpoint.txt file in the tuneR directory
will be used.
Parallel computing can be used to speed up the optimization. This is based on the ZeroMQ library.
simion-lib-multiplatform-20140611b.zip
from the SIMION update webpage,
and replace the c:\Program Files\SIMION-8.x\lib
folder with the lib folder
corresponding to your platform in that ZIP file. Also download vcomp140.zip
from the SIMION update webpage and copy vcomp140.dll
to your lib folder.
Restart SIMION. If successful, entering require "zmq"
into the SIMION command
bar should execute without error (status OK). np
parameter in the configuration file. It defines the
number of SIMION processes that will be run in parallel. Note that the number of
processes which make sense to run is often limited by the available RAM rather
by the number of available cores. run_SIMIONtuneR(..., zmq = TRUE)
.Note that if only relatively few ions are flown and if small potential arrays
are used then zmq = FALSE
might still be faster over all.
See the NEWS file for the latest release notes.
Patrick Sturm, TOFWERK
GPL-3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.