view +time/+rk4/get_rk4_time_step.m @ 1347:ac54767ae1fb feature/poroelastic tip

Add interface, not fully compatible.
author Martin Almquist <martin.almquist@it.uu.se>
date Tue, 30 Apr 2024 14:58:35 +0200
parents 48b6fb693025
children
line wrap: on
line source

% Calculate the size of the largest time step given the largest evalue for a operator with pure imaginary e.values.
function k = get_rk4_time_step(lambda,l_type)
    default_arg('l_type','complex')

    rad = abs(lambda);
    if strcmp(l_type,'real')
        % Real eigenvalue
        % kl > -2.7852
        k = 2.7852/rad;

    elseif strcmp(l_type,'imag')
        % Imaginary eigenvalue
        % |kl| < 2.8284
        k = 2.8284/rad;
    elseif strcmp(l_type,'complex')
        % |kl| < 2.5
        k = 2.5/rad;
    else
        error('l_type must be one of ''real'',''imag'' or ''complex''.')
    end
end