Mercurial > repos > public > sbplib
changeset 989:e41c93d7ab08 feature/timesteppers
Merge with default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 09 Jan 2019 08:56:42 +0100 |
parents | a32856fc2ad2 (diff) a72038b1f709 (current diff) |
children | 1066bb31bc95 |
files | |
diffstat | 15 files changed, 314 insertions(+), 346 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+time/+rk/butcherTableauFromStr.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,51 @@ +% Returns the coefficients used in a RK method as defined by a Butcher Tableau. +% +% @param method - string specifying which Runge-Kutta method to be used. +% @return s - number of stages +% @return a - coefficents for intermediate stages +% @return b - weights for summing stages +% @return c - time step coefficents for intermediate stages +function [s,a,b,c] = butcherTableauFromStr(method) +switch method + case "tvd-3" + % TVD (Total Variational Diminishing) + s = 3; + a = zeros(s,s-1); + a(2,1) = 1; + a(3,1) = 1/4; a(3,2) = 1/4; + b = [1/6, 1/6, 2/3]; + c = [0 1 1/2]; + case "rk4" + % Standard RK4 + s = 4; + a = zeros(s,s-1); + a(2,1) = 1/2; + a(3,1) = 0; a(3,2) = 1/2; + a(4,1) = 0; a(4,2) = 0; a(4,3) = 1; + b = [1/6 1/3 1/3 1/6]; + c = [0, 1/2, 1/2, 1]; + case "rk4-3/8" + % 3/8 RK4 (Kuttas method). Lower truncation error, more flops. + % Irreducible, unlike standard rk4. + s = 4; + a = zeros(s,s-1); + a(2,1) = 1/3; + a(3,1) = -1/3; a(3,2) = 1; + a(4,1) = 1; a(4,2) = -1; a(4,3) = 1; + b = [1/8 3/8 3/8 1/8]; + c = [0, 1/3, 2/3, 1]; + case "rk6" + % Runge-Kutta 6 from Alshina07 + s = 7; + a = zeros(s,s-1); + a(2,1) = 4/7; + a(3,1) = 115/112; a(3,2) = -5/16; + a(4,1) = 589/630; a(4,2) = 5/18; a(4,3) = -16/45; + a(5,1) = 229/1200 - 29/6000*sqrt(5); a(5,2) = 119/240 - 187/1200*sqrt(5); a(5,3) = -14/75 + 34/375*sqrt(5); a(5,4) = -3/100*sqrt(5); + a(6,1) = 71/2400 - 587/12000*sqrt(5); a(6,2) = 187/480 - 391/2400*sqrt(5); a(6,3) = -38/75 + 26/375*sqrt(5); a(6,4) = 27/80 - 3/400*sqrt(5); a(6,5) = (1+sqrt(5))/4; + a(7,1) = -49/480 + 43/160*sqrt(5); a(7,2) = -425/96 + 51/32*sqrt(5); a(7,3) = 52/15 - 4/5*sqrt(5); a(7,4) = -27/16 + 3/16*sqrt(5); a(7,5) = 5/4 - 3/4*sqrt(5); a(7,6) = 5/2 - 1/2*sqrt(5); + b = [1/12 0 0 0 5/12 5/12 1/12]; + c = [0, 4/7, 5/7, 6/7, (5-sqrt(5))/10, (5+sqrt(5))/10, 1]; + otherwise + error('Runge-Kutta method %s is not implemented', method) +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+time/+rk/get_rk4_time_step.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,21 @@ +% 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 \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+time/+rk/rk4_stability.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,58 @@ +function rk_stability() + ruku4 = @(z)(abs(1 + z +(1/2)*z.^2 + (1/6)*z.^3 + (1/24)*z.^4)); + circ = @(z)(abs(z)); + + + % contour(X,Y,z) + ax = [-4 2 -3 3]; + % hold on + fcontour(ruku4,[1,1],[-3, 0.6],[-3.2, 3.2]) + hold on + r = 2.6; + fcontour(circ,[r,r],[-3, 0.6],[-3.2, 3.2],'r') + hold off + % contour(X,Y,z,[1,1],'b') + axis(ax) + title('4th order Runge-Kutta stability region') + xlabel('Re') + ylabel('Im') + axis equal + grid on + box on + hold off + % surf(X,Y,z) + + + rk4roots() +end + +function fcontour(f,levels,x_lim,y_lim,opt) + default_arg('opt','b') + x = linspace(x_lim(1),x_lim(2)); + y = linspace(y_lim(1),y_lim(2)); + [X,Y] = meshgrid(x,y); + mu = X+ 1i*Y; + + z = f(mu); + + contour(X,Y,z,levels,opt) + +end + + +function rk4roots() + ruku4 = @(z)(abs(1 + z +(1/2)*z.^2 + (1/6)*z.^3 + (1/24)*z.^4)); + % Roots for real evalues: + F = @(x)(abs(ruku4(x))-1); + real_x = fzero(F,-3); + + % Roots for imaginary evalues: + F = @(x)(abs(ruku4(1i*x))-1); + imag_x1 = fzero(F,-3); + imag_x2 = fzero(F,3); + + + fprintf('Real x = %f\n',real_x) + fprintf('Imag x = %f\n',imag_x1) + fprintf('Imag x = %f\n',imag_x2) +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+time/+rk/rungekutta.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,23 @@ +% Takes one time step of size dt using the rungekutta method +% starting from @arg v and where the function F(v,t) gives the +% time derivatives. coeffs is a struct holding the RK coefficients +% for the specific method. +% Also returns the stage approximations (V) and stage rates (K). +function [v, V, K] = rungekutta(v, t , dt, F, coeffs) + % Compute the intermediate stages k + K = zeros(length(v), coeffs.s); + V = zeros(length(v), coeffs.s); + for i = 1:coeffs.s + u = v; + for j = 1:i-1 + u = u + dt*coeffs.a(i,j)*K(:,j); + end + V(:,i) = u; + K(:,i) = F(u,t+coeffs.c(i)*dt); + end + % Compute the updated solution as a linear combination + % of the intermediate stages. + for i = 1:coeffs.s + v = v + dt*coeffs.b(i)*k(:,i); + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+time/+rk/rungekuttaDiscreteData.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,30 @@ +% Takes one time step of size dt using the rungekutta method +% starting from @arg v. +% +% discreteData contains (a part of) the forcing function, already +% evaluated on the space-time grid. +% +% ODE: dv/dt = F(v,t) + discreteData(:, nt), where nt denotes the current time-point. +% +% coeffs is a struct holding the RK coefficients +% for the specific method. +% Also returns the stage approximations (V) and stage rates (K). +function [v, V, K] = rungekuttaDiscreteData(v, t , dt, F, coeffs, discreteData, n) + % Compute the intermediate stages k + K = zeros(length(v), coeffs.s); + V = zeros(length(v), coeffs.s); + for i = 1:coeffs.s + u = v; + for j = 1:i-1 + u = u + dt*coeffs.a(i,j)*K(:,j); + end + V(:,i) = u; + K(:,i) = F(u,t+coeffs.c(i)*dt); + K(:,i) = K(:,i) + discreteData(:, n*coeffs.s + i); + end + % Compute the updated solution as a linear combination + % of the intermediate stages. + for i = 1:coeffs.s + v = v + dt*coeffs.b(i)*k(:,i); + end +end \ No newline at end of file
--- a/+time/+rk4/get_rk4_time_step.m Tue Jan 08 15:00:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -% 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 \ No newline at end of file
--- a/+time/+rk4/rk4_stability.m Tue Jan 08 15:00:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -function rk_stability() - ruku4 = @(z)(abs(1 + z +(1/2)*z.^2 + (1/6)*z.^3 + (1/24)*z.^4)); - circ = @(z)(abs(z)); - - - % contour(X,Y,z) - ax = [-4 2 -3 3]; - % hold on - fcontour(ruku4,[1,1],[-3, 0.6],[-3.2, 3.2]) - hold on - r = 2.6; - fcontour(circ,[r,r],[-3, 0.6],[-3.2, 3.2],'r') - hold off - % contour(X,Y,z,[1,1],'b') - axis(ax) - title('4th order Runge-Kutta stability region') - xlabel('Re') - ylabel('Im') - axis equal - grid on - box on - hold off - % surf(X,Y,z) - - - rk4roots() -end - -function fcontour(f,levels,x_lim,y_lim,opt) - default_arg('opt','b') - x = linspace(x_lim(1),x_lim(2)); - y = linspace(y_lim(1),y_lim(2)); - [X,Y] = meshgrid(x,y); - mu = X+ 1i*Y; - - z = f(mu); - - contour(X,Y,z,levels,opt) - -end - - -function rk4roots() - ruku4 = @(z)(abs(1 + z +(1/2)*z.^2 + (1/6)*z.^3 + (1/24)*z.^4)); - % Roots for real evalues: - F = @(x)(abs(ruku4(x))-1); - real_x = fzero(F,-3); - - % Roots for imaginary evalues: - F = @(x)(abs(ruku4(1i*x))-1); - imag_x1 = fzero(F,-3); - imag_x2 = fzero(F,3); - - - fprintf('Real x = %f\n',real_x) - fprintf('Imag x = %f\n',imag_x1) - fprintf('Imag x = %f\n',imag_x2) -end \ No newline at end of file
--- a/+time/+rk4/rungekutta_4.m Tue Jan 08 15:00:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -% Takes one time step of size k using the rungekutta method -% starting from v_0 and where the function F(v,t) gives the -% time derivatives. -function v = rungekutta_4(v, t , k, F) - k1 = F(v ,t ); - k2 = F(v+0.5*k*k1,t+0.5*k); - k3 = F(v+0.5*k*k2,t+0.5*k); - k4 = F(v+ k*k3,t+ k); - v = v + (1/6)*(k1+2*(k2+k3)+k4)*k; -end \ No newline at end of file
--- a/+time/+rk4/rungekutta_6.m Tue Jan 08 15:00:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -% Takes one time step of size k using the rungekutta method -% starting from v_0 and where the function F(v,t) gives the -% time derivatives. -function v = rungekutta_6(v, t , k, F) - s = 7 - k = zeros(length(v),s) - a = zeros(7,6); - c = [0, 4/7, 5/7, 6/7, (5-sqrt(5))/10, (5+sqrt(5))/10, 1]; - b = [1/12, 0, 0, 0, 5/12, 5/12, 1/12]; - a = [ - 0, 0, 0, 0, 0, 0; - 4/7, 0, 0, 0, 0, 0; - 115/112, -5/16, 0, 0, 0, 0; - 589/630, 5/18, -16/45, 0, 0, 0; - 229/1200 - 29/6000*sqrt(5), 119/240 - 187/1200*sqrt(5), -14/75 + 34/375*sqrt(5), -3/100*sqrt(5), 0, 0; - 71/2400 - 587/12000*sqrt(5), 187/480 - 391/2400*sqrt(5), -38/75 + 26/375*sqrt(5), 27/80 - 3/400*sqrt(5), (1+sqrt(5))/4, 0; - -49/480 + 43/160*sqrt(5), -425/96 + 51/32*sqrt(5), 52/15 - 4/5*sqrt(5), -27/16 + 3/16*sqrt(5), 5/4 - 3/4*sqrt(5), 5/2 - 1/2*sqrt(5); - ] - - for i = 1:s - u = v - for j = 1: i-1 - u = u + h*a(i,j) * k(:,j) - end - k(:,i) = F(t+c(i)*k,u) - end - - for i = 1:s - v = v + k*b(i)*k(:,i) - end -end
--- a/+time/Rk4SecondOrderNonlin.m Tue Jan 08 15:00:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -classdef Rk4SecondOrderNonlin < time.Timestepper - properties - F - k - t - w - m - - D - E - S - - n - end - - - methods - function obj = Rk4SecondOrderNonlin(D, E, S, k, t0, v0, v0t) - default_arg('S',0); - default_arg('E',0); - - if isnumeric(S) - S = @(v,t)S; - end - - if isnumeric(E) - E = @(v)E; - end - - obj.k = k; - obj.t = t0; - obj.w = [v0; v0t]; - - m = length(v0); - function wt = F(w,t) - v = w(1:m); - vt = w(m+1:end); - - % Def: w = [v; vt] - wt(1:m,1) = vt; - wt(m+1:2*m,1) = D(v)*v + E(v)*vt + S(v,t); - - end - - obj.F = @F; - obj.D = D; - obj.E = E; - obj.S = S; - obj.m = m; - obj.n = 0; - end - - function [v,t] = getV(obj) - v = obj.w(1:end/2); - t = obj.t; - end - - function [vt,t] = getVt(obj) - vt = obj.w(end/2+1:end); - t = obj.t; - end - - function obj = step(obj) - obj.w = time.rk4.rungekutta_4(obj.w, obj.t, obj.k, obj.F); - obj.t = obj.t + obj.k; - obj.n = obj.n + 1; - end - end - - - methods (Static) - function k = getTimeStep(lambda) - k = rk4.get_rk4_time_step(lambda); - end - end - -end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/+time/Rungekutta.m Wed Jan 09 08:56:42 2019 +0100 @@ -0,0 +1,81 @@ +classdef Rungekutta < time.Timestepper + properties + F % RHS of the ODE + dt % Time step + t % Time point + v % Solution vector + n % Time level + scheme % The scheme used for the time stepping, e.g rk4, rk6 etc. + coeffs % Butcher tableau coefficients + V % All stage approximations in most recent time step + K % All stage rates in most recent time step + end + + + methods + % Timesteps v_t = F(v,t), using the specified RK method from t = t0 with + % timestep dt and initial conditions v = v0 + function obj = Rungekutta(F, dt, t0, v0, method, discreteData) + default_arg('method',"rk4"); + default_arg('discreteData', []); + obj.F = F; + obj.dt = dt; + obj.t = t0; + obj.v = v0; + obj.n = 0; + + % Extract the coefficients for the specified method + % used for the RK updates from the Butcher tableua. + [s,a,b,c] = time.rk.butcherTableauFromStr(method); + obj.coeffs = struct('s',s,'a',a,'b',b,'c',c); + + if isempty(discreteData) + obj.scheme = @(v,t,n) time.rk.rungekutta(v, t, dt, F, obj.coeffs); + else + obj.scheme = @(v,t,n) time.rk.rungekuttaDiscreteData(v, t, dt, F, obj.coeffs, discreteData, n); + end + end + + % v: Current solution + % t: Current time + % V: All stage approximations in most recent time step + % K: All stage rates in most recent time step + % T: Time points (corresponding to V and K) in most recent time step + function [v,t,V,T,K] = getV(obj) + v = obj.v; + t = obj.t; + V = obj.V; + K = obj.K; + T = obj.t + obj.dt*obj.coeffs.b; + end + + function obj = step(obj) + [obj.v, obj.V, obj.K] = obj.scheme(obj.v, obj.t, obj.n); + obj.t = obj.t + obj.dt; + obj.n = obj.n + 1; + end + + % Returns a vector of time points, including substage points, + % in the time interval [t0, tEnd]. + % The time-step obj.dt is assumed to be aligned with [t0, tEnd] already. + function tvec = timePoints(obj, t0, tEnd) + N = round( (tEnd-t0)/obj.dt ); + tvec = zeros(N*obj.s, 1); + s = obj.coeffs.s; + c = obj.coeffs.c; + for i = 1:N + ind = (i-1)*s+1 : i*s; + tvec(ind) = ((i-1) + c')*obj.dt; + end + end + + % Returns a vector of quadrature weights corresponding to grid points + % in time interval [t0, tEnd], substage points included. + % The time-step obj.dt is assumed to be aligned with [t0, tEnd] already. + function weights = quadWeights(obj, t0, tEnd) + N = round( (tEnd-t0)/obj.dt ); + b = obj.coeffs.b; + weights = repmat(b', N, 1); + end + end +end \ No newline at end of file
--- a/+time/Rungekutta4.m Tue Jan 08 15:00:12 2019 +0100 +++ b/+time/Rungekutta4.m Wed Jan 09 08:56:42 2019 +0100 @@ -1,36 +1,23 @@ classdef Rungekutta4 < time.Timestepper properties - D - S F - k + dt t v - m n end methods - function obj = Rungekutta4(D, S, k, t0, v0) - obj.D = D; - obj.k = k; + % Create a time stepper for + % v_t = F(t,v), v(t0) = v0 + % with step size dt. + function obj = Rungekutta4(F, dt, t0, v0) + obj.F = F; + obj.dt = dt; obj.t = t0; obj.v = v0; - obj.m = length(v0); obj.n = 0; - - if S == 0 - obj.S = zeros(obj.m,1); - else - obj.S = S; - end - - if S == 0 - obj.F = @(v,t)(obj.D*v); - else - obj.F = @(v,t)(obj.D*v + obj.S); - end end function [v,t] = getV(obj) @@ -39,17 +26,23 @@ end function obj = step(obj) - obj.v = time.rk4.rungekutta_4(obj.v, obj.t, obj.k, obj.F); - obj.t = obj.t + obj.k; + v = obj.v; + dt = obj.dt; + + k1 = obj.F(t, v); + k2 = obj.F(t + 0.5*dt, v + 0.5*dt*k1); + k3 = obj.F(t + 0.5*dt, v + 0.5*dt*k2); + k4 = obj.F(t + dt, v + dt*k3); + + obj.v = v + dt*(1/6)*(k1+2*(k2+k3)+k4); + obj.t = obj.t + obj.dt; obj.n = obj.n + 1; end end - methods (Static) - function k = getTimeStep(lambda) - k = rk4.get_rk4_time_step(lambda); + function dt = getTimeStep(lambda) + dt = rk4.get_rk4_time_step(lambda); end end - end \ No newline at end of file
--- a/+time/Rungekutta4SecondOrder.m Tue Jan 08 15:00:12 2019 +0100 +++ b/+time/Rungekutta4SecondOrder.m Wed Jan 09 08:56:42 2019 +0100 @@ -1,91 +1,31 @@ classdef Rungekutta4SecondOrder < time.Timestepper properties F - k + dt t + n + + G % RHS for rewritten system w - m - D - E - S - M - C - n end methods - % Solves u_tt = Du + Eu_t + S by - % Rewriting on first order form: - % w_t = M*w + C(t) - % where - % M = [ - % 0, I; - % D, E; - % ] - % and - % C(t) = [ - % 0; - % S(t) - % ] - % D, E, S can either all be constants or all be function handles, - % They can also be omitted by setting them equal to the empty matrix. - function obj = Rungekutta4SecondOrder(D, E, S, k, t0, v0, v0t) - obj.D = D; - obj.E = E; - obj.S = S; - obj.m = length(v0); + % Create a time stepper for + % v_tt = F(t,v,v_t), v(t0) = v0, v_t(t0) = v0t + % with step size dt, by rewriting on first order form + function obj = Rungekutta4SecondOrder(F, dt, t0, v0, v0t) + obj.F = F; + obj.dt = dt; + obj.t = t0; obj.n = 0; - - if isa(D, 'function_handle') || isa(E, 'function_handle') || isa(S, 'function_handle') - default_arg('D', @(t)sparse(obj.m, obj.m)); - default_arg('E', @(t)sparse(obj.m, obj.m)); - default_arg('S', @(t)sparse(obj.m, 1) ); - - if ~isa(D, 'function_handle') - D = @(t)D; - end - if ~isa(E, 'function_handle') - E = @(t)E; - end - if ~isa(S, 'function_handle') - S = @(t)S; - end - - obj.k = k; - obj.t = t0; - obj.w = [v0; v0t]; - - % Avoid matrix formulation because it is VERY slow - obj.F = @(w,t)[ - w(obj.m+1:end); - D(t)*w(1:obj.m) + E(t)*w(obj.m+1:end) + S(t); - ]; - else - - default_arg('D', sparse(obj.m, obj.m)); - default_arg('E', sparse(obj.m, obj.m)); - default_arg('S', sparse(obj.m, 1) ); - - I = speye(obj.m); - O = sparse(obj.m,obj.m); - - obj.M = [ - O, I; - D, E; - ]; - obj.C = [ - zeros(obj.m,1); - S; - ]; - - obj.k = k; - obj.t = t0; - obj.w = [v0; v0t]; - - obj.F = @(w,t)(obj.M*w + obj.C); - end + m = length(v0); + obj.w = [v0; v0t]; + obj.G = @(t, w)[ + w(m+1:end); + F(t,w(1:m), w(m+1:end)); + ]; end function [v,t] = getV(obj) @@ -99,8 +39,17 @@ end function obj = step(obj) - obj.w = time.rk4.rungekutta_4(obj.w, obj.t, obj.k, obj.F); - obj.t = obj.t + obj.k; + % TODO: Avoid extra storage + w = obj.w; + dt = obj.dt; + + k1 = obj.G(t, w); + k2 = obj.G(t + 0.5*dt, w + 0.5*dt*k1); + k3 = obj.G(t + 0.5*dt, w + 0.5*dt*k2); + k4 = obj.G(t + dt, w + dt*k3); + + obj.w = w + dt*(1/6)*(k1+2*(k2+k3)+k4); + obj.t = obj.t + obj.dt; obj.n = obj.n + 1; end end
--- a/+time/Rungekutta4proper.m Tue Jan 08 15:00:12 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -classdef Rungekutta4proper < time.Timestepper - properties - F - k - t - v - m - n - end - - - methods - % Timesteps v_t = F(v,t), using RK4 fromt t = t0 with timestep k and initial conditions v = v0 - function obj = Rungekutta4proper(F, k, t0, v0) - obj.F = F; - obj.k = k; - obj.t = t0; - obj.v = v0; - obj.m = length(v0); - obj.n = 0; - end - - function [v,t] = getV(obj) - v = obj.v; - t = obj.t; - end - - function obj = step(obj) - obj.v = time.rk4.rungekutta_4(obj.v, obj.t, obj.k, obj.F); - obj.t = obj.t + obj.k; - obj.n = obj.n + 1; - end - end - - - methods (Static) - function k = getTimeStep(lambda) - k = rk4.get_rk4_time_step(lambda); - end - end - -end \ No newline at end of file