idaes-pse icon indicating copy to clipboard operation
idaes-pse copied to clipboard

PETSc DAE Solver "initial_only" only option.

Open eslickj opened this issue 1 year ago • 2 comments

When using the petsc.petsc_dae_by_time_element() function to solve a DAE model, I think it would be useful to have an "initial_only" option. I may not have thought this through well enough, but the idea is that when you initialize a DAE model and you are solving with an integrator, only the initial condition matters. Next time you solve it the trajectory is just replaced. If I break the model up and initialize unit by unit, getting the trajectory is just a waste of time. This isn't really a PETSc solver issue specifically, but petsc.petsc_dae_by_time_element() does conveniently split off the initial condition equations for you. I'm know there are other ways to approach this, but adding the option seems convenient.

I think this would be easy to implement. Just terminate the function after solving the initial conditions. The results should be in the model. Return the solver status and None for the trajectory.

eslickj avatar Feb 21 '24 16:02 eslickj