Using APOPT (MINLP) solver in Openmdao - openmdao

I have a mixed integer nonlinear problem. I dont want to use any penalty approaches so I am looking for a MINLP solver in Openmdao. Is it possible to use APOPT solver in openmdao ? It isn't available in pyoptsparse driver. Is there any other alternative ? If not how should I go about implementing APOPT in openmdao ?

The first step in making any optimizer available to OpenMDAO is to make it accessible in Python itself. It looks like APOPT is available in Python through the GEKKO library. So Step 1 is for you to get that library, and figure out how to use it.
Then you can write a driver that integrates GEKKO in OpenMDAO. To do that you will write your own plugin that wraps GEKKO. You can search for the openmdao github topic to see a list of existing plugins for some examples (you can make plugins for anything, not just drivers)
One example driver plugin for is the OpenMDAO wrapper for the NLopt library, written by the National Renewable Energy Laboratory.
https://github.com/johnjasa/nrel_openmdao_extensions/blob/master/nrel_openmdao_extensions/nlopt_driver.py
The actual driver code is here, but the full repo is necessary to actually register it as a plugin.
You can also look into the MINLP algorithm AMIEGO, which is also available as a plugin. You can read about it in detail in this paper.

Related

How do I use GSL in Julia?

the general questiĆ³n would be how do I to use any library non-standar in Julia, e.g. libraries exported from C, specifically I downloaded the GNU Scientific Library from https://www.gnu.org/software/gsl/, according the Julia Manual I think it can be used, but I readed the INSTALL file from the GSL folder and I tried follow the steps, however I could not finish them because I did'nt understand some steps.
If anyone could give me some advice to use this library in Julia, I would appreciate it very much.
some details.
-OS: Windows10
-Julia version: 0.6
In the general case,
calling compiled code is done using ccall
For the case of GSL, for most operations you shouldn't be using GSL.
The (almost all) the functionality provided by GSL is well covered by the Julia standard library or by well maintained julia packages.
Mostly with implementation in pure julia.
Pure julia implementations will normally be basically as fast as the C/Fortran implementations.
Plus they will have other good features like working well with the optimiser,
and supporting custom types via multiple dispatch
For example supporting Dual numbers means that ForwardDiff.jl will just natively allow Auto differentiation to work with them.
For some code ducktyping will even let them work with things like TensorFlow..
As to how to install GSL, I think that is a seperate question from how to use GSL with julia.
Conviently though, if you are in a position you absolutely need to call GSL from julia,
there is already a julia package wrapping it. GSL.jl
And particularly conveniently, it will automatically download and install GSL for you when you run Pkg.add("GSL.jl"),
so you don't have to worry about installing it yourself.
If the package isn't working for you, raise an issue on their repo.
(Julia packages tend to be good like that, just installing all their dependencies so you don't have to fiddle around with things. I've been really impressed a few times when colleges have come to me saying "I love R library Foo but I can't using it on windows as I can't get the Fortran backend to work"; and I'll be like "Foo.jl does the same thing using the same fortran backend, also it automatically installs that backend, and does so in a way that just works even on windows.")

Not able to install plugins in latest openmdao 1.7.x

I am interested in multiobjective optimization using genetic algorithm or particle swam. For this I understood, that I need to install the pyopt plugin.
Though it seems that the driver listed here:
https://github.com/OpenMDAO-Plugins?page=1
are not suitable for the latest release. Is this right?
Is there another repository for the current drivers?
I am also not sure how to install the drivers as the 'plugin' command is not in my path and I did not find it when I dowloaded the git repository.
Could you point me to an multiobjective nsga tutorial?
In addition to this I am interested in the dakota-plugin in.
The plugins page you've referenced is for an Older version of OpenMDAO (V 0.0.13 and older). For 1.7.x, we handle plugins a bit differently. OpenMDAO is now a standard python package and any plugins can just list it as a dependency.
That being said, you don't actually need a plugin for pyopt_sparse. The wrapper for it is built into OpenMDAO. You just need to install pyopt_sparse from it's bitbucket repo. After that you can just use it.
You can see an example of setting up pyopt_sparse in the OpenMDAO tests suite here.

Testing Meteor packages with Velocity?

Velocity is an amazing testing framework for Meteor and I am currently using it to test my application code.
Now I added a local package to the app, but I don't know how (or if) I can test the package with Velocity, too. I would like to drop tinyTest in favor for a consistent testing framework - Velocity.
Is it possible to test packages with Velocity? How should the file structure look like?
Yes, it is possible to test packages with sanjo:jasmine. It works in nearly the same way as with TinyTest. You can find all information to get started in the sanjo:jasmine README. There is also an example package. To run the tests, use the commands from the README.
If you need additional information, let me know.

Using Gradle with R project

I am beginning work on a project that makes heavy use of R. I've used R in the past, but only in a casual mode, whereas I'm now interested in following a more rigid practice of test/source control/continuous integration. I'm hoping to use Gradle with this project if possible, but I can't find any evidence that it is possible to use Gradle with R. Is it possible to create an R project with Gradle, and if so, where can I find steps to help me get started?
There appears to be a third-party plugin (https://github.com/jamiefolson/gradle-plugin-r). Alternatively, if R provides some command-line tools or Ant tasks, you can call into them from Gradle.
We have been working on gradle-R-plugin. (link to source is here https://github.com/arekbee/gradle-R-plugin). We have used it for CI/CD with TeamCity. gradle-R-plugin is base on devtools R package. I am happy to help you with this plugin.

Using Maven for R projects

I am beginning work on a project that makes heavy use of R. I've used R in the past, but only in a casual mode, whereas I'm now interested in following a more rigid practice of test/source control/continuous integration. I'm hoping to use Maven with this project if possible (having been pleased with how this manages packages with Java), but I can't find any evidence that it is possible to use Maven with R. Is it possible to create an R project with Maven, and if so, where can I find steps to help me get started?
I've found this question and this question, but they don't mention R.
Well you could make use of the Maven Exec Plugin with the resource, filter and jar plugins to fake an R project type.
You can do something like this to set up multiple R goals with the exec plugin so that compile, filter, test, et al have some kind of R call associated.
http://maven.apache.org/plugins/maven-resources-plugin/

Resources