Skip to content

dymos 0.17.0

Enhancements

OpenMDAO variable tags may be used to specify rate sources in ODE systems.

OpenMDAO supports tagging of inputs and outputs. Dymos now can use this capability to specify the rate source and default units of a state from within the ODE. The following code demonstrates how to tag state rate sources and provide their default units.

self.add_output('xdot', val=np.zeros(nn), desc='velocity component in x', units='m/s',
                tags=['state_rate_source:x', 'state_units:m'])

self.add_output('ydot', val=np.zeros(nn), desc='velocity component in y', units='m/s',
                tags=['state_rate_source:y', 'state_units:m'])

self.add_output('vdot', val=np.zeros(nn), desc='acceleration magnitude', units='m/s**2',
                tags=['state_rate_source:v', 'state_units:m/s'])
self.add_output('xdot', val=np.zeros(nn), desc='velocity component in x', units='m/s')
self.add_output('ydot', val=np.zeros(nn), desc='velocity component in y', units='m/s')
self.add_output('vdot', val=np.zeros(nn), desc='acceleration magnitude', units='m/s**2')

This allows the user to avoid repetitive specification of the rate sources every time a specific ODE is used.

phase.add_state('x', fix_initial=True, fix_final=True)
phase.add_state('y', fix_initial=True, fix_final=True)
phase.add_state('v', fix_initial=True, fix_final=False)
phase.add_state('x', rate_source='xdot', fix_initial=True, fix_final=True)
phase.add_state('y', rate_source='ydot', fix_initial=True, fix_final=True)
phase.add_state('v', rate_source='vdot', fix_initial=True, fix_final=False)

Dymos can now automatically generate plots of timeseries outputs.

Typically Dymos usage featured a lot of boilerplate code for plotting the results after a run and, optionally, a simulation of the resulting control profile. As of 0.17.0, Dymos can now generate plots of all timeseries outputs by giving the make_plots=True option to dymos.run_problem.

Dymos now uses introspection to automatically determine shapes of states, controls, and parameters if they are left unspecified.

In a continuing effort to minimize the amount of boilerplate code required, Dymos can now automatically determine the default units and shapes of states, controls, polynomial controls, parameters, and time.