OpenMDAO / dymos

Open Source Optimization of Dynamic Multidisciplinary Systems
Apache License 2.0
210 stars 67 forks source link

Some constraints in the Birkhoff transcription are a linear function of the design variables. #1041

Closed robfalck closed 8 months ago

robfalck commented 9 months ago

Proposed feature.

The following collocation defects exist for the Birkhoff transcription:

            state_defect = np.einsum('ij,jk...->ik...', self._A, XV) - \
                np.einsum('ij, j...->i...', self._C, x_ab.reshape((2 * num_segs,) + shape))

            outputs[var_names['state_defect']] = state_defect
            outputs[var_names['state_rate_defect']] = (V - np.einsum('i...,i...->i...', f, dt_dstau))
            outputs[var_names['initial_state_defect']] = x_ab[0, 0, ...] - x_a
            outputs[var_names['final_state_defect']] = x_ab[-1, 1, ...] - x_b

Of these, the state_defect is a linear function of the design variables as long as X and V are design variables. Since dymos doesn't support opt=False for states yet, this is guaranteed to be the case.

The initial defect is guaranteed to be linear if the initial state is a design variable, and the final defect is guaranteed to be linear if the final state is a design variable. If these initial or final values are input, then the linearity cannot be guaranteed.

Example

N/A