Skip to content

Commit 7e63fe2

Browse files
committed
applied fixes
1 parent 09e0966 commit 7e63fe2

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/+otp/+kuramotosivashinsky/+presets/Canonical.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
h = L/N;
3434

35-
x = h*(1:N).';
35+
% exclude the left boundary point as it is identical to the
36+
% right boundary point
37+
x = linspace(h, L, N).';
3638

3739
u0 = cos(x/16).*(1+sin(x/16));
3840

src/+otp/+kuramotosivashinsky/KuramotoSivashinskyProblem.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ function onSettingsChanged(obj)
3636
otp.Rhs.FieldNames.Jacobian, ...
3737
@(t, u) otp.kuramotosivashinsky.jac(t,u, k, k2, k4), ...
3838
otp.Rhs.FieldNames.JacobianVectorProduct, ...
39-
@(t, u, v) otp.kuramotosivashinsky.jvp(t,u, k, k2, k4, v), ...
39+
@(t, u, v) otp.kuramotosivashinsky.jvp(t, u, v, k, k2, k4), ...
4040
otp.Rhs.FieldNames.JacobianAdjointVectorProduct, ...
41-
@(t, u, v) otp.kuramotosivashinsky.javp(t,u, k, k2, k4, v));
41+
@(t, u, v) otp.kuramotosivashinsky.javp(t, u, v, k, k2, k4));
4242

4343
end
4444

@@ -47,7 +47,9 @@ function validateNewState(obj, newTimeSpan, newY0, newParameters)
4747
validateNewState@otp.Problem(obj, ...
4848
newTimeSpan, newY0, newParameters)
4949

50-
assert(mod(numel(newY0), 2) == 0);
50+
if mod(numel(newY0), 2) ~= 0
51+
error('The problem size has to be an even integer.');
52+
end
5153

5254
otp.utils.StructParser(newParameters) ...
5355
.checkField('L', 'scalar', 'finite', 'positive');

src/+otp/+kuramotosivashinsky/javp.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function jv = javp(~, u, k, k2, k4, v)
1+
function jv = javp(~, u, v, k, k2, k4)
22

33
jv = -k2.*v - k4.*v - fft(real(ifft(u)).*ifft(conj(k).*v));
44

src/+otp/+kuramotosivashinsky/jvp.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function jv = jvp(~, u, k, k2, k4, v)
1+
function jv = jvp(~, u, v, k, k2, k4)
22

33
jv = -k2.*v - k4.*v - k.*fft(real(ifft(u)).*ifft(v));
44

0 commit comments

Comments
 (0)