dymos
dymos copied to clipboard
AnalyticPhase
Define an AnalyticPhase for which the solution to the ODE is known analytically. Rather than taking an ODE, take a system that provides a solution for any time.
This would be useful to have on some of the project's we're currently working, so I'm bumping the priority up.
For the initial cut, we need a new Phase called AnalyticPhase
that inherits fromPhase
and overrides some of its methods.
Handling states
In an analytic phase, states are really just outputs of the form f(x0, t, p)
.
That is analytic phase will, at least initially, fundamentally just solve the IVP analytically, providing states just as any other output.
We'll maintain an official list of states for the sake of keeping things consistent with other phases in dymos when it comes to linking them together and stuff like that.
We will override the set_state_options
method so that it doesn't have a rate_src
, but instead has val_src
- the output in the ODE that provides the value of the state at a given time.
Handling controls
Initially there will be no support for controls in AnalyticPhase. Attempting to add a control or polynomial control will raise an exception. I'm not certain that there's any example where an ODE with dynamic controls has an analytic solution.
TImeseries outputs
Timeseries outputs will still be provided in the form phasename.timeseries.*
in order to be consistent with other phases, to support constraints and linkages.
Transcriptions
I don't think it makes sense that AnalyticPhases have transcriptions. In this case we're not really converting an infinite-dimensional optimal control problem to a discrete optimization problem.
Still, the mechanisms in dymos dictate that the transcription helps to setup/configure the phase, so we'll have an AnalyticTranscription that will just automatically be associated with the AnalyticPhase.
The next question is, where do the nodes go?
For this initial cut I think it makes sense that AnalyticPhase has a num_nodes
option and provides output nodes by using the formula np.linspace(t_initial, t_initial + t_duration, num_nodes)
.
Constraints
We should still support path and boundary constraints as we do with the other Phase/transcription types.
From a control viewpoint, this phase is similar to ExplicitShooting
, in that it fundamentally is governed by values of the initial states, parameters, initial time and duration.