November 13, 2013
by Justin Gray
Comments Off on OpenMDAO 0.9.0 Brings Large Amounts of New Functionality
This release incorporates a brand new capability for calculating the gradient of your models based on the work of John Hwang and Dr. Joaquim Martins at the University of Michigan. This change was 5 months in the making and represents a massive re-write of some of the core of OpenMDAO. At the user-interface level, while there are some changes, the differences are fairly minor and are restricted to the way you specify analytic derivatives to the framework.
The main purpose of the re-write was to bring improved scalability to our derivatives calculations, but the new functionality also includes support for forward and adjoint derivatives. To give you an idea of what we mean by scalability, we have recently solved a satellite design problem with 25,000 design variables and analytic derivatives. The code for that work is being set up as a plugin. You can take a sneak peek at the work here, but we’re still working to prepare the code for easier consumption (adding some docs and making a real tutorial out of it). The plugin should be cleaned up in the next two to three weeks.
The derivatives stuff is very new, and we’re currently working to make it easier for people to use. There is a lot of capability in the derivatives system (e.g., automatic finite-difference checking, derivatives for geometry) that is not as easy to use as it should be. So in the next month or two, we’ll be adding a few new API methods to make those capabilities more accessible and adding the necessary documentation to show you how to use it.
Derivatives are not the only new feature in this release though. Here are some of the other new features:
- Support for array parameters: Just add any array to solver or optimizer and it will automatically add each element of the array as a separate parameter to your driver.
- New geometry tutorial: We’ve put together a simple free-form deformation geometry example that you can run and have shown you how to execute a DOE on it.
- Connection Expressions: You can now have connections where the source term is an expression of one or more values, e.g., connect(“A.x + B.x”, “C.y”)
- File Variables can be initialized with strings: Setting up file variables used to be a little tricky, but you can now initialize them with a string representing the path to the file of interest.
Backwards-incompatible Change
In older versions of OpenMDAO it was possible to make connections between components located in different assemblies. For example, if you had two assemblies, asm1 and asm2, the old version of OpenMDAO would allow you to do things like ‘top.connect(‘asm1.y’, ‘asm2.comp1.x’). In the current version of OpenMDAO, only variables within the scope of the same assembly can be connected. This means that comp1.x has to be made visible as a variable of asm2, typically by calling asm2.create_passthrough(‘comp1.x’), which creates a variable ‘x’ in asm2 and connects it to comp1.x. Once that is done, top.connect(‘asm1.y’,’asm2.x’) will connect asm1.y to asm2.x, which is connected inside of asm2 to comp1.x.
In summary:
# this works in versions before 0.9
top.connect(‘asm1.y’, ‘asm2.comp1.x’)
# this works in 0.9 and later
top.asm2.create_passthrough(‘comp1.x’)
top.connect(‘asm1.y’, ‘asm2.x’)
This same restriction also applies to parameters, objectives and constraints defined in a driver. They may only reference variables found in the same scope that contains the driver.
For example:
# this works in versions before 0.9
top.driver.add_constraint(‘asm.comp1.x = 0’)
# this works in 0.9 and later
top.asm.create_passthrough(‘comp1.x’)
top.add_constraint(‘asm.x = 0’)