Utility methods for fitting arbitrary SECM features
run()andrunk()are dummy methods to stand-in for methods auto-generated by COMSOL Multiphysics. As is theModelclass.run()should simulate the SECM current at a list of points and export the currents to text filedata.txt.runk()should simulate the SECM current over the middle of the reactive feature to be fit using a range of k-values and export the currents to text filedata.txt.
comsolcompile(the compiler that must be used for COMSOL api apps) does not like anything being outside of the main class that is not part of Java 1.7 jdk or their proprietary libraries. The.javafile will compile, but the resulting program always quietly crashes./src/is meant to just hold the code that is copied into the auto-generated.javafile from COMSOL. Some modifications need to be made within therun()andrunk()methods./Example-implshows two example implementations./Example-impl/ToyModelfits 3 parameters L, r, and logk./Example-impl/Experimentfits 5 parameters L, r, logk and adjustments for the x and y position of the reactive shape. The latter example is intended for use with experimental SECM images. This example loads two control files, due to a second reactive feature in close proximity that could interfere with the feature that was being fit. This interfering feature is turned on and was assumed to hav the same kinetics as the subject, but needed its pixels turned off when measuring the logk-i curve so that thegetCentre()function work work properly.
/Example-impl/*/run.batwill compile and run the simulation on Windows machines.- On Windows systems,
C:\Program Files\COMSOL\COMSOL##\Multiphysics\bin\win64must be added to thePATHenvironment variable. - The comsol compiler has a different name in Unix-based systems (
comsol compileinstead ofcomsolcompile). - COMSOL's security preferences need to be updated. In
File>Preferences>Security:- Give COMSOL access to all files (so that you can write to files).
- Give COMSOL access to system properties (so that you can find the current working directory).