Asked by:
how can i solve stiff differential equations in C#?
Question

All replies

which method in Microsoft Oslo Library can solve the Stiff ordinary differential Equations? is there another way to solve them at all?
Is there any limit for number of equations (dimension of matrix) in Oslo's Method?
Hi, I dont know of that library but for solving stiff differential equations with difference methods I would use an implicit method. That means some realsolving at each iteration, so you would end up doing some more computations. You could test eg the Trapezoidal Method (sometimes called (2 stage) AdamsMoulton Method). also there are implicit Runge Kutta and Rosenbrock Wanner methods [etc]).
[Of course there are other methods to solve such equations, a Finite Element Method, with a simple linear interpolation base ("hat"functions) for the functionspace the Galerkin approximation takes place, will be exact at the nodes  if this base is a possible choice.]
https://ocw.mit.edu/courses/mathematics/18085computationalscienceandengineeringifall2008/videolectures/lecture10finitedifferencesintime/
as one lecture of the very good course:
https://ocw.mit.edu/courses/mathematics/18085computationalscienceandengineeringifall2008/videolectures/

Since I dont know the library you mentioned I dont know of the limits, but I guess for sparse tridiagonal (Block) systems the limit would be a relatively large number, since you only need to know the index of the row (or the diagonal element) and the distance from that diagonal element to the two offdiagonal elements plus the values of those elements and the changes in the matrix for the first and last row (of blocks) depending on the boundary conditions of the problem.
Regards,
Thorsten
 Edited by Thorsten Gudera Friday, November 17, 2017 9:51 PM

Hi,
... looking at
https://www.microsoft.com/enus/research/project/opensolvinglibraryforodes/
its said that there are Runge Kutta and BDF methods implemented. So, if there's no implicit Runge Kutta method in that lib, try the BDF method(s) for solving the stiff equation.
Maybe do a stability test with a known function and the chosen method, maybe even the Dahlquist Test function u' = lambda*u with u(0) = 1 and see if you get a series of constanly falling values as result.
https://en.wikipedia.org/wiki/Stiff_equation#Astability
Regards,
Thorsten
 Proposed as answer by Zhanglong WuMicrosoft contingent staff, Moderator Thursday, November 30, 2017 9:49 AM
