Tags:Analysis, C-code, Fertilizer production, Julia, MATLAB, Modeling language, Performance and Population balance
Abstract:
Industrially produced fertilizers are of key importance to produce enough food for a growing global population. On-going work deals with models of the granulation loop in fertilizer production, based on a population balance that finds the particle size distribution of the product. The model is intended for control design in order to dampen or remove production oscillation for reduced energy consumption and improved product quality. In this paper, efficiency of model implementation is studied in addition to the possibility to automate the computation of a linear approximation of the model for control synthesis.
In the implementation study, the current tailor-made MATLAB solver for the model was cloned in computer language Julia. In addition, the implementations in both languages (MATLAB, Julia) were rewritten in a form that allows for use of the standard differential equation solvers of the respective languages. Results indicate that by changing from the tailor-made solvers to using the built-in solvers leads to a speed increase in the order of 6 times. Furthermore, results indicate that the Julia implementations are ca. 5 times faster than the MATLAB implementations. The MATLAB execution can be sped up by using MATLAB Coder to convert the code to efficient C-code which is then used to generate a DLL. DLLs can be executed virtually without overhead from Julia. By measuring the execution time for the C-code/DLL vs. a similar implementation in pure Julia, the pure Julia code is ca. 12% faster than the compiled C code.
Next, the possibility of automatic linearization of the population balance model in Julia is studied. This is shown to be relatively straightforward. The linear approximation is very good for an input perturbation of 10%, and relatively good for an input perturbation of 50%. This indicates that it may be possible to use a linear model approximation for control design.
Fertilizer Granulation: Comparison of Modeling Languages