BpmLab v1.21 (2019.02.06) for Matlab R2015+
Developed by Andriy Nosych (anosych@cells.es)
Accelerator Diagnostics Division, ALBA Synchrotron, Barcelona, Spain
https://intranet.cells.es/Divisions/Accelerators/RF_Diagnostics/Diagnostics/OrbitPosition/Tools/bpmlab

The author is grateful to Manfred Wendt and Marek Gasior (CERN BI), Guenter Rehm (DLS), Kees-Bertus Scheidt (ESRF) and Ubaldo Iriso (ALBA) for inspiration, discussions, and priceless feedback. Special thanks to Jan Olle for his valuable contribution to the project at its birth. BpmLab currently continues its development under a service contract with ESRF aimed at extending its practical functionality and used during commissioning of the ESRF-EBS ring by 2020. 

Copyright (c) 2014-2019, Andriy Nosych
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * When publishing results based on BpmLab, the following reference is used: A. A. Nosych, U. Iriso, J. Olle, "Electrostatic finite-element code to study geometrical nonlinear effects of BPMs in 2D", Proceedings of IBIC-2015 (TUPB047). 
 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution

This software is provided by the copyright holders and contributors "AS IS" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. 

Several free third-party Matlab packages are used in this code; the copyrights of these functions belong to their respectful owners and can be found through links in the following list: 

DistMesh: http://persson.berkeley.edu/distmesh/ 
minFunc: https://www.cs.ubc.ca/~schmidtm/Software/minFunc.html
PropertyGrid: http://mathworks.com/matlabcentral/fileexchange/28732-property-grid-using-jide-implementation
polyfitn: http://mathworks.com/matlabcentral/fileexchange/34765-polyfitn
findjobj: http://mathworks.com/matlabcentral/fileexchange/14317-findjobj-find-java-handles-of-matlab-graphic-objects
2D FEM: J. Alberty, C. Carstensen, S. A. Funken, "Remarks around 50 lines of Matlab: short finite element implementation", Numerical Algorithms, 20, 117-137 (1999).