dymos icon indicating copy to clipboard operation
dymos copied to clipboard

several dymos components are doing unnecessary unit conversions

Open naylor-b opened this issue 2 years ago • 1 comments

Description

Several components (AnalyticTimeseriesOutputComp, ExplicitShootingTimeseriesComp, PseudospectralTimeseriesOutputComp, and SolveIVPTimeseriesOutputComp) have the following logic:

if input_units is None or units is None:
     ... 
else:
     self._conversion_factors[name] = unit_conversion(input_units, units)

Later, unit conversion is done if name is found in self._conversion_factors. This results in unnecessary unit conversions in cases where units and input_units are the same.

GaussLobattoInterleaveComp also seems to have a similar issue.

Example

I noticed this when looking through the code, but it looks like calling _add_output_configure on one of these timeseries comps with units that are the same as the src units (or if src is None) will result in unnecessary conversions.

Dymos Version

1.8.1

Relevant environment information

No response

naylor-b avatar Aug 29 '23 19:08 naylor-b

This is a holdover from the days before OpenMDAO supported unit conversion on constraints and objectives. We can get rid of it now.

robfalck avatar Aug 30 '23 13:08 robfalck