Skip to content

Commit 1b53abc

Browse files
committed
Added the preset from Sol ODES2
1 parent c1bf87e commit 1b53abc

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
classdef HairerWanner < otp.kuramotosivashinsky.KuramotoSivashinskyProblem
2+
3+
methods
4+
function obj = HairerWanner(varargin)
5+
6+
p = inputParser;
7+
addParameter(p, 'Size', 128);
8+
addParameter(p, 'L', 80*pi);
9+
10+
parse(p, varargin{:});
11+
12+
s = p.Results;
13+
14+
N = s.Size;
15+
L = s.L;
16+
17+
params.L = L;
18+
19+
h = L/N;
20+
21+
% exclude the left boundary point as it is identical to the
22+
% right boundary point
23+
x = linspace(h, L, N).';
24+
25+
eta1 = min(x/L, 0.1 - x/L);
26+
eta2 = 20*(x/L - 0.2).*(0.3 - x/L);
27+
eta3 = min(x/L - 0.6, 0.7 - x/L);
28+
eta4 = min(x/L - 0.9, 1 - x/L);
29+
30+
u0 = 16*max(0, max(eta1, max(eta2, max(eta3, eta4))));
31+
32+
u0hat = fft(u0);
33+
34+
tspan = [0, 150];
35+
36+
obj = [email protected](tspan, u0hat, params);
37+
38+
end
39+
end
40+
end

0 commit comments

Comments
 (0)