I have to perform a numerical solving of an ODE system which has the following form:
du_j/dt = f_1(u_j, v_j, t) + g_1(t)v_(j-1) + h_1(t)v_(j+1),
dv_j/dt = f_2(u_j, v_j, t) + g_2(t)u_(j-1) + h_2(t)u_(j+1),
where u_j(t)
and v_j(t)
are complex-valued scalar functions of time t
, f_i
and g_i
are given functions, and j = -N,..N
. This is an initial value problem and the task is to find the solution at a certain time T
.
If g_i(t) = h_i(t) = 0
, then the equations for different values of j
can be solved independently. In this case I obtain a stable and accurate solutions with the aid of the fourth-order Runge-Kutta method. However, once I turn on the couplings, the results become very unstable with respect to the time grid step and explicit form of the functions g_i
, h_i
.
I guess it is reasonable to try to employ an implicit Runge-Kutta scheme, which might be stable in such a case, but if I do so, I will have to evaluate the inverse of a huge matrix of size 4*N*c
, where c
depends on the order of the method (e. g. c = 3
for the Gauss–Legendre method) at each step. Of course, the matrix will mostly contain zeros and have a block tridiagonal form but it still seems to be very time-consuming.
So I have two questions:
Is there a stable explicit method which works even when the coupling functions
g_i
andh_i
are (very) large?If an implicit method is, indeed, a good solution, what is the fastest method of the inversion of a block tridiagonal matrix? At the moment I just perform a simple Gauss method avoiding redundant operations which arise due to the specific structure of the matrix.
Additional info and details that might help us:
I use Fortran 95.
I currently consider
g_1(t) = h_1(t) = g_2(t) = h_2(t) = -iAF(t)sin(omega*t)
, wherei
is the imaginary unit,A
andomega
are given constants, andF(t)
is a smooth envelope going slowly, first, from 0 to 1 and then from 1 to 0, soF(0) = F(T) = 0
.Initially
u_j = v_j = 0
unlessj = 0
. The functionsu_j
andv_j
with great absolute values ofj
are extremely small for allt
, so the initial peak does not reach the "boundaries".