Design Variables Constraints in Adjoint Optimizer

49 views
Skip to first unread message

Julien

unread,
Feb 16, 2026, 11:09:51 AMFeb 16
to OpenVSP
Hello everyone!
I started looking at how to use the new adjoint driven optimization feature and managed to run a basic wing optimization. However I don't know (if it's possible) how to impose design variables constraints during the optimization. 
So for example I run this command vspaero_opt -omp 4 Most_Basic_Wing and I have this optimization formulation:

Optimization_CL_Weight   = 5.
Optimization_CD_Weight   = 1.
Optimization_CS_Weight   = 0.
Optimization_CL_Required = 0.55
Optimization_CD_Required = 0.
Optimization_CS_Required = 0.
Optimization_CML_Weight   = 0.
Optimization_CMM_Weight   = 1.
Optimization_CMN_Weight   = 0.
Optimization_CML_Required = 0.
Optimization_CMM_Required = 0.
Optimization_CMN_Required = 0.

and this .des file:
2
EEQBNXFRSUM:WingGeom:XSec_1:Sweep: 10
ZMDVLABRBAE:WingGeom:XSec_1:Tip_Chord: 0.4

and would like to impose a tip_chord < 1
Would that be possible? Also I tried to find out by myself this kind of information on the github but I am not familiar with reading source code from other people so I guess I should read it somewhere here: https://github.com/OpenVSP/OpenVSP/blob/6697aab6759317aaa5d7666cee18faf9e0d0336c/src/vsp_aero/Solver/vspaero.C#L5779 but cannot find anything related to constraints.

Thanks for your help!

Rob McDonald

unread,
Feb 16, 2026, 12:46:30 PMFeb 16
to OpenVSP
At present, there is no way to constrain design variables.

Right now, the embedded optimizer is extremely simple -- essentially pure gradient descent with a line search.

I would like to see us move to a more sophisticated optimizer, but so far we have not found one that we are enthusiastic about using.

We also expect that in many situations, people will integrate VSPAERO into a larger / more sophisticated framework and consequently will use their own optimizer.

Rob

Joep de Boer

unread,
7:50 AM (6 hours ago) 7:50 AM
to OpenVSP
Would it be possible to extract the gradients through the python Api? As this would open up the possibility to use it with OpenMDAO (and probably many other frameworks)  and set constraints there . Would be glad if anyone has an api example extracting gradients.  Thanks in advance
Op maandag 16 februari 2026 om 18:46:30 UTC+1 schreef Rob McDonald:

Brandon Litherland

unread,
7:56 AM (6 hours ago) 7:56 AM
to OpenVSP
I've not personally tested this but it should work.
If you set up duplicate parameters in User Parms of the design variables that you want to control/constrain, you can define Min/Max limits to those User Parms and then link them to the real variable so they are equal. You should then be able to run the optimization on the User Parm variables and get the behavior that you want.

Rob McDonald

unread,
1:39 PM (13 minutes ago) 1:39 PM
to OpenVSP
For the VSPAERO optimization, OpenVSP is not 'in charge', and the OpenVSP API does not really apply.

vspaero_opt has its own main() function and it uses the VSPAERO solver and OpenVSP via C++ API's.

The simple optimizer used by vspaero_opt is not meant as a long term solution -- think of it more as a proof of concept.

Instead, it is expected that serious users of the adjoint and optimization capability will want to use their own optimizer (possibly through OpenMDAO or another framework).  This will allow them to use an optimizer of choice (likely supporting constraints, etc) and also to build up multidisciplinary problems.  I.e. you won't just be restricted to VSPAERO and whatever the OpenVSP / VSPAERO developers think of.

For now, this capability is accessed by using the C++ API of VSPAERO and OpenVSP -- everything you need to build your own optimizer (or integrate into a larger framework) are available there.  Think of vspaero_opt as a roadmap for developing your own optimizer using VSPAERO and OpenVSP.

There is intent to make a Python API for the VSPAERO solver and adjoint.  That could be used with the existing OpenVSP API to integrate into a Python centric framework.  I do not know what kind of timeframe to expect for that work -- not particularly soon.

Rob


Reply all
Reply to author
Forward
0 new messages