Skip to content

Commit dd2f38a

Browse files
committed
Added Jacobian Adjoint (conjugate as well) vector product.
1 parent e2f3c6a commit dd2f38a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/+otp/+kuramotosivashinsky/KuramotoSivashinskyProblem.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +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, k, k2, k4, v), ...
40+
otp.Rhs.FieldNames.JacobianAdjointVectorProduct, ...
41+
@(t, u, v) otp.kuramotosivashinsky.javp(t,u, k, k2, k4, v));
4042

4143
end
4244

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function jv = javp(~, u, k, k2, k4, v)
2+
3+
jv = -k2.*v - k4.*v - fft(real(ifft(u)).*ifft(conj(k).*v));
4+
5+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function jv = jvp(~, u, k, k2, k4, v)
22

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

55
end

0 commit comments

Comments
 (0)