I want to use a block of code written in OpenMDAO to extract an expression of an output as function of a couple of variables (needed to be declared symbolic). In this case the structure of the problem is not highly nested, so maybe I will loose less time doing it by hand directly, but I would want to know if there exist any kind of similar capability for doing this.
In this case, the structure is the following: Just the computation of the drag coefficient CD as function of Mach (M) and lift coefficient (CL):
Each contribution (CD0 and e) are groups composed of several components (ExplicitComponents in this case) with further dependencies on M and CL.
So being able to get an expression that would look something like this, in terms of M and CL:
Being di coefficients evaluated from the rest of inputs in relations defined in the rest of components.


You are looking for the
ExecComp, which lets you just type out an equation in the initialization arguments.The docs are here.
Simple example copied from those docs: