Closed tburch-LSS closed 2 weeks ago
A possible third option: export the Modelica-function integrand as an FMU. Then the interface code needs to handle the communication between GSL and the FMU. Not sure if that's possible either.
Latest pull request (v1.0.2 on 03.Sept) has a successful version of the GSL QAG integration routine implemented. It is an implementation of Option 2 and the 'CreateIntegrand' model has to run before any larger model which would use the 'integrand' function together with QAG (or soon, others). The one wrinkle is that I had to resort to 'gcc' and 'ar' as system commands to create the static library (libgsl_integration_MI.a). Unless I can find a workaround for this, Windows users will have to install mingw and msys to have these system commands (there is a warning to this effect in the info section of 'CreateInegrand').
latest commit has abandoned 'ar' command and works exclusively with 'gcc' for creating shared libraries (.so / .dll).
on linux / openmodelica all seems to work fine. it would be helpful if someone could point out any problems encountered on other OS's / connection editors.
... or if this approach to including other GSL capabilities is not preferred...?
Can this be closed with the #9 merge?
yes, go ahead and do that... along with our long discussion and changes therein, this reads a bit outdated. :-) thanks!
In the latest commit (v1.0.1) the first of GSL's integration routines are attempted to be implemented within the connection editor environment (OMEdit or Dymola). The main stumbling block is the fact that Modelica does not support the passing (or calling) of a Modelica function (the integrand) to (or from) an external library (or in this case, necessary routines to form the interface between GSL and Modelica: see code in Resources/Source). I pointed out this limitation to the Modelica and OpenModelica folks...
https://github.com/modelica/ModelicaStandardLibrary/discussions/4230
https://github.com/OpenModelica/OpenModelica/discussions/11848
... with a rather lukewarm response.
As i see it, there are two ways to proceed: 1. form a more savvy interface which knows more about translated C-code names / prototypes of the relevant Modelica functions; 2. Create a Modelica script (or routines) which creates a C-version of the same Modelica function and compiles it (and links it with the interface) before the larger model flattens / translates / compiles.
Option 1 would probably have omc vs Dymola-compiler issues. Neither of which I am versed in.
Option 2 is what is partially coded in the latest version. There are still other smaller problems, but the main issue is figuring out how to get the "integrand setup" routines to run before any larger model starts.
Sorry for the novel, but has anyone had any similar experiences? Any ideas?