-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalized integrator class for use with FMUs #2823
Comments
New class (Simulator) will exist alongside old class (Integrator) until it's mature enough to replace it
Closing this issue. Additional features handled in dedicated issues. |
Now includes option to redirect validation data to file
New class (Simulator) will exist alongside old class (Integrator) until it's mature enough to replace it
…ction Now includes option to redirect validation data to file
Reopened to better align syntax with integrator, and to add quadrature support |
The oracle is now the non-augmented DAE and the option nfwd indicates how many sensitivity right-hand-sides
Now created on-demand inside differentiation functions and cached
Jacobians inherited even if derivative_of_ has sensitivities
All key functionalities of the Simulator class are now part of the generalized Integrator class: Control support, analytic derivatives (forward/adjoint) in combination with multiple stopping times for the integrator, structure exploiting derivatives. Some lingering features had not been merged as of this writing: Sensitivitiy calculations using Sundials native forward sensitivity approach (covered by #3045) and problem-specific scalar factors (covered by #3046). Both those features are important for large-scale applications, but they can easily be ported to the Integrator class later.
Work completed. This issue is a major change internally, but with limited changes for the end-user. Relevant changes for the end-user include:
|
Hei All, Is it possible to upload a simple optimal control example from fmu model? That would definitely be very helpful for my research. Kind regards Simon Weber |
Sorry, things got a bit hectic before the release and the FMU demo I had never got uploaded. You can find the latest version here: The demo is pretty rough, and I just discovered that one of part of it got accidentally broken before the 3.6.0 release. I'll try to include a fixed version in 3.6.1 |
The binary FMU interface (#2779) allows FMUs to be evaluated pointwise. This is would in principle allow the FMU to be integrated using the existing Integrator class, but this would potentially be very limited and inefficient, due to:
To get around this, it makes sense to add a dedicated Simulator plugin class which can be constructed from an FMU function instance:
To start with, the simulator class would only be defined for fmu_functions, but it could easily be extended to symbolic representations of the dynamic system. It would also not be differentiable, at least not at first. It might be possible and desirable to combine this class with the integrator class, but given the disruption it would result in, it's better to keep the classes separate at first, but with maximum amount of communality. The dynamic system argument should correspond to a state-space representation with quadratures:
(t, x, z, p, u) -> (xdot, alg, y, qdot)
. The Simulator class will have the same signature as Integrator but add piecewise controls ("u") and outputs ("y").To be able to simulate an FMU, a CVodes plugin makes sense to begin with.
Update:
This issue has taken some unexpected turns. The latest conclusion is that maintaining both
Integrator
andSimulator
is not realistic. Instead,Integrator
has now been extended with elements from theSimulator
class, in particular control inputs. The output support has been left out since they can be calculated after the integration with few drawbacks. What remains of this issue is to port forward sensitivity approach fromSimulator
toIntegrator
, i.e. add "nfwd" as an option, instead of deducing it from the number of columns in the oracle_ inputs/outputs.The text was updated successfully, but these errors were encountered: