Skip to content

Commit 500f2a1

Browse files
Update Quadrupole_boson_Hamiltonian_energy_conservation_benchmark.jmd
1 parent b0c2480 commit 500f2a1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

benchmarks/DynamicalODE/Quadrupole_boson_Hamiltonian_energy_conservation_benchmark.jmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ function hamilton(z, params, t)
6262
end
6363

6464
function custom_manifold_jacobian(u, params)
65-
p0, p2, q0, q2 = u
65+
p1, p2 = u[1], u[2]
66+
q1, q2 = u[3], u[4]
6667

68+
# Define Jacobian matrix based on the current state vector components
6769
J = zeros(4, 4)
68-
69-
J[1, 1] = A * p0
70-
J[2, 2] = A * p2
71-
72-
J[3, 3] = A * q0 - sqrt(2) * B * (3 * q2^2 - q0^2) + D * q0 * (q0^2 + q2^2) # ∂H/∂q0
73-
J[4, 4] = A * q2 + 6 * B * q0 * q2 + D * q2 * (q0^2 + q2^2) # ∂H/∂q2
70+
J[1, 1] = A
71+
J[2, 2] = A
72+
J[3, 3] = -A - 3 * sqrt(2) * B * q2^2 + D * q1 * (q1^2 + q2^2)
73+
J[4, 4] = -A - 3 * sqrt(2) * B * q1^2 + D * q2 * (q1^2 + q2^2)
7474

7575
return J
7676
end
@@ -205,4 +205,4 @@ In comparison with the Henon-Heiles case, we see that the symplectic methods are
205205
```julia, echo = false
206206
using SciMLBenchmarks
207207
SciMLBenchmarks.bench_footer(WEAVE_ARGS[:folder],WEAVE_ARGS[:file])
208-
```
208+
```

0 commit comments

Comments
 (0)