pySDC icon indicating copy to clipboard operation
pySDC copied to clipboard

Runge-Kutta sweeper for DAEs

Open lisawim opened this issue 1 year ago • 1 comments

This PR contains the Runge-Kutta sweeper base class for solving DAEs. Runge-Kutta methods for general DAEs $$0 = F(u, u', t)$$ read $$0 = F(u_0 + \Delta t \sum_{j=1}^m a_{i,j} U_j, U_m),$$ $$u_M = u_0 + \Delta t \sum_{j=1}^M b_j U_j$$ where a (non)-linear system needs to be solved at each node (in the same way as it needs to be done in the SDC-DAE sweepers). In literature, there are also half-explicit Runge-Kutta methods especially for semi-explicit DAEs, which is left for future work (i.e., I'll hand in the stuff some time).

The new Runge-Kutta sweeper for DAEs requires a du_exact method from the problem returning initial conditions for the derivative of the solution since initial conditions $u(t_0)$ and $u'(t_0)$ are needed. The base class thus has an attribute du_init where the value of the derivative at the end point is stored and passed to the new step. I don't know if I've chosen a smart solution for that, for the first time it works however.

Butcher tableaux can be easily implemented in pySDC.implementations.sweeper_classes.Runge_Kutta.py, where I added two new methods. The tests in test_Runge_Kutta_sweeper.py are adapted to include the two new methods in the tests. Of course, I also added tests for the Runge-Kutta-DAE sweeper for different cases of DAEs where the orders are tested. Note that for DAEs of higher index $k > 1$ order reduction is observed in the algebraic variable.

I'd really appreciate your review. Please let me know if there is something that I can improve.

lisawim avatar May 13 '24 10:05 lisawim

Codecov Report

Attention: Patch coverage is 97.93814% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 77.95%. Comparing base (18989d3) to head (3ddf2e5). Report is 12 commits behind head on master.

Files Patch % Lines
...ySDC/projects/DAE/problems/DiscontinuousTestDAE.py 77.77% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #432      +/-   ##
==========================================
+ Coverage   77.38%   77.95%   +0.56%     
==========================================
  Files         327      330       +3     
  Lines       26085    26223     +138     
==========================================
+ Hits        20187    20443     +256     
+ Misses       5898     5780     -118     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 18 '24 05:05 codecov[bot]

LGTM

brownbaerchen avatar May 23 '24 12:05 brownbaerchen