From d6ec431cd1ee59aaf29800d447a7e9fd9dc88702 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Mon, 19 May 2025 22:04:59 +0530 Subject: [PATCH 01/15] benchmark added --- benchmarks/Jumps/Project.toml | 3 + benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 312 +++++++++++++++++++ 2 files changed, 315 insertions(+) create mode 100644 benchmarks/Jumps/VR_Aggregator_Benchmark.jmd diff --git a/benchmarks/Jumps/Project.toml b/benchmarks/Jumps/Project.toml index 02c774794..f77dc8d2d 100644 --- a/benchmarks/Jumps/Project.toml +++ b/benchmarks/Jumps/Project.toml @@ -3,12 +3,14 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" JumpProblemLibrary = "faf0f6d7-8cee-47cb-b27c-1eb80cef534e" JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" PiecewiseDeterministicMarkovProcesses = "86206cdf-4603-54e0-bd58-22a2dcbf57aa" @@ -20,6 +22,7 @@ SciMLBenchmarks = "31c91b34-3c75-11e9-0341-95557aab0344" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" +StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" [compat] diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd new file mode 100644 index 000000000..dd3dfa0a9 --- /dev/null +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -0,0 +1,312 @@ +--- +title: Benchmarking Variable Rate Aggregator +author: Siva Sathyaseelan D N, Chris Rackauckas, Samuel Isaacson +weave_options: + fig_ext : ".png" +--- + +```julia +using DiffEqBase, JumpProcesses, OrdinaryDiffEq, StochasticDiffEq +using Random, LinearSolve, StableRNGs, BenchmarkTools, Plots, LinearAlgebra +fmt = :png +width_px, height_px = default(:size) +rng = StableRNG(12345) +``` + +# Introduction + +This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. The benchmark compares `VRDirectCB` and `VRFRMODE` aggregators, while the visualization shows state variables vs. time to verify simulation behavior. + +**Note**: If you encounter a precompilation error due to method overwriting in `JumpProcesses.jl`, add `__precompile__(false)` to `/home/siva/Desktop/julia/JumpProcesses.jl/src/JumpProcesses.jl` and clear the compilation cache (`rm -rf ~/.julia/compiled`). + +The test cases are: +1. **Scalar ODE with Variable Rate Jumps**: Solved with `Tsit5` and `Rosenbrock23` (with/without autodiff). +2. **Scalar SDE with Variable Rate Jumps**: Solved with `SRIW1`. +3. **SDE with Parameter-Switching Jump**: Solved with `SRA1`. +4. **ODE with Constant Rate Jump**: Solved with `Tsit5`. +5. **ODE with Variable Rate Jumps (Alternative Rate)**: Solved with `Tsit5`. +6. **SDE with Variable Rate Jumps (Alternative Rate)**: Solved with `SRIW1`. +7. **Matrix ODE with Variable Rate Jump**: Solved with `Tsit5`. +8. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. + +For visualization, we solve one trajectory per test case with 2 jumps (2x2 matrix for Test 7). For benchmarking, we vary jumps from 1 to 20 (2x2 to 10x10 for Test 7), running 100 trajectories per configuration. + +# Benchmark and Visualization Setup + +We define factories for each test case to create problems with a variable number of jumps (or matrix size for Test 7). + +```julia +algorithms = Tuple{Any, Any, String, String}[ + (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 1 Tsit5 (VRDirectCB)"), + (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 1 Tsit5 (VRFRMODE)"), + (VRDirectCB(), Rosenbrock23(autodiff=false), "VRDirectCB", "Test 1 Rosenbrock23 (no autodiff, VRDirectCB)"), + (VRFRMODE(), Rosenbrock23(autodiff=false), "VRFRMODE", "Test 1 Rosenbrock23 (no autodiff, VRFRMODE)"), + (VRDirectCB(), Rosenbrock23(), "VRDirectCB", "Test 1 Rosenbrock23 (autodiff, VRDirectCB)"), + (VRFRMODE(), Rosenbrock23(), "VRFRMODE", "Test 1 Rosenbrock23 (autodiff, VRFRMODE)"), + (VRDirectCB(), SRIW1(), "VRDirectCB", "Test 2 SRIW1 (VRDirectCB)"), + (VRFRMODE(), SRIW1(), "VRFRMODE", "Test 2 SRIW1 (VRFRMODE)"), + (VRDirectCB(), SRA1(), "VRDirectCB", "Test 3 SRA1 (VRDirectCB)"), + (VRFRMODE(), SRA1(), "VRFRMODE", "Test 3 SRA1 (VRFRMODE)"), + (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 4 Tsit5 (VRDirectCB, ConstantRateJump)"), + (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 4 Tsit5 (VRFRMODE, ConstantRateJump)"), + (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 5 Tsit5 (VRDirectCB)"), + (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 5 Tsit5 (VRFRMODE)"), + (VRDirectCB(), SRIW1(), "VRDirectCB", "Test 6 SRIW1 (VRDirectCB)"), + (VRFRMODE(), SRIW1(), "VRFRMODE", "Test 6 SRIW1 (VRFRMODE)"), + (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 7 Tsit5 (VRDirectCB)"), + (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 7 Tsit5 (VRFRMODE)"), + (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 8 Tsit5 (VRDirectCB)"), + (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 8 Tsit5 (VRFRMODE)"), +] + +function create_test1_problem(num_jumps, vr_aggregator, solver) + f = (du, u, p, t) -> (du[1] = u[1]) + prob = ODEProblem(f, [0.2], (0.0, 10.0)) + jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test2_problem(num_jumps, vr_aggregator, solver) + f = (du, u, p, t) -> (du[1] = u[1]) + g = (du, u, p, t) -> (du[1] = u[1]) + prob = SDEProblem(f, g, [0.2], (0.0, 10.0)) + jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test3_problem(num_jumps, vr_aggregator, solver) + ff = (du, u, p, t) -> (du .= p == 0 ? 1.01u : 2.01u) + gg = (du, u, p, t) -> begin + du[1, 1] = 0.3u[1]; du[1, 2] = 0.6u[1] + du[2, 1] = 1.2u[1]; du[2, 2] = 0.2u[2] + end + prob = SDEProblem(ff, gg, ones(2), (0.0, 1.0), 0, noise_rate_prototype=zeros(2, 2)) + jumps = [VariableRateJump((u, p, t) -> u[1] * 1.0, (integrator) -> (integrator.p = 1)) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test4_problem(num_jumps, vr_aggregator, solver) + f2 = (du, u, p, t) -> (du[1] = u[1]) + prob = ODEProblem(f2, [0.2], (0.0, 10.0)) + jumps = [ConstantRateJump((u, p, t) -> 2, (integrator) -> (integrator.u[1] = integrator.u[1] / 2)) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test5_problem(num_jumps, vr_aggregator, solver) + f2 = (du, u, p, t) -> (du[1] = u[1]) + prob = ODEProblem(f2, [0.2], (0.0, 10.0)) + jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test6_problem(num_jumps, vr_aggregator, solver) + f2 = (du, u, p, t) -> (du[1] = u[1]) + g2 = (du, u, p, t) -> (du[1] = u[1]) + prob = SDEProblem(f2, g2, [0.2], (0.0, 10.0)) + jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test7_problem(num_jumps, vr_aggregator, solver, matrix_size=2) + f3 = (du, u, p, t) -> (du .= u) + u0 = ones(matrix_size, matrix_size) + prob = ODEProblem(f3, u0, (0.0, 1.0)) + rate3 = (u, p, t) -> sum(u[1, :]) + affect3! = (integrator) -> (integrator.u .= range(0.25, 1.0, length=matrix_size^2)) + jumps = [VariableRateJump(rate3, affect3!) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end + +function create_test8_problem(num_jumps, vr_aggregator, solver) + f4 = (dx, x, p, t) -> (dx[1] = x[1]) + rate4 = (x, p, t) -> t + affect4! = (integrator) -> (integrator.u[1] = integrator.u[1] * 0.5) + prob = ODEProblem(f4, [1.0 + 0.0im], (0.0, 6.0)) + jumps = [VariableRateJump(rate4, affect4!) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(prob) + return ensemble_prob, jump_prob +end +``` + +# Solution Visualization + +We solve one trajectory for each test case with 2 jumps (2x2 matrix for Test 7) using `VRDirectCB` and plot the state variables vs. time. + +```julia +let figs = [] + for test_num in 1:8 + # Select a representative solver for each test + algo, stepper = if test_num == 1 + VRDirectCB(), Tsit5() + elseif test_num == 2 || test_num == 6 + VRDirectCB(), SRIW1() + elseif test_num == 3 + VRDirectCB(), SRA1() + elseif test_num in [4, 5, 7, 8] + VRDirectCB(), Tsit5() + end + label = "Test $test_num" + + # Create problem with 2 jumps (or 2x2 matrix) + ensemble_prob, jump_prob = if test_num == 1 + create_test1_problem(2, algo, stepper) + elseif test_num == 2 + create_test2_problem(2, algo, stepper) + elseif test_num == 3 + create_test3_problem(2, algo, stepper) + elseif test_num == 4 + create_test4_problem(2, algo, stepper) + elseif test_num == 5 + create_test5_problem(2, algo, stepper) + elseif test_num == 6 + create_test6_problem(2, algo, stepper) + elseif test_num == 7 + create_test7_problem(2, algo, stepper, 2) + elseif test_num == 8 + create_test8_problem(2, algo, stepper) + end + + # Solve one trajectory + solver_kwargs = test_num == 3 ? (dt=1.0,) : () + try + sol = solve(jump_prob, stepper; saveat=0.01, solver_kwargs...) + + # Plot solution + fig = plot(title="Test $test_num: Solution Trajectory", xlabel="Time", ylabel="State") + if test_num == 7 + # For matrix ODE, plot sum of elements + plot!(sol.t, [sum(sol.u[i]) for i in 1:length(sol.u)], label="Sum of Matrix Elements") + elseif test_num == 8 + # For complex ODE, plot real part + plot!(sol.t, real.(sol[1,:]), label="Real Part") + elseif test_num == 3 + # For 2D SDE, plot both components + plot!(sol.t, sol[1,:], label="u[1]") + plot!(sol.t, sol[2,:], label="u[2]") + else + # For scalar problems, plot state + plot!(sol.t, sol[1,:], label="u[1]") + end + push!(figs, fig) + catch e + @warn "Failed to solve Test $test_num: $(sprint(showerror, e))" + end + end + plot(figs..., layout=(4, 2), format=fmt, size=(width_px, 4*height_px/2)) +end +``` + +# Benchmark Execution + +We benchmark each test case for 1 to 20 jumps (2x2 to 10x10 for Test 7), running 100 trajectories. Errors are logged to diagnose failures. + +```julia +num_jumps_range = append!([1], 5:5:20) +matrix_sizes = [2, 4, 6, 8, 10] +bs = Vector{Vector{BenchmarkTools.Trial}}() +errors = Dict{String, Vector{String}}() + +for (algo, stepper, agg_name, label) in algorithms + @info label + push!(bs, Vector{BenchmarkTools.Trial}()) + errors[label] = String[] + _bs = bs[end] + test_num = parse(Int, match(r"Test (\d+)", label).captures[1]) + is_matrix_test = test_num == 7 + range_var = is_matrix_test ? matrix_sizes : num_jumps_range + for (i, var) in enumerate(range_var) + if test_num == 1 + ensemble_prob, jump_prob = create_test1_problem(is_matrix_test ? 2 : var, algo, stepper) + elseif test_num == 2 + ensemble_prob, jump_prob = create_test2_problem(is_matrix_test ? 2 : var, algo, stepper) + elseif test_num == 3 + ensemble_prob, jump_prob = create_test3_problem(is_matrix_test ? 2 : var, algo, stepper) + elseif test_num == 4 + ensemble_prob, jump_prob = create_test4_problem(is_matrix_test ? 2 : var, algo, stepper) + elseif test_num == 5 + ensemble_prob, jump_prob = create_test5_problem(is_matrix_test ? 2 : var, algo, stepper) + elseif test_num == 6 + ensemble_prob, jump_prob = create_test6_problem(is_matrix_test ? 2 : var, algo, stepper) + elseif test_num == 7 + ensemble_prob, jump_prob = create_test7_problem(2, algo, stepper, var) + elseif test_num == 8 + ensemble_prob, jump_prob = create_test8_problem(is_matrix_test ? 2 : var, algo, stepper) + end + solver_kwargs = test_num == 3 ? (dt=1.0,) : "" + trial = try + @benchmark solve($ensemble_prob, $stepper, EnsembleSerial(), trajectories=100, jump_prob=$jump_prob; $solver_kwargs...) samples=50 evals=1 seconds=10 + catch e + push!(errors[label], "Error at $(is_matrix_test ? "Matrix Size" : "Num Jumps") = $var: $(sprint(showerror, e))") + BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=50, evals=1, seconds=10)) + end + push!(_bs, trial) + if (var == 1 || var % (is_matrix_test ? 2 : 5) == 0) + median_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(median(trial.times)))" : "nan" + println("algo=$label, $(is_matrix_test ? "Matrix Size" : "Num Jumps") = $var, length = $(length(trial.times)), median time = $median_time") + end + end +end + +# Log errors +for (label, err_list) in errors + if !isempty(err_list) + @warn "Errors for $label:" + for err in err_list + println(err) + end + end +end +``` + +# Benchmark Results + +We plot the median execution times for each test case, comparing `VRDirectCB` and `VRFRMODE`. + +```julia +let figs = [] + for test_num in 1:8 + test_algorithms = filter(a -> parse(Int, match(r"Test (\d+)", a[4]).captures[1]) == test_num, algorithms) + is_matrix_test = test_num == 7 + range_var = is_matrix_test ? matrix_sizes : num_jumps_range + fig = plot( + yscale=:log10, + xlabel=is_matrix_test ? "Matrix Size" : "Number of Jumps", + ylabel="Time (ns)", + legend_position=:outertopright, + title="Test $test_num: Simulations, 50 samples" + ) + for (i, (algo, stepper, agg_name, label)) in enumerate(test_algorithms) + algo_idx = findfirst(a -> a[4] == label, algorithms) + _bs, _vars = [], [] + for (j, b) in enumerate(bs[algo_idx]) + if length(b) == 50 + push!(_bs, median(b.times)) + push!(_vars, range_var[j]) + end + end + if !isempty(_bs) + plot!(_vars, _bs, label=label) + else + @warn "No valid data for $label in Test $test_num" + end + end + push!(figs, fig) + end + plot(figs..., layout=(4, 2), format=fmt, size=(width_px, 4*height_px/2)) +end +``` \ No newline at end of file From 69a7a5fbd4455126f542f004af9bc2938ec0cf58 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Fri, 6 Jun 2025 00:54:37 +0530 Subject: [PATCH 02/15] changed method name --- benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 54 ++++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd index dd3dfa0a9..f5625b38a 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -15,7 +15,7 @@ rng = StableRNG(12345) # Introduction -This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. The benchmark compares `VRDirectCB` and `VRFRMODE` aggregators, while the visualization shows state variables vs. time to verify simulation behavior. +This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. The benchmark compares `VR_Direct` and `VR_FRM` aggregators, while the visualization shows state variables vs. time to verify simulation behavior. **Note**: If you encounter a precompilation error due to method overwriting in `JumpProcesses.jl`, add `__precompile__(false)` to `/home/siva/Desktop/julia/JumpProcesses.jl/src/JumpProcesses.jl` and clear the compilation cache (`rm -rf ~/.julia/compiled`). @@ -37,26 +37,26 @@ We define factories for each test case to create problems with a variable number ```julia algorithms = Tuple{Any, Any, String, String}[ - (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 1 Tsit5 (VRDirectCB)"), - (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 1 Tsit5 (VRFRMODE)"), - (VRDirectCB(), Rosenbrock23(autodiff=false), "VRDirectCB", "Test 1 Rosenbrock23 (no autodiff, VRDirectCB)"), - (VRFRMODE(), Rosenbrock23(autodiff=false), "VRFRMODE", "Test 1 Rosenbrock23 (no autodiff, VRFRMODE)"), - (VRDirectCB(), Rosenbrock23(), "VRDirectCB", "Test 1 Rosenbrock23 (autodiff, VRDirectCB)"), - (VRFRMODE(), Rosenbrock23(), "VRFRMODE", "Test 1 Rosenbrock23 (autodiff, VRFRMODE)"), - (VRDirectCB(), SRIW1(), "VRDirectCB", "Test 2 SRIW1 (VRDirectCB)"), - (VRFRMODE(), SRIW1(), "VRFRMODE", "Test 2 SRIW1 (VRFRMODE)"), - (VRDirectCB(), SRA1(), "VRDirectCB", "Test 3 SRA1 (VRDirectCB)"), - (VRFRMODE(), SRA1(), "VRFRMODE", "Test 3 SRA1 (VRFRMODE)"), - (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 4 Tsit5 (VRDirectCB, ConstantRateJump)"), - (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 4 Tsit5 (VRFRMODE, ConstantRateJump)"), - (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 5 Tsit5 (VRDirectCB)"), - (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 5 Tsit5 (VRFRMODE)"), - (VRDirectCB(), SRIW1(), "VRDirectCB", "Test 6 SRIW1 (VRDirectCB)"), - (VRFRMODE(), SRIW1(), "VRFRMODE", "Test 6 SRIW1 (VRFRMODE)"), - (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 7 Tsit5 (VRDirectCB)"), - (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 7 Tsit5 (VRFRMODE)"), - (VRDirectCB(), Tsit5(), "VRDirectCB", "Test 8 Tsit5 (VRDirectCB)"), - (VRFRMODE(), Tsit5(), "VRFRMODE", "Test 8 Tsit5 (VRFRMODE)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 1 Tsit5 (VR_Direct)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 1 Tsit5 (VR_FRM)"), + (VR_Direct(), Rosenbrock23(autodiff=false), "VR_Direct", "Test 1 Rosenbrock23 (no autodiff, VR_Direct)"), + (VR_FRM(), Rosenbrock23(autodiff=false), "VR_FRM", "Test 1 Rosenbrock23 (no autodiff, VR_FRM)"), + (VR_Direct(), Rosenbrock23(), "VR_Direct", "Test 1 Rosenbrock23 (autodiff, VR_Direct)"), + (VR_FRM(), Rosenbrock23(), "VR_FRM", "Test 1 Rosenbrock23 (autodiff, VR_FRM)"), + (VR_Direct(), SRIW1(), "VR_Direct", "Test 2 SRIW1 (VR_Direct)"), + (VR_FRM(), SRIW1(), "VR_FRM", "Test 2 SRIW1 (VR_FRM)"), + (VR_Direct(), SRA1(), "VR_Direct", "Test 3 SRA1 (VR_Direct)"), + (VR_FRM(), SRA1(), "VR_FRM", "Test 3 SRA1 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 4 Tsit5 (VR_Direct, ConstantRateJump)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 4 Tsit5 (VR_FRM, ConstantRateJump)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 5 Tsit5 (VR_Direct)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 5 Tsit5 (VR_FRM)"), + (VR_Direct(), SRIW1(), "VR_Direct", "Test 6 SRIW1 (VR_Direct)"), + (VR_FRM(), SRIW1(), "VR_FRM", "Test 6 SRIW1 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 7 Tsit5 (VR_Direct)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 7 Tsit5 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 8 Tsit5 (VR_Direct)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 8 Tsit5 (VR_FRM)"), ] function create_test1_problem(num_jumps, vr_aggregator, solver) @@ -145,20 +145,20 @@ end # Solution Visualization -We solve one trajectory for each test case with 2 jumps (2x2 matrix for Test 7) using `VRDirectCB` and plot the state variables vs. time. +We solve one trajectory for each test case with 2 jumps (2x2 matrix for Test 7) using `VR_Direct` and plot the state variables vs. time. ```julia let figs = [] for test_num in 1:8 # Select a representative solver for each test algo, stepper = if test_num == 1 - VRDirectCB(), Tsit5() + VR_Direct(), Tsit5() elseif test_num == 2 || test_num == 6 - VRDirectCB(), SRIW1() + VR_Direct(), SRIW1() elseif test_num == 3 - VRDirectCB(), SRA1() + VR_Direct(), SRA1() elseif test_num in [4, 5, 7, 8] - VRDirectCB(), Tsit5() + VR_Direct(), Tsit5() end label = "Test $test_num" @@ -275,7 +275,7 @@ end # Benchmark Results -We plot the median execution times for each test case, comparing `VRDirectCB` and `VRFRMODE`. +We plot the median execution times for each test case, comparing `VR_Direct` and `VR_FRM`. ```julia let figs = [] From 3750a8ad0e45227df22d4e9b68a681c994f4f070 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Fri, 6 Jun 2025 17:18:49 +0530 Subject: [PATCH 03/15] some changes --- benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 131 ++++++------------- 1 file changed, 41 insertions(+), 90 deletions(-) diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd index f5625b38a..452671b7e 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -29,11 +29,11 @@ The test cases are: 7. **Matrix ODE with Variable Rate Jump**: Solved with `Tsit5`. 8. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. -For visualization, we solve one trajectory per test case with 2 jumps (2x2 matrix for Test 7). For benchmarking, we vary jumps from 1 to 20 (2x2 to 10x10 for Test 7), running 100 trajectories per configuration. +For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, we vary jumps from 1 to 20, running 100 trajectories per configuration. # Benchmark and Visualization Setup -We define factories for each test case to create problems with a variable number of jumps (or matrix size for Test 7). +We define factories for each test case to create problems with a variable number of jumps. ```julia algorithms = Tuple{Any, Any, String, String}[ @@ -45,18 +45,14 @@ algorithms = Tuple{Any, Any, String, String}[ (VR_FRM(), Rosenbrock23(), "VR_FRM", "Test 1 Rosenbrock23 (autodiff, VR_FRM)"), (VR_Direct(), SRIW1(), "VR_Direct", "Test 2 SRIW1 (VR_Direct)"), (VR_FRM(), SRIW1(), "VR_FRM", "Test 2 SRIW1 (VR_FRM)"), - (VR_Direct(), SRA1(), "VR_Direct", "Test 3 SRA1 (VR_Direct)"), - (VR_FRM(), SRA1(), "VR_FRM", "Test 3 SRA1 (VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 4 Tsit5 (VR_Direct, ConstantRateJump)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 4 Tsit5 (VR_FRM, ConstantRateJump)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 5 Tsit5 (VR_Direct)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 5 Tsit5 (VR_FRM)"), - (VR_Direct(), SRIW1(), "VR_Direct", "Test 6 SRIW1 (VR_Direct)"), - (VR_FRM(), SRIW1(), "VR_FRM", "Test 6 SRIW1 (VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 7 Tsit5 (VR_Direct)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 7 Tsit5 (VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 8 Tsit5 (VR_Direct)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 8 Tsit5 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 3 Tsit5 (VR_Direct, ConstantRateJump)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 3 Tsit5 (VR_FRM, ConstantRateJump)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 4 Tsit5 (VR_Direct)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 4 Tsit5 (VR_FRM)"), + (VR_Direct(), SRIW1(), "VR_Direct", "Test 5 SRIW1 (VR_Direct)"), + (VR_FRM(), SRIW1(), "VR_FRM", "Test 5 SRIW1 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 6 Tsit5 (VR_Direct)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 6 Tsit5 (VR_FRM)"), ] function create_test1_problem(num_jumps, vr_aggregator, solver) @@ -79,19 +75,6 @@ function create_test2_problem(num_jumps, vr_aggregator, solver) end function create_test3_problem(num_jumps, vr_aggregator, solver) - ff = (du, u, p, t) -> (du .= p == 0 ? 1.01u : 2.01u) - gg = (du, u, p, t) -> begin - du[1, 1] = 0.3u[1]; du[1, 2] = 0.6u[1] - du[2, 1] = 1.2u[1]; du[2, 2] = 0.2u[2] - end - prob = SDEProblem(ff, gg, ones(2), (0.0, 1.0), 0, noise_rate_prototype=zeros(2, 2)) - jumps = [VariableRateJump((u, p, t) -> u[1] * 1.0, (integrator) -> (integrator.p = 1)) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) - return ensemble_prob, jump_prob -end - -function create_test4_problem(num_jumps, vr_aggregator, solver) f2 = (du, u, p, t) -> (du[1] = u[1]) prob = ODEProblem(f2, [0.2], (0.0, 10.0)) jumps = [ConstantRateJump((u, p, t) -> 2, (integrator) -> (integrator.u[1] = integrator.u[1] / 2)) for _ in 1:num_jumps] @@ -100,7 +83,7 @@ function create_test4_problem(num_jumps, vr_aggregator, solver) return ensemble_prob, jump_prob end -function create_test5_problem(num_jumps, vr_aggregator, solver) +function create_test4_problem(num_jumps, vr_aggregator, solver) f2 = (du, u, p, t) -> (du[1] = u[1]) prob = ODEProblem(f2, [0.2], (0.0, 10.0)) jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] @@ -109,7 +92,7 @@ function create_test5_problem(num_jumps, vr_aggregator, solver) return ensemble_prob, jump_prob end -function create_test6_problem(num_jumps, vr_aggregator, solver) +function create_test5_problem(num_jumps, vr_aggregator, solver) f2 = (du, u, p, t) -> (du[1] = u[1]) g2 = (du, u, p, t) -> (du[1] = u[1]) prob = SDEProblem(f2, g2, [0.2], (0.0, 10.0)) @@ -119,19 +102,7 @@ function create_test6_problem(num_jumps, vr_aggregator, solver) return ensemble_prob, jump_prob end -function create_test7_problem(num_jumps, vr_aggregator, solver, matrix_size=2) - f3 = (du, u, p, t) -> (du .= u) - u0 = ones(matrix_size, matrix_size) - prob = ODEProblem(f3, u0, (0.0, 1.0)) - rate3 = (u, p, t) -> sum(u[1, :]) - affect3! = (integrator) -> (integrator.u .= range(0.25, 1.0, length=matrix_size^2)) - jumps = [VariableRateJump(rate3, affect3!) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) - return ensemble_prob, jump_prob -end - -function create_test8_problem(num_jumps, vr_aggregator, solver) +function create_test6_problem(num_jumps, vr_aggregator, solver) f4 = (dx, x, p, t) -> (dx[1] = x[1]) rate4 = (x, p, t) -> t affect4! = (integrator) -> (integrator.u[1] = integrator.u[1] * 0.5) @@ -145,19 +116,15 @@ end # Solution Visualization -We solve one trajectory for each test case with 2 jumps (2x2 matrix for Test 7) using `VR_Direct` and plot the state variables vs. time. +We solve one trajectory for each test case with 2 jumps using `VR_Direct` and plot the state variables vs. time. ```julia let figs = [] - for test_num in 1:8 + for test_num in 1:6 # Select a representative solver for each test - algo, stepper = if test_num == 1 - VR_Direct(), Tsit5() - elseif test_num == 2 || test_num == 6 + algo, stepper = if test_num == 2 || test_num == 5 VR_Direct(), SRIW1() - elseif test_num == 3 - VR_Direct(), SRA1() - elseif test_num in [4, 5, 7, 8] + else VR_Direct(), Tsit5() end label = "Test $test_num" @@ -175,29 +142,16 @@ let figs = [] create_test5_problem(2, algo, stepper) elseif test_num == 6 create_test6_problem(2, algo, stepper) - elseif test_num == 7 - create_test7_problem(2, algo, stepper, 2) - elseif test_num == 8 - create_test8_problem(2, algo, stepper) end - - # Solve one trajectory - solver_kwargs = test_num == 3 ? (dt=1.0,) : () - try - sol = solve(jump_prob, stepper; saveat=0.01, solver_kwargs...) + try + sol = solve(jump_prob, stepper; saveat=0.01) + # Plot solution fig = plot(title="Test $test_num: Solution Trajectory", xlabel="Time", ylabel="State") - if test_num == 7 - # For matrix ODE, plot sum of elements - plot!(sol.t, [sum(sol.u[i]) for i in 1:length(sol.u)], label="Sum of Matrix Elements") - elseif test_num == 8 + if test_num == 6 # For complex ODE, plot real part plot!(sol.t, real.(sol[1,:]), label="Real Part") - elseif test_num == 3 - # For 2D SDE, plot both components - plot!(sol.t, sol[1,:], label="u[1]") - plot!(sol.t, sol[2,:], label="u[2]") else # For scalar problems, plot state plot!(sol.t, sol[1,:], label="u[1]") @@ -213,11 +167,10 @@ end # Benchmark Execution -We benchmark each test case for 1 to 20 jumps (2x2 to 10x10 for Test 7), running 100 trajectories. Errors are logged to diagnose failures. +We benchmark each test case for 1 to 20 jumps, running 100 trajectories. Errors are logged to diagnose failures. ```julia num_jumps_range = append!([1], 5:5:20) -matrix_sizes = [2, 4, 6, 8, 10] bs = Vector{Vector{BenchmarkTools.Trial}}() errors = Dict{String, Vector{String}}() @@ -227,38 +180,36 @@ for (algo, stepper, agg_name, label) in algorithms errors[label] = String[] _bs = bs[end] test_num = parse(Int, match(r"Test (\d+)", label).captures[1]) - is_matrix_test = test_num == 7 - range_var = is_matrix_test ? matrix_sizes : num_jumps_range + range_var = num_jumps_range for (i, var) in enumerate(range_var) if test_num == 1 - ensemble_prob, jump_prob = create_test1_problem(is_matrix_test ? 2 : var, algo, stepper) + ensemble_prob, jump_prob = create_test1_problem(var, algo, stepper) elseif test_num == 2 - ensemble_prob, jump_prob = create_test2_problem(is_matrix_test ? 2 : var, algo, stepper) + ensemble_prob, jump_prob = create_test2_problem(var, algo, stepper) elseif test_num == 3 - ensemble_prob, jump_prob = create_test3_problem(is_matrix_test ? 2 : var, algo, stepper) + ensemble_prob, jump_prob = create_test3_problem(var, algo, stepper) elseif test_num == 4 - ensemble_prob, jump_prob = create_test4_problem(is_matrix_test ? 2 : var, algo, stepper) + ensemble_prob, jump_prob = create_test4_problem(var, algo, stepper) elseif test_num == 5 - ensemble_prob, jump_prob = create_test5_problem(is_matrix_test ? 2 : var, algo, stepper) + ensemble_prob, jump_prob = create_test5_problem(var, algo, stepper) elseif test_num == 6 - ensemble_prob, jump_prob = create_test6_problem(is_matrix_test ? 2 : var, algo, stepper) - elseif test_num == 7 - ensemble_prob, jump_prob = create_test7_problem(2, algo, stepper, var) - elseif test_num == 8 - ensemble_prob, jump_prob = create_test8_problem(is_matrix_test ? 2 : var, algo, stepper) + ensemble_prob, jump_prob = create_test6_problem(var, algo, stepper) end - solver_kwargs = test_num == 3 ? (dt=1.0,) : "" trial = try - @benchmark solve($ensemble_prob, $stepper, EnsembleSerial(), trajectories=100, jump_prob=$jump_prob; $solver_kwargs...) samples=50 evals=1 seconds=10 + @benchmark( + solve($jump_prob, $stepper), + samples=50, + evals=1, + seconds=10 + ) catch e - push!(errors[label], "Error at $(is_matrix_test ? "Matrix Size" : "Num Jumps") = $var: $(sprint(showerror, e))") + push!(errors[label], "Error at Num Jumps = $var: $(sprint(showerror, e))") BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=50, evals=1, seconds=10)) end push!(_bs, trial) - if (var == 1 || var % (is_matrix_test ? 2 : 5) == 0) - median_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(median(trial.times)))" : "nan" - println("algo=$label, $(is_matrix_test ? "Matrix Size" : "Num Jumps") = $var, length = $(length(trial.times)), median time = $median_time") - end + + median_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(median(trial.times)))" : "nan" + println("algo=$label, Num Jumps = $var, length = $(length(trial.times)), median time = $median_time") end end @@ -279,7 +230,7 @@ We plot the median execution times for each test case, comparing `VR_Direct` and ```julia let figs = [] - for test_num in 1:8 + for test_num in 1:6 test_algorithms = filter(a -> parse(Int, match(r"Test (\d+)", a[4]).captures[1]) == test_num, algorithms) is_matrix_test = test_num == 7 range_var = is_matrix_test ? matrix_sizes : num_jumps_range @@ -307,6 +258,6 @@ let figs = [] end push!(figs, fig) end - plot(figs..., layout=(4, 2), format=fmt, size=(width_px, 4*height_px/2)) + plot(figs..., layout=(6, 1), format=fmt, size=(width_px, 8*height_px/2)) end ``` \ No newline at end of file From 20b7582404dfda1f836413edfdcc7b0235ca0b55 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Fri, 6 Jun 2025 17:36:07 +0530 Subject: [PATCH 04/15] some changes --- benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd index 452671b7e..a350833b8 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -15,21 +15,21 @@ rng = StableRNG(12345) # Introduction -This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. The benchmark compares `VR_Direct` and `VR_FRM` aggregators, while the visualization shows state variables vs. time to verify simulation behavior. - -**Note**: If you encounter a precompilation error due to method overwriting in `JumpProcesses.jl`, add `__precompile__(false)` to `/home/siva/Desktop/julia/JumpProcesses.jl/src/JumpProcesses.jl` and clear the compilation cache (`rm -rf ~/.julia/compiled`). +This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and +visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. +The benchmark compares `VR_Direct` and `VR_FRM` aggregators, while the visualization shows +state variables vs. time to verify simulation behavior. The test cases are: 1. **Scalar ODE with Variable Rate Jumps**: Solved with `Tsit5` and `Rosenbrock23` (with/without autodiff). 2. **Scalar SDE with Variable Rate Jumps**: Solved with `SRIW1`. -3. **SDE with Parameter-Switching Jump**: Solved with `SRA1`. -4. **ODE with Constant Rate Jump**: Solved with `Tsit5`. -5. **ODE with Variable Rate Jumps (Alternative Rate)**: Solved with `Tsit5`. -6. **SDE with Variable Rate Jumps (Alternative Rate)**: Solved with `SRIW1`. -7. **Matrix ODE with Variable Rate Jump**: Solved with `Tsit5`. -8. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. +3. **ODE with Constant Rate Jump**: Solved with `Tsit5`. +4. **ODE with Variable Rate Jumps (Alternative Rate)**: Solved with `Tsit5`. +5. **SDE with Variable Rate Jumps (Alternative Rate)**: Solved with `SRIW1`. +6. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. -For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, we vary jumps from 1 to 20, running 100 trajectories per configuration. +For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, +we vary jumps from 1 to 20, running 100 trajectories per configuration. # Benchmark and Visualization Setup From 7ae71a893d0e51bedc2cfacffcd85007e3399bee Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Fri, 6 Jun 2025 19:31:56 +0530 Subject: [PATCH 05/15] some change --- benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd index a350833b8..407b8f438 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -146,7 +146,6 @@ let figs = [] try sol = solve(jump_prob, stepper; saveat=0.01) - # Plot solution fig = plot(title="Test $test_num: Solution Trajectory", xlabel="Time", ylabel="State") if test_num == 6 From ac49bb9a759b7cf11ee2bba7b3a6955efe32e947 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Fri, 6 Jun 2025 22:39:05 +0530 Subject: [PATCH 06/15] bumped --- benchmarks/Jumps/Manifest.toml | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/benchmarks/Jumps/Manifest.toml b/benchmarks/Jumps/Manifest.toml index 7af8cb237..369d882d4 100644 --- a/benchmarks/Jumps/Manifest.toml +++ b/benchmarks/Jumps/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.9" manifest_format = "2.0" -project_hash = "55ea7d85b59323e02a40bd80cb1827141911ce9d" +project_hash = "47a528bc71ab875d1ec3218b0391cf1c538d307e" [[deps.ADTypes]] git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32" @@ -731,9 +731,9 @@ uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.5" [[deps.EnzymeCore]] -git-tree-sha1 = "5669ce275d236795bd00fe2587e5db1f7c3c6c02" +git-tree-sha1 = "7d7822a643c33bbff4eab9c87ca8459d7c688db0" uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" -version = "0.8.10" +version = "0.8.11" weakdeps = ["Adapt"] [deps.EnzymeCore.extensions] @@ -791,9 +791,9 @@ version = "4.4.4+1" [[deps.FFTW]] deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] -git-tree-sha1 = "7de7c78d681078f027389e067864a8d53bd7c3c9" +git-tree-sha1 = "797762812ed063b9b94f6cc7742bc8883bb5e69e" uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" -version = "1.8.1" +version = "1.9.0" [[deps.FFTW_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -1009,10 +1009,10 @@ uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" version = "1.3.15+0" [[deps.Graphs]] -deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -git-tree-sha1 = "3169fd3440a02f35e549728b0890904cfd4ae58a" +deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "c5abfa0ae0aaee162a3fbb053c13ecda39be545b" uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" -version = "1.12.1" +version = "1.13.0" [[deps.Grisu]] git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" @@ -1045,9 +1045,9 @@ version = "0.3.28" [[deps.IJulia]] deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Logging", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "UUIDs", "ZMQ"] -git-tree-sha1 = "be30be76e25b0aff2c9a85930ed3ac34c5f10c83" +git-tree-sha1 = "5bea4d841d5db750a1bb5ccdc37b2759dfa80066" uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a" -version = "1.27.0" +version = "1.28.1" [[deps.IfElse]] git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" @@ -1377,9 +1377,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LinearSolve]] deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "GPUArraysCore", "InteractiveUtils", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "c618a6a774d5712c6bf02dbcceb51b6dc6b9bb89" +git-tree-sha1 = "c0d1a91a50af6778863d320761f807f641f74935" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "3.16.0" +version = "3.17.0" [deps.LinearSolve.extensions] LinearSolveBandedMatricesExt = "BandedMatrices" @@ -1514,9 +1514,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.ModelingToolkit]] deps = ["ADTypes", "AbstractTrees", "ArrayInterface", "BlockArrays", "ChainRulesCore", "Combinatorics", "CommonSolve", "Compat", "ConstructionBase", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "DiffRules", "DifferentiationInterface", "Distributed", "Distributions", "DocStringExtensions", "DomainSets", "DynamicQuantities", "EnumX", "ExprTools", "FindFirstFunctions", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "Graphs", "InteractiveUtils", "JuliaFormatter", "JumpProcesses", "Latexify", "Libdl", "LinearAlgebra", "MLStyle", "Moshi", "NaNMath", "NonlinearSolve", "OffsetArrays", "OrderedCollections", "PrecompileTools", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SCCNonlinearSolve", "SciMLBase", "SciMLStructures", "Serialization", "Setfield", "SimpleNonlinearSolve", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "SymbolicUtils", "Symbolics", "URIs", "UnPack", "Unitful"] -git-tree-sha1 = "7be3c50f3c384293aad704626c1feeca3d295ed7" +git-tree-sha1 = "efbc9ec328e0b3c0353bc8afc0a811e7d616bade" uuid = "961ee093-0014-501f-94e3-6117800e7a78" -version = "9.80.2" +version = "9.80.5" [deps.ModelingToolkit.extensions] MTKBifurcationKitExt = "BifurcationKit" @@ -1563,9 +1563,9 @@ version = "0.10.3" [[deps.Mustache]] deps = ["Printf", "Tables"] -git-tree-sha1 = "3b2db451a872b20519ebb0cec759d3d81a1c6bcb" +git-tree-sha1 = "3cbd5dda543bc59f2e482607ccf84b633724fc32" uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70" -version = "1.0.20" +version = "1.0.21" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -2277,9 +2277,9 @@ version = "0.1.0" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Moshi", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] -git-tree-sha1 = "ce947672206f6a3a2bee1017c690cfd5fd82d897" +git-tree-sha1 = "9efabb3d79f9076710f41af77017e42d8fa780d9" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.96.0" +version = "2.97.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -2418,9 +2418,9 @@ version = "1.10.0" [[deps.SparseConnectivityTracer]] deps = ["ADTypes", "DocStringExtensions", "FillArrays", "LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "fadb2d7010dd92912e5eb31a493613ad4b8c9583" +git-tree-sha1 = "2c3cbb3703f77045d4eb891b2831ca132ef4183c" uuid = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" -version = "0.6.18" +version = "0.6.19" [deps.SparseConnectivityTracer.extensions] SparseConnectivityTracerDataInterpolationsExt = "DataInterpolations" @@ -2651,9 +2651,9 @@ version = "1.0.1" [[deps.Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" +git-tree-sha1 = "f2c1efbc8f3a609aadf318094f8fc5204bdaf344" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.12.0" +version = "1.12.1" [[deps.Tar]] deps = ["ArgTools", "SHA"] From f25e7dd9156a827fe1d99d5c73cc30e0512f57a9 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Sat, 7 Jun 2025 23:02:38 +0530 Subject: [PATCH 07/15] benchmark added for VR_DirectFW --- benchmarks/Jumps/Manifest.toml | 20 ++++++++++---------- benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 12 ++++++++++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/benchmarks/Jumps/Manifest.toml b/benchmarks/Jumps/Manifest.toml index 369d882d4..516ea4c11 100644 --- a/benchmarks/Jumps/Manifest.toml +++ b/benchmarks/Jumps/Manifest.toml @@ -680,9 +680,9 @@ version = "0.25.120" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.DocStringExtensions]] -git-tree-sha1 = "e7b7e6f178525d17c720ab9c081e4ef04429f860" +git-tree-sha1 = "7442a5dfe1ebb773c29cc2962a8980f47221d76c" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.4" +version = "0.9.5" [[deps.DomainSets]] deps = ["CompositeTypes", "IntervalSets", "LinearAlgebra", "Random", "StaticArrays"] @@ -1182,9 +1182,9 @@ version = "1.1.0" [[deps.JumpProcesses]] deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DocStringExtensions", "FunctionWrappers", "Graphs", "LinearAlgebra", "Markdown", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "StaticArrays", "SymbolicIndexingInterface", "UnPack"] -git-tree-sha1 = "216c196df09c8b80a40a2befcb95760eb979bcfd" +git-tree-sha1 = "fb7fd516de38db80f50fe15e57d44da2836365e7" uuid = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" -version = "9.15.0" +version = "9.16.0" weakdeps = ["FastBroadcast"] [[deps.KernelDensity]] @@ -1766,9 +1766,9 @@ version = "1.2.0" [[deps.OrdinaryDiffEqBDF]] deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqSDIRK", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "42755bd13fe56e9d9ce1bc005f8b206a6b56b731" +git-tree-sha1 = "9124a686af119063bb4d3a8f87044a8f312fcad9" uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" -version = "1.5.1" +version = "1.6.0" [[deps.OrdinaryDiffEqCore]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FastPower", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "SymbolicIndexingInterface", "TruncatedStacktraces"] @@ -1788,9 +1788,9 @@ version = "1.4.0" [[deps.OrdinaryDiffEqDifferentiation]] deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "ConstructionBase", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqCore", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseMatrixColorings", "StaticArrayInterface", "StaticArrays"] -git-tree-sha1 = "c78060115fa4ea9d70ac47fa49496acbc630aefa" +git-tree-sha1 = "efecf0c4cc44e16251b0e718f08b0876b2a82b80" uuid = "4302a76b-040a-498a-8c04-15b101fed76b" -version = "1.9.1" +version = "1.10.0" [[deps.OrdinaryDiffEqExplicitRK]] deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "TruncatedStacktraces"] @@ -1896,9 +1896,9 @@ version = "1.1.0" [[deps.OrdinaryDiffEqRosenbrock]] deps = ["ADTypes", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"] -git-tree-sha1 = "063e5ff1447b3869856ed264b6dcbb21e6e8bdb0" +git-tree-sha1 = "1ce0096d920e95773220e818f29bf4b37ea2bb78" uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" -version = "1.10.1" +version = "1.11.0" [[deps.OrdinaryDiffEqSDIRK]] deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLBase", "TruncatedStacktraces"] diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd index 407b8f438..beae37e60 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -17,7 +17,7 @@ rng = StableRNG(12345) This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. -The benchmark compares `VR_Direct` and `VR_FRM` aggregators, while the visualization shows +The benchmark compares `VR_Direct`,`VR_DirectFW` and `VR_FRM` aggregators, while the visualization shows state variables vs. time to verify simulation behavior. The test cases are: @@ -38,20 +38,28 @@ We define factories for each test case to create problems with a variable number ```julia algorithms = Tuple{Any, Any, String, String}[ (VR_Direct(), Tsit5(), "VR_Direct", "Test 1 Tsit5 (VR_Direct)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 1 Tsit5 (VR_DirectFW)"), (VR_FRM(), Tsit5(), "VR_FRM", "Test 1 Tsit5 (VR_FRM)"), (VR_Direct(), Rosenbrock23(autodiff=false), "VR_Direct", "Test 1 Rosenbrock23 (no autodiff, VR_Direct)"), + (VR_DirectFW(), Rosenbrock23(autodiff=false), "VR_DirectFW", "Test 1 Rosenbrock23 (no autodiff, VR_DirectFW)"), (VR_FRM(), Rosenbrock23(autodiff=false), "VR_FRM", "Test 1 Rosenbrock23 (no autodiff, VR_FRM)"), (VR_Direct(), Rosenbrock23(), "VR_Direct", "Test 1 Rosenbrock23 (autodiff, VR_Direct)"), + (VR_DirectFW(), Rosenbrock23(), "VR_DirectFW", "Test 1 Rosenbrock23 (autodiff, VR_DirectFW)"), (VR_FRM(), Rosenbrock23(), "VR_FRM", "Test 1 Rosenbrock23 (autodiff, VR_FRM)"), (VR_Direct(), SRIW1(), "VR_Direct", "Test 2 SRIW1 (VR_Direct)"), + (VR_DirectFW(), SRIW1(), "VR_DirectFW", "Test 2 SRIW1 (VR_DirectFW)"), (VR_FRM(), SRIW1(), "VR_FRM", "Test 2 SRIW1 (VR_FRM)"), (VR_Direct(), Tsit5(), "VR_Direct", "Test 3 Tsit5 (VR_Direct, ConstantRateJump)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 3 Tsit5 (VR_DirectFW, ConstantRateJump)"), (VR_FRM(), Tsit5(), "VR_FRM", "Test 3 Tsit5 (VR_FRM, ConstantRateJump)"), (VR_Direct(), Tsit5(), "VR_Direct", "Test 4 Tsit5 (VR_Direct)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 4 Tsit5 (VR_DirectFW)"), (VR_FRM(), Tsit5(), "VR_FRM", "Test 4 Tsit5 (VR_FRM)"), (VR_Direct(), SRIW1(), "VR_Direct", "Test 5 SRIW1 (VR_Direct)"), + (VR_DirectFW(), SRIW1(), "VR_DirectFW", "Test 5 SRIW1 (VR_DirectFW)"), (VR_FRM(), SRIW1(), "VR_FRM", "Test 5 SRIW1 (VR_FRM)"), (VR_Direct(), Tsit5(), "VR_Direct", "Test 6 Tsit5 (VR_Direct)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 6 Tsit5 (VR_DirectFW)"), (VR_FRM(), Tsit5(), "VR_FRM", "Test 6 Tsit5 (VR_FRM)"), ] @@ -225,7 +233,7 @@ end # Benchmark Results -We plot the median execution times for each test case, comparing `VR_Direct` and `VR_FRM`. +We plot the median execution times for each test case, comparing `VR_Direct`,`VR_DirectFW` and `VR_FRM`. ```julia let figs = [] From 635f6cf9d872609c937d9b2de5e4c5a540b1593b Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Tue, 10 Jun 2025 01:25:14 +0530 Subject: [PATCH 08/15] added DNA Gene Model --- benchmarks/Jumps/VR_Aggregator_Benchmark.jmd | 200 +++++++------------ 1 file changed, 76 insertions(+), 124 deletions(-) diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd index beae37e60..2ae8589f2 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd @@ -22,14 +22,10 @@ state variables vs. time to verify simulation behavior. The test cases are: 1. **Scalar ODE with Variable Rate Jumps**: Solved with `Tsit5` and `Rosenbrock23` (with/without autodiff). -2. **Scalar SDE with Variable Rate Jumps**: Solved with `SRIW1`. -3. **ODE with Constant Rate Jump**: Solved with `Tsit5`. -4. **ODE with Variable Rate Jumps (Alternative Rate)**: Solved with `Tsit5`. -5. **SDE with Variable Rate Jumps (Alternative Rate)**: Solved with `SRIW1`. -6. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. +2. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. +3. **DNA Gene Model**: ODE with 10 variable rate jumps from the RSSA paper, solved with Tsit5. -For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, -we vary jumps from 1 to 20, running 100 trajectories per configuration. +For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, we vary jumps from 1 to 20. # Benchmark and Visualization Setup @@ -46,21 +42,12 @@ algorithms = Tuple{Any, Any, String, String}[ (VR_Direct(), Rosenbrock23(), "VR_Direct", "Test 1 Rosenbrock23 (autodiff, VR_Direct)"), (VR_DirectFW(), Rosenbrock23(), "VR_DirectFW", "Test 1 Rosenbrock23 (autodiff, VR_DirectFW)"), (VR_FRM(), Rosenbrock23(), "VR_FRM", "Test 1 Rosenbrock23 (autodiff, VR_FRM)"), - (VR_Direct(), SRIW1(), "VR_Direct", "Test 2 SRIW1 (VR_Direct)"), - (VR_DirectFW(), SRIW1(), "VR_DirectFW", "Test 2 SRIW1 (VR_DirectFW)"), - (VR_FRM(), SRIW1(), "VR_FRM", "Test 2 SRIW1 (VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 3 Tsit5 (VR_Direct, ConstantRateJump)"), - (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 3 Tsit5 (VR_DirectFW, ConstantRateJump)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 3 Tsit5 (VR_FRM, ConstantRateJump)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 4 Tsit5 (VR_Direct)"), - (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 4 Tsit5 (VR_DirectFW)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 4 Tsit5 (VR_FRM)"), - (VR_Direct(), SRIW1(), "VR_Direct", "Test 5 SRIW1 (VR_Direct)"), - (VR_DirectFW(), SRIW1(), "VR_DirectFW", "Test 5 SRIW1 (VR_DirectFW)"), - (VR_FRM(), SRIW1(), "VR_FRM", "Test 5 SRIW1 (VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 6 Tsit5 (VR_Direct)"), - (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 6 Tsit5 (VR_DirectFW)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 6 Tsit5 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 2 Tsit5 (VR_Direct)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 2 Tsit5 (VR_DirectFW)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 2 Tsit5 (VR_FRM)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 3 Tsit5 (VR_Direct, DNA Model)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 3 Tsit5 (VR_DirectFW, DNA Model)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 3 Tsit5 (VR_FRM, DNA Model)"), ] function create_test1_problem(num_jumps, vr_aggregator, solver) @@ -68,113 +55,85 @@ function create_test1_problem(num_jumps, vr_aggregator, solver) prob = ODEProblem(f, [0.2], (0.0, 10.0)) jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) + ensemble_prob = EnsembleProblem(jump_prob) return ensemble_prob, jump_prob end function create_test2_problem(num_jumps, vr_aggregator, solver) - f = (du, u, p, t) -> (du[1] = u[1]) - g = (du, u, p, t) -> (du[1] = u[1]) - prob = SDEProblem(f, g, [0.2], (0.0, 10.0)) - jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) - return ensemble_prob, jump_prob -end - -function create_test3_problem(num_jumps, vr_aggregator, solver) - f2 = (du, u, p, t) -> (du[1] = u[1]) - prob = ODEProblem(f2, [0.2], (0.0, 10.0)) - jumps = [ConstantRateJump((u, p, t) -> 2, (integrator) -> (integrator.u[1] = integrator.u[1] / 2)) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) - return ensemble_prob, jump_prob -end - -function create_test4_problem(num_jumps, vr_aggregator, solver) - f2 = (du, u, p, t) -> (du[1] = u[1]) - prob = ODEProblem(f2, [0.2], (0.0, 10.0)) - jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) - return ensemble_prob, jump_prob -end - -function create_test5_problem(num_jumps, vr_aggregator, solver) - f2 = (du, u, p, t) -> (du[1] = u[1]) - g2 = (du, u, p, t) -> (du[1] = u[1]) - prob = SDEProblem(f2, g2, [0.2], (0.0, 10.0)) - jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) - return ensemble_prob, jump_prob -end - -function create_test6_problem(num_jumps, vr_aggregator, solver) f4 = (dx, x, p, t) -> (dx[1] = x[1]) rate4 = (x, p, t) -> t affect4! = (integrator) -> (integrator.u[1] = integrator.u[1] * 0.5) prob = ODEProblem(f4, [1.0 + 0.0im], (0.0, 6.0)) jumps = [VariableRateJump(rate4, affect4!) for _ in 1:num_jumps] jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(prob) + ensemble_prob = EnsembleProblem(jump_prob) return ensemble_prob, jump_prob end -``` - -# Solution Visualization - -We solve one trajectory for each test case with 2 jumps using `VR_Direct` and plot the state variables vs. time. -```julia -let figs = [] - for test_num in 1:6 - # Select a representative solver for each test - algo, stepper = if test_num == 2 || test_num == 5 - VR_Direct(), SRIW1() - else - VR_Direct(), Tsit5() - end - label = "Test $test_num" - - # Create problem with 2 jumps (or 2x2 matrix) - ensemble_prob, jump_prob = if test_num == 1 - create_test1_problem(2, algo, stepper) - elseif test_num == 2 - create_test2_problem(2, algo, stepper) - elseif test_num == 3 - create_test3_problem(2, algo, stepper) - elseif test_num == 4 - create_test4_problem(2, algo, stepper) - elseif test_num == 5 - create_test5_problem(2, algo, stepper) - elseif test_num == 6 - create_test6_problem(2, algo, stepper) - end - - try - sol = solve(jump_prob, stepper; saveat=0.01) - # Plot solution - fig = plot(title="Test $test_num: Solution Trajectory", xlabel="Time", ylabel="State") - if test_num == 6 - # For complex ODE, plot real part - plot!(sol.t, real.(sol[1,:]), label="Real Part") - else - # For scalar problems, plot state - plot!(sol.t, sol[1,:], label="u[1]") - end - push!(figs, fig) - catch e - @warn "Failed to solve Test $test_num: $(sprint(showerror, e))" - end +function create_test3_problem(num_jumps, vr_aggregator, solver) + # Parameters from the RSSA paper + r = [0.043, 0.0007, 0.0715, 0.0039, 0.0199, 0.4791, 0.00019, 0.8765, 0.083, 0.5] + k = -log(2) / 30 + u0 = [10.0, 10.0, 30.0, 0.0, 0.0, 0.0] # [DNA, M, D, RNA, DNAD, DNA2D] + tspan = (0.0, 120.0) + + function f_dna(du, u, p, t) + du .= 0.0 + nothing end - plot(figs..., layout=(4, 2), format=fmt, size=(width_px, 4*height_px/2)) + + # Define 10 variable rate jumps (fixed set, num_jumps ignored for consistency) + function rate1(u, p, t) r[1] * u[4] end + function affect1!(integrator) integrator.u[2] += 1; nothing end + jump1 = VariableRateJump(rate1, affect1!) + + function rate2(u, p, t) r[2] * u[2] end + function affect2!(integrator) integrator.u[2] -= 1; nothing end + jump2 = VariableRateJump(rate2, affect2!) + + function rate3(u, p, t) r[3] * u[5] end + function affect3!(integrator) integrator.u[4] += 1; nothing end + jump3 = VariableRateJump(rate3, affect3!) + + function rate4(u, p, t) r[4] * u[4] end + function affect4!(integrator) integrator.u[4] -= 1; nothing end + jump4 = VariableRateJump(rate4, affect4!) + + function rate5(u, p, t) r[5] * exp(k * t) * u[1] * u[3] end + function affect5!(integrator) integrator.u[1] -= 1; integrator.u[3] -= 1; integrator.u[5] += 1; nothing end + jump5 = VariableRateJump(rate5, affect5!) + + function rate6(u, p, t) r[6] * u[5] end + function affect6!(integrator) integrator.u[5] -= 1; integrator.u[1] += 1; integrator.u[3] += 1; nothing end + jump6 = VariableRateJump(rate6, affect6!) + + function rate7(u, p, t) r[7] * exp(k * t) * u[5] * u[3] end + function affect7!(integrator) integrator.u[5] -= 1; integrator.u[3] -= 1; integrator.u[6] += 1; nothing end + jump7 = VariableRateJump(rate7, affect7!) + + function rate8(u, p, t) r[8] * u[6] end + function affect8!(integrator) integrator.u[6] -= 1; integrator.u[1] += 1; integrator.u[3] += 1; nothing end + jump8 = VariableRateJump(rate8, affect8!) + + function rate9(u, p, t) r[9] * exp(k * t) * u[2] * (u[2] - 1) / 2 end + function affect9!(integrator) integrator.u[2] -= 2; integrator.u[3] += 1; nothing end + jump9 = VariableRateJump(rate9, affect9!) + + function rate10(u, p, t) r[10] * u[3] end + function affect10!(integrator) integrator.u[3] -= 1; integrator.u[2] += 2; nothing end + jump10 = VariableRateJump(rate10, affect10!) + + prob = ODEProblem(f_dna, u0, tspan) + jumps = (jump1, jump2, jump3, jump4, jump5, jump6, jump7, jump8, jump9, jump10) + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) + ensemble_prob = EnsembleProblem(jump_prob) + return ensemble_prob, jump_prob end ``` # Benchmark Execution -We benchmark each test case for 1 to 20 jumps, running 100 trajectories. Errors are logged to diagnose failures. +We benchmark each test case for 1 to 20 jumps. Errors are logged to diagnose failures. ```julia num_jumps_range = append!([1], 5:5:20) @@ -195,18 +154,12 @@ for (algo, stepper, agg_name, label) in algorithms ensemble_prob, jump_prob = create_test2_problem(var, algo, stepper) elseif test_num == 3 ensemble_prob, jump_prob = create_test3_problem(var, algo, stepper) - elseif test_num == 4 - ensemble_prob, jump_prob = create_test4_problem(var, algo, stepper) - elseif test_num == 5 - ensemble_prob, jump_prob = create_test5_problem(var, algo, stepper) - elseif test_num == 6 - ensemble_prob, jump_prob = create_test6_problem(var, algo, stepper) end trial = try @benchmark( - solve($jump_prob, $stepper), - samples=50, - evals=1, + solve($jump_prob, $stepper), + samples=50, + evals=1, seconds=10 ) catch e @@ -237,13 +190,12 @@ We plot the median execution times for each test case, comparing `VR_Direct`,`VR ```julia let figs = [] - for test_num in 1:6 + for test_num in 1:3 test_algorithms = filter(a -> parse(Int, match(r"Test (\d+)", a[4]).captures[1]) == test_num, algorithms) - is_matrix_test = test_num == 7 - range_var = is_matrix_test ? matrix_sizes : num_jumps_range + range_var = num_jumps_range fig = plot( yscale=:log10, - xlabel=is_matrix_test ? "Matrix Size" : "Number of Jumps", + xlabel="Number of Jumps", ylabel="Time (ns)", legend_position=:outertopright, title="Test $test_num: Simulations, 50 samples" @@ -265,6 +217,6 @@ let figs = [] end push!(figs, fig) end - plot(figs..., layout=(6, 1), format=fmt, size=(width_px, 8*height_px/2)) + plot(figs..., layout=(3, 1), format=fmt, size=(width_px, 4*height_px)) end ``` \ No newline at end of file From 8e246bf107ddf7a3754ef36684b1d4e14e344df9 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Tue, 10 Jun 2025 16:36:36 +0530 Subject: [PATCH 09/15] moved folder --- benchmarks/HybridJumps/Manifest.toml | 137 +++++++++++------- .../MultivariateHawkes.jmd | 0 benchmarks/HybridJumps/Project.toml | 5 + .../VR_Aggregator_Benchmark.jmd | 2 +- benchmarks/Jumps/Manifest.toml | 82 ++++++----- benchmarks/Jumps/Project.toml | 3 - 6 files changed, 132 insertions(+), 97 deletions(-) rename benchmarks/{Jumps => HybridJumps}/MultivariateHawkes.jmd (100%) rename benchmarks/{Jumps => HybridJumps}/VR_Aggregator_Benchmark.jmd (99%) diff --git a/benchmarks/HybridJumps/Manifest.toml b/benchmarks/HybridJumps/Manifest.toml index da875a8bf..6bda27310 100644 --- a/benchmarks/HybridJumps/Manifest.toml +++ b/benchmarks/HybridJumps/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.9" manifest_format = "2.0" -project_hash = "59bb9ca342edc40032e032bc047178bab9947f84" +project_hash = "655ee19d9fa65ef20fe7edfa85c2bffd1ce645f6" [[deps.ADTypes]] git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32" @@ -548,6 +548,17 @@ weakdeps = ["ChainRulesCore", "EnzymeCore"] DispatchDoctorChainRulesCoreExt = "ChainRulesCore" DispatchDoctorEnzymeCoreExt = "EnzymeCore" +[[deps.Distances]] +deps = ["LinearAlgebra", "Statistics", "StatsAPI"] +git-tree-sha1 = "c7e3a542b999843086e2f29dac96a618c105be1d" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.12" +weakdeps = ["ChainRulesCore", "SparseArrays"] + + [deps.Distances.extensions] + DistancesChainRulesCoreExt = "ChainRulesCore" + DistancesSparseArraysExt = "SparseArrays" + [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" @@ -569,9 +580,9 @@ version = "0.25.120" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.DocStringExtensions]] -git-tree-sha1 = "e7b7e6f178525d17c720ab9c081e4ef04429f860" +git-tree-sha1 = "7442a5dfe1ebb773c29cc2962a8980f47221d76c" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.4" +version = "0.9.5" [[deps.DomainSets]] deps = ["CompositeTypes", "IntervalSets", "LinearAlgebra", "Random", "StaticArrays"] @@ -620,9 +631,9 @@ uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.5" [[deps.EnzymeCore]] -git-tree-sha1 = "1eb59f40a772d0fbd4cb75e00b3fa7f5f79c975a" +git-tree-sha1 = "7d7822a643c33bbff4eab9c87ca8459d7c688db0" uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" -version = "0.8.9" +version = "0.8.11" weakdeps = ["Adapt"] [deps.EnzymeCore.extensions] @@ -908,10 +919,10 @@ uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" version = "1.3.15+0" [[deps.Graphs]] -deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -git-tree-sha1 = "3169fd3440a02f35e549728b0890904cfd4ae58a" +deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "c5abfa0ae0aaee162a3fbb053c13ecda39be545b" uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" -version = "1.12.1" +version = "1.13.0" [[deps.Grisu]] git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" @@ -944,9 +955,9 @@ version = "0.3.28" [[deps.IJulia]] deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Logging", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "UUIDs", "ZMQ"] -git-tree-sha1 = "be30be76e25b0aff2c9a85930ed3ac34c5f10c83" +git-tree-sha1 = "5bea4d841d5db750a1bb5ccdc37b2759dfa80066" uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a" -version = "1.27.0" +version = "1.28.1" [[deps.IfElse]] git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" @@ -1077,9 +1088,9 @@ version = "0.4.10" [[deps.JumpProcesses]] deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DocStringExtensions", "FunctionWrappers", "Graphs", "LinearAlgebra", "Markdown", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "StaticArrays", "SymbolicIndexingInterface", "UnPack"] -git-tree-sha1 = "216c196df09c8b80a40a2befcb95760eb979bcfd" +git-tree-sha1 = "fb7fd516de38db80f50fe15e57d44da2836365e7" uuid = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" -version = "9.15.0" +version = "9.16.0" weakdeps = ["FastBroadcast"] [[deps.Krylov]] @@ -1181,6 +1192,12 @@ git-tree-sha1 = "4c4a5a0bdac384fd0e2fc9969ad600e4473868be" uuid = "b4f0291d-fe17-52bc-9479-3d1a343d9043" version = "4.0.1" +[[deps.LevyArea]] +deps = ["LinearAlgebra", "Random", "SpecialFunctions"] +git-tree-sha1 = "56513a09b8e0ae6485f34401ea9e2f31357958ec" +uuid = "2d8b4e74-eb68-11e8-0fb9-d5eb67b50637" +version = "1.0.0" + [[deps.LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" @@ -1266,9 +1283,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LinearSolve]] deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "GPUArraysCore", "InteractiveUtils", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "c618a6a774d5712c6bf02dbcceb51b6dc6b9bb89" +git-tree-sha1 = "c0d1a91a50af6778863d320761f807f641f74935" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "3.16.0" +version = "3.17.0" [deps.LinearSolve.extensions] LinearSolveBandedMatricesExt = "BandedMatrices" @@ -1358,9 +1375,9 @@ uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" [[deps.MathOptInterface]] deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON3", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test"] -git-tree-sha1 = "d4eb6037ce33f974a58a2ea9ccba28beab2a93c1" +git-tree-sha1 = "2f2c18c6acab9042557bdb0af8c3a14dd7b64413" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.40.1" +version = "1.41.0" [[deps.MaybeInplace]] deps = ["ArrayInterface", "LinearAlgebra", "MacroTools"] @@ -1399,9 +1416,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.ModelingToolkit]] deps = ["ADTypes", "AbstractTrees", "ArrayInterface", "BlockArrays", "ChainRulesCore", "Combinatorics", "CommonSolve", "Compat", "ConstructionBase", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "DiffRules", "DifferentiationInterface", "Distributed", "Distributions", "DocStringExtensions", "DomainSets", "DynamicQuantities", "EnumX", "ExprTools", "FindFirstFunctions", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "Graphs", "InteractiveUtils", "JuliaFormatter", "JumpProcesses", "Latexify", "Libdl", "LinearAlgebra", "MLStyle", "Moshi", "NaNMath", "NonlinearSolve", "OffsetArrays", "OrderedCollections", "PrecompileTools", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SCCNonlinearSolve", "SciMLBase", "SciMLStructures", "Serialization", "Setfield", "SimpleNonlinearSolve", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "SymbolicUtils", "Symbolics", "URIs", "UnPack", "Unitful"] -git-tree-sha1 = "7be3c50f3c384293aad704626c1feeca3d295ed7" +git-tree-sha1 = "efbc9ec328e0b3c0353bc8afc0a811e7d616bade" uuid = "961ee093-0014-501f-94e3-6117800e7a78" -version = "9.80.2" +version = "9.80.5" [deps.ModelingToolkit.extensions] MTKBifurcationKitExt = "BifurcationKit" @@ -1442,9 +1459,9 @@ version = "0.5.9" [[deps.Mustache]] deps = ["Printf", "Tables"] -git-tree-sha1 = "3b2db451a872b20519ebb0cec759d3d81a1c6bcb" +git-tree-sha1 = "3cbd5dda543bc59f2e482607ccf84b633724fc32" uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70" -version = "1.0.20" +version = "1.0.21" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -1454,9 +1471,15 @@ version = "1.6.4" [[deps.NLSolversBase]] deps = ["ADTypes", "DifferentiationInterface", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "b14c7be6046e7d48e9063a0053f95ee0fc954176" +git-tree-sha1 = "25a6638571a902ecfb1ae2a18fc1575f86b1d4df" uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.9.1" +version = "7.10.0" + +[[deps.NLsolve]] +deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] +git-tree-sha1 = "019f12e9a1a7880459d0173c182e6a99365d7ac1" +uuid = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" +version = "4.5.1" [[deps.NaNMath]] deps = ["OpenLibm_jll"] @@ -1634,9 +1657,9 @@ version = "1.2.0" [[deps.OrdinaryDiffEqBDF]] deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqSDIRK", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "42755bd13fe56e9d9ce1bc005f8b206a6b56b731" +git-tree-sha1 = "9124a686af119063bb4d3a8f87044a8f312fcad9" uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" -version = "1.5.1" +version = "1.6.0" [[deps.OrdinaryDiffEqCore]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FastPower", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "SymbolicIndexingInterface", "TruncatedStacktraces"] @@ -1656,9 +1679,9 @@ version = "1.4.0" [[deps.OrdinaryDiffEqDifferentiation]] deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "ConstructionBase", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqCore", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseMatrixColorings", "StaticArrayInterface", "StaticArrays"] -git-tree-sha1 = "c78060115fa4ea9d70ac47fa49496acbc630aefa" +git-tree-sha1 = "efecf0c4cc44e16251b0e718f08b0876b2a82b80" uuid = "4302a76b-040a-498a-8c04-15b101fed76b" -version = "1.9.1" +version = "1.10.0" [[deps.OrdinaryDiffEqExplicitRK]] deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "TruncatedStacktraces"] @@ -1764,9 +1787,9 @@ version = "1.1.0" [[deps.OrdinaryDiffEqRosenbrock]] deps = ["ADTypes", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"] -git-tree-sha1 = "063e5ff1447b3869856ed264b6dcbb21e6e8bdb0" +git-tree-sha1 = "1ce0096d920e95773220e818f29bf4b37ea2bb78" uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" -version = "1.10.1" +version = "1.11.0" [[deps.OrdinaryDiffEqSDIRK]] deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLBase", "TruncatedStacktraces"] @@ -2128,9 +2151,9 @@ version = "0.1.0" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Moshi", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] -git-tree-sha1 = "ce947672206f6a3a2bee1017c690cfd5fd82d897" +git-tree-sha1 = "d7bef263e23c7f5392071e4538b1949cee7ae458" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.96.0" +version = "2.99.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -2357,6 +2380,12 @@ weakdeps = ["ChainRulesCore", "InverseFunctions"] StatsFunsChainRulesCoreExt = "ChainRulesCore" StatsFunsInverseFunctionsExt = "InverseFunctions" +[[deps.StochasticDiffEq]] +deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqNoiseProcess", "DocStringExtensions", "FastPower", "FiniteDiff", "ForwardDiff", "JumpProcesses", "LevyArea", "LinearAlgebra", "Logging", "MuladdMacro", "NLsolve", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SparseArrays", "StaticArrays", "UnPack"] +git-tree-sha1 = "2992af2739fdcf5862b12dcf53a5f6e3e4acd358" +uuid = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" +version = "6.80.0" + [[deps.StrideArraysCore]] deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] git-tree-sha1 = "f35f6ab602df8413a50c4a25ca14de821e8605fb" @@ -2463,9 +2492,9 @@ version = "1.0.1" [[deps.Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" +git-tree-sha1 = "f2c1efbc8f3a609aadf318094f8fc5204bdaf344" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.12.0" +version = "1.12.1" [[deps.Tar]] deps = ["ArgTools", "SHA"] @@ -2556,14 +2585,16 @@ version = "0.4.1" [[deps.Unitful]] deps = ["Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "d62610ec45e4efeabf7032d67de2ffdea8344bed" +git-tree-sha1 = "02c1ac8104c9cf941395db79c611483909c04c7d" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.22.1" -weakdeps = ["ConstructionBase", "InverseFunctions"] +version = "1.23.0" +weakdeps = ["ConstructionBase", "ForwardDiff", "InverseFunctions", "Printf"] [deps.Unitful.extensions] ConstructionBaseUnitfulExt = "ConstructionBase" + ForwardDiffExt = "ForwardDiff" InverseFunctionsUnitfulExt = "InverseFunctions" + PrintfExt = "Printf" [[deps.UnitfulLatexify]] deps = ["LaTeXStrings", "Latexify", "Unitful"] @@ -2725,28 +2756,28 @@ uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" version = "0.4.0+1" [[deps.Xorg_xcb_util_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] -git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll"] +git-tree-sha1 = "68da27247e7d8d8dafd1fcf0c3654ad6506f5f97" uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" -version = "0.4.0+1" +version = "0.4.1+0" [[deps.Xorg_xcb_util_keysyms_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] +git-tree-sha1 = "44ec54b0e2acd408b0fb361e1e9244c60c9c3dd4" uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" -version = "0.4.0+1" +version = "0.4.1+0" [[deps.Xorg_xcb_util_renderutil_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] +git-tree-sha1 = "5b0263b6d080716a02544c55fdff2c8d7f9a16a0" uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" -version = "0.3.9+1" +version = "0.3.10+0" [[deps.Xorg_xcb_util_wm_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] +git-tree-sha1 = "f233c83cad1fa0e70b7771e0e21b061a116f2763" uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" -version = "0.4.1+1" +version = "0.4.2+0" [[deps.Xorg_xkbcomp_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxkbfile_jll"] @@ -2837,10 +2868,10 @@ uuid = "1183f4f0-6f2a-5f1a-908b-139f9cdfea6f" version = "0.2.2+0" [[deps.libevdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "141fe65dc3efabb0b1d5ba74e91f6ad26f84cc22" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "56d643b57b188d30cccc25e331d416d3d358e557" uuid = "2db6ffa8-e38f-5e21-84af-90c45d0032cc" -version = "1.11.0+0" +version = "1.13.4+0" [[deps.libfdk_aac_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -2873,10 +2904,10 @@ uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" version = "1.3.7+2" [[deps.mtdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "b4d631fd51f2e9cdd93724ae25b2efc198b059b1" uuid = "009596ad-96f7-51b1-9f1b-5ce2d5e8a71e" -version = "1.1.6+0" +version = "1.1.7+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] diff --git a/benchmarks/Jumps/MultivariateHawkes.jmd b/benchmarks/HybridJumps/MultivariateHawkes.jmd similarity index 100% rename from benchmarks/Jumps/MultivariateHawkes.jmd rename to benchmarks/HybridJumps/MultivariateHawkes.jmd diff --git a/benchmarks/HybridJumps/Project.toml b/benchmarks/HybridJumps/Project.toml index 6838c8426..f3a48d133 100644 --- a/benchmarks/HybridJumps/Project.toml +++ b/benchmarks/HybridJumps/Project.toml @@ -2,11 +2,14 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" +Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" LazySets = "b4f0291d-fe17-52bc-9479-3d1a343d9043" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" PiecewiseDeterministicMarkovProcesses = "86206cdf-4603-54e0-bd58-22a2dcbf57aa" @@ -14,7 +17,9 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" SciMLBenchmarks = "31c91b34-3c75-11e9-0341-95557aab0344" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" [compat] BenchmarkTools = "1.4" diff --git a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd b/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd similarity index 99% rename from benchmarks/Jumps/VR_Aggregator_Benchmark.jmd rename to benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd index 2ae8589f2..6ce9766ad 100644 --- a/benchmarks/Jumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd @@ -23,7 +23,7 @@ state variables vs. time to verify simulation behavior. The test cases are: 1. **Scalar ODE with Variable Rate Jumps**: Solved with `Tsit5` and `Rosenbrock23` (with/without autodiff). 2. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. -3. **DNA Gene Model**: ODE with 10 variable rate jumps from the RSSA paper, solved with Tsit5. +3. **DNA Gene Model**: ODE with 10 variable rate jumps from the RSSA paper, solved with `Tsit5`. For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, we vary jumps from 1 to 20. diff --git a/benchmarks/Jumps/Manifest.toml b/benchmarks/Jumps/Manifest.toml index 516ea4c11..3c9810fab 100644 --- a/benchmarks/Jumps/Manifest.toml +++ b/benchmarks/Jumps/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.9" manifest_format = "2.0" -project_hash = "47a528bc71ab875d1ec3218b0391cf1c538d307e" +project_hash = "55ea7d85b59323e02a40bd80cb1827141911ce9d" [[deps.ADTypes]] git-tree-sha1 = "e2478490447631aedba0823d4d7a80b2cc8cdb32" @@ -203,9 +203,9 @@ weakdeps = ["Adapt", "BandedMatrices"] [[deps.BoundaryValueDiffEq]] deps = ["ADTypes", "BoundaryValueDiffEqAscher", "BoundaryValueDiffEqCore", "BoundaryValueDiffEqFIRK", "BoundaryValueDiffEqMIRK", "BoundaryValueDiffEqMIRKN", "BoundaryValueDiffEqShooting", "DiffEqBase", "FastClosures", "ForwardDiff", "LinearAlgebra", "Reexport", "SciMLBase"] -git-tree-sha1 = "6606f3f7d43b038a8c34ee4cdc31bbd93b447407" +git-tree-sha1 = "d6ec33e4516b2e790a64128afdb54f3b536667a7" uuid = "764a87c0-6b3e-53db-9096-fe964310641d" -version = "5.17.0" +version = "5.18.0" [deps.BoundaryValueDiffEq.extensions] BoundaryValueDiffEqODEInterfaceExt = "ODEInterface" @@ -215,39 +215,39 @@ version = "5.17.0" [[deps.BoundaryValueDiffEqAscher]] deps = ["ADTypes", "AlmostBlockDiagonals", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield"] -git-tree-sha1 = "2e8239379bdd0f8254407ca2b2cb7b3430da687f" +git-tree-sha1 = "64a777e06d995f677c86c7ddbb85f393074a0877" uuid = "7227322d-7511-4e07-9247-ad6ff830280e" -version = "1.6.1" +version = "1.7.0" [[deps.BoundaryValueDiffEqCore]] deps = ["ADTypes", "Adapt", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "ForwardDiff", "LineSearch", "LinearAlgebra", "Logging", "NonlinearSolveFirstOrder", "PreallocationTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings"] -git-tree-sha1 = "1e97d81b6ea5e8e938c57a3c640a5cff1e181a2f" +git-tree-sha1 = "c83bf97da90dd379b1e3f4d9c6f3d0ae48eb0b29" uuid = "56b672f2-a5fe-4263-ab2d-da677488eb3a" -version = "1.9.0" +version = "1.10.0" [[deps.BoundaryValueDiffEqFIRK]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "525c65da4b46271b4b5fc2178ccde16c99c21a41" +git-tree-sha1 = "d4f45cd0157ba9f9a8f0e0057feed91aa49cce60" uuid = "85d9eb09-370e-4000-bb32-543851f73618" -version = "1.7.0" +version = "1.8.0" [[deps.BoundaryValueDiffEqMIRK]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "f729bdedaedb537bf7883c9f71e7577e1c7a07f6" +git-tree-sha1 = "d83d30d9bdd9cbe6e4af3ac6c93eaa702e749702" uuid = "1a22d4ce-7765-49ea-b6f2-13c8438986a6" -version = "1.7.0" +version = "1.8.0" [[deps.BoundaryValueDiffEqMIRKN]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "1000b18a380773f049ac2f34bc12abd3d99cf21c" +git-tree-sha1 = "a8a5bcad74103c61fc9e3c7778dc70e587a879a2" uuid = "9255f1d6-53bf-473e-b6bd-23f1ff009da4" -version = "1.6.1" +version = "1.7.0" [[deps.BoundaryValueDiffEqShooting]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "255c15c2d262ea8d3c5db1e0f130f829362c0fd4" +git-tree-sha1 = "e22053bd3f07277ef26e48c43a9de425ac957766" uuid = "ed55bfe0-3725-4db6-871e-a1dc9f42a757" -version = "1.7.0" +version = "1.8.0" [[deps.BracketingNonlinearSolve]] deps = ["CommonSolve", "ConcreteStructs", "NonlinearSolveBase", "PrecompileTools", "Reexport", "SciMLBase"] @@ -1575,9 +1575,9 @@ version = "1.6.4" [[deps.NLSolversBase]] deps = ["ADTypes", "DifferentiationInterface", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "b14c7be6046e7d48e9063a0053f95ee0fc954176" +git-tree-sha1 = "25a6638571a902ecfb1ae2a18fc1575f86b1d4df" uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.9.1" +version = "7.10.0" [[deps.NLsolve]] deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] @@ -2277,9 +2277,9 @@ version = "0.1.0" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Moshi", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] -git-tree-sha1 = "9efabb3d79f9076710f41af77017e42d8fa780d9" +git-tree-sha1 = "d7bef263e23c7f5392071e4538b1949cee7ae458" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.97.0" +version = "2.99.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -2744,14 +2744,16 @@ version = "0.4.1" [[deps.Unitful]] deps = ["Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "d62610ec45e4efeabf7032d67de2ffdea8344bed" +git-tree-sha1 = "02c1ac8104c9cf941395db79c611483909c04c7d" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.22.1" -weakdeps = ["ConstructionBase", "InverseFunctions"] +version = "1.23.0" +weakdeps = ["ConstructionBase", "ForwardDiff", "InverseFunctions", "Printf"] [deps.Unitful.extensions] ConstructionBaseUnitfulExt = "ConstructionBase" + ForwardDiffExt = "ForwardDiff" InverseFunctionsUnitfulExt = "InverseFunctions" + PrintfExt = "Printf" [[deps.UnitfulLatexify]] deps = ["LaTeXStrings", "Latexify", "Unitful"] @@ -2925,28 +2927,28 @@ uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" version = "0.4.0+1" [[deps.Xorg_xcb_util_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] -git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll"] +git-tree-sha1 = "68da27247e7d8d8dafd1fcf0c3654ad6506f5f97" uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" -version = "0.4.0+1" +version = "0.4.1+0" [[deps.Xorg_xcb_util_keysyms_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] +git-tree-sha1 = "44ec54b0e2acd408b0fb361e1e9244c60c9c3dd4" uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" -version = "0.4.0+1" +version = "0.4.1+0" [[deps.Xorg_xcb_util_renderutil_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] +git-tree-sha1 = "5b0263b6d080716a02544c55fdff2c8d7f9a16a0" uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" -version = "0.3.9+1" +version = "0.3.10+0" [[deps.Xorg_xcb_util_wm_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] -git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] +git-tree-sha1 = "f233c83cad1fa0e70b7771e0e21b061a116f2763" uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" -version = "0.4.1+1" +version = "0.4.2+0" [[deps.Xorg_xkbcomp_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxkbfile_jll"] @@ -3037,10 +3039,10 @@ uuid = "1183f4f0-6f2a-5f1a-908b-139f9cdfea6f" version = "0.2.2+0" [[deps.libevdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "141fe65dc3efabb0b1d5ba74e91f6ad26f84cc22" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "56d643b57b188d30cccc25e331d416d3d358e557" uuid = "2db6ffa8-e38f-5e21-84af-90c45d0032cc" -version = "1.11.0+0" +version = "1.13.4+0" [[deps.libfdk_aac_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -3073,10 +3075,10 @@ uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" version = "1.3.7+2" [[deps.mtdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "b4d631fd51f2e9cdd93724ae25b2efc198b059b1" uuid = "009596ad-96f7-51b1-9f1b-5ce2d5e8a71e" -version = "1.1.6+0" +version = "1.1.7+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] diff --git a/benchmarks/Jumps/Project.toml b/benchmarks/Jumps/Project.toml index f77dc8d2d..02c774794 100644 --- a/benchmarks/Jumps/Project.toml +++ b/benchmarks/Jumps/Project.toml @@ -3,14 +3,12 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" -DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" JumpProblemLibrary = "faf0f6d7-8cee-47cb-b27c-1eb80cef534e" JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" PiecewiseDeterministicMarkovProcesses = "86206cdf-4603-54e0-bd58-22a2dcbf57aa" @@ -22,7 +20,6 @@ SciMLBenchmarks = "31c91b34-3c75-11e9-0341-95557aab0344" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" -StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4" [compat] From fd1ff522f4cb34180c7e07aa98436e6971fb5f22 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Tue, 10 Jun 2025 16:38:23 +0530 Subject: [PATCH 10/15] Jump unbumped --- benchmarks/Jumps/Manifest.toml | 138 ++++++++++++++++----------------- 1 file changed, 68 insertions(+), 70 deletions(-) diff --git a/benchmarks/Jumps/Manifest.toml b/benchmarks/Jumps/Manifest.toml index 3c9810fab..7af8cb237 100644 --- a/benchmarks/Jumps/Manifest.toml +++ b/benchmarks/Jumps/Manifest.toml @@ -203,9 +203,9 @@ weakdeps = ["Adapt", "BandedMatrices"] [[deps.BoundaryValueDiffEq]] deps = ["ADTypes", "BoundaryValueDiffEqAscher", "BoundaryValueDiffEqCore", "BoundaryValueDiffEqFIRK", "BoundaryValueDiffEqMIRK", "BoundaryValueDiffEqMIRKN", "BoundaryValueDiffEqShooting", "DiffEqBase", "FastClosures", "ForwardDiff", "LinearAlgebra", "Reexport", "SciMLBase"] -git-tree-sha1 = "d6ec33e4516b2e790a64128afdb54f3b536667a7" +git-tree-sha1 = "6606f3f7d43b038a8c34ee4cdc31bbd93b447407" uuid = "764a87c0-6b3e-53db-9096-fe964310641d" -version = "5.18.0" +version = "5.17.0" [deps.BoundaryValueDiffEq.extensions] BoundaryValueDiffEqODEInterfaceExt = "ODEInterface" @@ -215,39 +215,39 @@ version = "5.18.0" [[deps.BoundaryValueDiffEqAscher]] deps = ["ADTypes", "AlmostBlockDiagonals", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield"] -git-tree-sha1 = "64a777e06d995f677c86c7ddbb85f393074a0877" +git-tree-sha1 = "2e8239379bdd0f8254407ca2b2cb7b3430da687f" uuid = "7227322d-7511-4e07-9247-ad6ff830280e" -version = "1.7.0" +version = "1.6.1" [[deps.BoundaryValueDiffEqCore]] deps = ["ADTypes", "Adapt", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "ForwardDiff", "LineSearch", "LinearAlgebra", "Logging", "NonlinearSolveFirstOrder", "PreallocationTools", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings"] -git-tree-sha1 = "c83bf97da90dd379b1e3f4d9c6f3d0ae48eb0b29" +git-tree-sha1 = "1e97d81b6ea5e8e938c57a3c640a5cff1e181a2f" uuid = "56b672f2-a5fe-4263-ab2d-da677488eb3a" -version = "1.10.0" +version = "1.9.0" [[deps.BoundaryValueDiffEqFIRK]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "d4f45cd0157ba9f9a8f0e0057feed91aa49cce60" +git-tree-sha1 = "525c65da4b46271b4b5fc2178ccde16c99c21a41" uuid = "85d9eb09-370e-4000-bb32-543851f73618" -version = "1.8.0" +version = "1.7.0" [[deps.BoundaryValueDiffEqMIRK]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "d83d30d9bdd9cbe6e4af3ac6c93eaa702e749702" +git-tree-sha1 = "f729bdedaedb537bf7883c9f71e7577e1c7a07f6" uuid = "1a22d4ce-7765-49ea-b6f2-13c8438986a6" -version = "1.8.0" +version = "1.7.0" [[deps.BoundaryValueDiffEqMIRKN]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "a8a5bcad74103c61fc9e3c7778dc70e587a879a2" +git-tree-sha1 = "1000b18a380773f049ac2f34bc12abd3d99cf21c" uuid = "9255f1d6-53bf-473e-b6bd-23f1ff009da4" -version = "1.7.0" +version = "1.6.1" [[deps.BoundaryValueDiffEqShooting]] deps = ["ADTypes", "ArrayInterface", "BandedMatrices", "BoundaryValueDiffEqCore", "ConcreteStructs", "DiffEqBase", "DifferentiationInterface", "FastAlmostBandedMatrices", "FastClosures", "ForwardDiff", "LinearAlgebra", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "SparseArrays"] -git-tree-sha1 = "e22053bd3f07277ef26e48c43a9de425ac957766" +git-tree-sha1 = "255c15c2d262ea8d3c5db1e0f130f829362c0fd4" uuid = "ed55bfe0-3725-4db6-871e-a1dc9f42a757" -version = "1.8.0" +version = "1.7.0" [[deps.BracketingNonlinearSolve]] deps = ["CommonSolve", "ConcreteStructs", "NonlinearSolveBase", "PrecompileTools", "Reexport", "SciMLBase"] @@ -680,9 +680,9 @@ version = "0.25.120" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [[deps.DocStringExtensions]] -git-tree-sha1 = "7442a5dfe1ebb773c29cc2962a8980f47221d76c" +git-tree-sha1 = "e7b7e6f178525d17c720ab9c081e4ef04429f860" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.9.5" +version = "0.9.4" [[deps.DomainSets]] deps = ["CompositeTypes", "IntervalSets", "LinearAlgebra", "Random", "StaticArrays"] @@ -731,9 +731,9 @@ uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.5" [[deps.EnzymeCore]] -git-tree-sha1 = "7d7822a643c33bbff4eab9c87ca8459d7c688db0" +git-tree-sha1 = "5669ce275d236795bd00fe2587e5db1f7c3c6c02" uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" -version = "0.8.11" +version = "0.8.10" weakdeps = ["Adapt"] [deps.EnzymeCore.extensions] @@ -791,9 +791,9 @@ version = "4.4.4+1" [[deps.FFTW]] deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] -git-tree-sha1 = "797762812ed063b9b94f6cc7742bc8883bb5e69e" +git-tree-sha1 = "7de7c78d681078f027389e067864a8d53bd7c3c9" uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" -version = "1.9.0" +version = "1.8.1" [[deps.FFTW_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -1009,10 +1009,10 @@ uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" version = "1.3.15+0" [[deps.Graphs]] -deps = ["ArnoldiMethod", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] -git-tree-sha1 = "c5abfa0ae0aaee162a3fbb053c13ecda39be545b" +deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"] +git-tree-sha1 = "3169fd3440a02f35e549728b0890904cfd4ae58a" uuid = "86223c79-3864-5bf0-83f7-82e725a168b6" -version = "1.13.0" +version = "1.12.1" [[deps.Grisu]] git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" @@ -1045,9 +1045,9 @@ version = "0.3.28" [[deps.IJulia]] deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Logging", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "UUIDs", "ZMQ"] -git-tree-sha1 = "5bea4d841d5db750a1bb5ccdc37b2759dfa80066" +git-tree-sha1 = "be30be76e25b0aff2c9a85930ed3ac34c5f10c83" uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a" -version = "1.28.1" +version = "1.27.0" [[deps.IfElse]] git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" @@ -1182,9 +1182,9 @@ version = "1.1.0" [[deps.JumpProcesses]] deps = ["ArrayInterface", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DocStringExtensions", "FunctionWrappers", "Graphs", "LinearAlgebra", "Markdown", "PoissonRandom", "Random", "RandomNumbers", "RecursiveArrayTools", "Reexport", "SciMLBase", "Setfield", "StaticArrays", "SymbolicIndexingInterface", "UnPack"] -git-tree-sha1 = "fb7fd516de38db80f50fe15e57d44da2836365e7" +git-tree-sha1 = "216c196df09c8b80a40a2befcb95760eb979bcfd" uuid = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" -version = "9.16.0" +version = "9.15.0" weakdeps = ["FastBroadcast"] [[deps.KernelDensity]] @@ -1377,9 +1377,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LinearSolve]] deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "GPUArraysCore", "InteractiveUtils", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "StaticArraysCore", "UnPack"] -git-tree-sha1 = "c0d1a91a50af6778863d320761f807f641f74935" +git-tree-sha1 = "c618a6a774d5712c6bf02dbcceb51b6dc6b9bb89" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" -version = "3.17.0" +version = "3.16.0" [deps.LinearSolve.extensions] LinearSolveBandedMatricesExt = "BandedMatrices" @@ -1514,9 +1514,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804" [[deps.ModelingToolkit]] deps = ["ADTypes", "AbstractTrees", "ArrayInterface", "BlockArrays", "ChainRulesCore", "Combinatorics", "CommonSolve", "Compat", "ConstructionBase", "DataStructures", "DiffEqBase", "DiffEqCallbacks", "DiffEqNoiseProcess", "DiffRules", "DifferentiationInterface", "Distributed", "Distributions", "DocStringExtensions", "DomainSets", "DynamicQuantities", "EnumX", "ExprTools", "FindFirstFunctions", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "Graphs", "InteractiveUtils", "JuliaFormatter", "JumpProcesses", "Latexify", "Libdl", "LinearAlgebra", "MLStyle", "Moshi", "NaNMath", "NonlinearSolve", "OffsetArrays", "OrderedCollections", "PrecompileTools", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SCCNonlinearSolve", "SciMLBase", "SciMLStructures", "Serialization", "Setfield", "SimpleNonlinearSolve", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "SymbolicUtils", "Symbolics", "URIs", "UnPack", "Unitful"] -git-tree-sha1 = "efbc9ec328e0b3c0353bc8afc0a811e7d616bade" +git-tree-sha1 = "7be3c50f3c384293aad704626c1feeca3d295ed7" uuid = "961ee093-0014-501f-94e3-6117800e7a78" -version = "9.80.5" +version = "9.80.2" [deps.ModelingToolkit.extensions] MTKBifurcationKitExt = "BifurcationKit" @@ -1563,9 +1563,9 @@ version = "0.10.3" [[deps.Mustache]] deps = ["Printf", "Tables"] -git-tree-sha1 = "3cbd5dda543bc59f2e482607ccf84b633724fc32" +git-tree-sha1 = "3b2db451a872b20519ebb0cec759d3d81a1c6bcb" uuid = "ffc61752-8dc7-55ee-8c37-f3e9cdd09e70" -version = "1.0.21" +version = "1.0.20" [[deps.MutableArithmetics]] deps = ["LinearAlgebra", "SparseArrays", "Test"] @@ -1575,9 +1575,9 @@ version = "1.6.4" [[deps.NLSolversBase]] deps = ["ADTypes", "DifferentiationInterface", "Distributed", "FiniteDiff", "ForwardDiff"] -git-tree-sha1 = "25a6638571a902ecfb1ae2a18fc1575f86b1d4df" +git-tree-sha1 = "b14c7be6046e7d48e9063a0053f95ee0fc954176" uuid = "d41bc354-129a-5804-8e4c-c37616107c6c" -version = "7.10.0" +version = "7.9.1" [[deps.NLsolve]] deps = ["Distances", "LineSearches", "LinearAlgebra", "NLSolversBase", "Printf", "Reexport"] @@ -1766,9 +1766,9 @@ version = "1.2.0" [[deps.OrdinaryDiffEqBDF]] deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqSDIRK", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "StaticArrays", "TruncatedStacktraces"] -git-tree-sha1 = "9124a686af119063bb4d3a8f87044a8f312fcad9" +git-tree-sha1 = "42755bd13fe56e9d9ce1bc005f8b206a6b56b731" uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" -version = "1.6.0" +version = "1.5.1" [[deps.OrdinaryDiffEqCore]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FastPower", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "SymbolicIndexingInterface", "TruncatedStacktraces"] @@ -1788,9 +1788,9 @@ version = "1.4.0" [[deps.OrdinaryDiffEqDifferentiation]] deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "ConstructionBase", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqCore", "SciMLBase", "SciMLOperators", "SparseArrays", "SparseMatrixColorings", "StaticArrayInterface", "StaticArrays"] -git-tree-sha1 = "efecf0c4cc44e16251b0e718f08b0876b2a82b80" +git-tree-sha1 = "c78060115fa4ea9d70ac47fa49496acbc630aefa" uuid = "4302a76b-040a-498a-8c04-15b101fed76b" -version = "1.10.0" +version = "1.9.1" [[deps.OrdinaryDiffEqExplicitRK]] deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "TruncatedStacktraces"] @@ -1896,9 +1896,9 @@ version = "1.1.0" [[deps.OrdinaryDiffEqRosenbrock]] deps = ["ADTypes", "DiffEqBase", "DifferentiationInterface", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"] -git-tree-sha1 = "1ce0096d920e95773220e818f29bf4b37ea2bb78" +git-tree-sha1 = "063e5ff1447b3869856ed264b6dcbb21e6e8bdb0" uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" -version = "1.11.0" +version = "1.10.1" [[deps.OrdinaryDiffEqSDIRK]] deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLBase", "TruncatedStacktraces"] @@ -2277,9 +2277,9 @@ version = "0.1.0" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "Moshi", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] -git-tree-sha1 = "d7bef263e23c7f5392071e4538b1949cee7ae458" +git-tree-sha1 = "ce947672206f6a3a2bee1017c690cfd5fd82d897" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.99.0" +version = "2.96.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -2418,9 +2418,9 @@ version = "1.10.0" [[deps.SparseConnectivityTracer]] deps = ["ADTypes", "DocStringExtensions", "FillArrays", "LinearAlgebra", "Random", "SparseArrays"] -git-tree-sha1 = "2c3cbb3703f77045d4eb891b2831ca132ef4183c" +git-tree-sha1 = "fadb2d7010dd92912e5eb31a493613ad4b8c9583" uuid = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" -version = "0.6.19" +version = "0.6.18" [deps.SparseConnectivityTracer.extensions] SparseConnectivityTracerDataInterpolationsExt = "DataInterpolations" @@ -2651,9 +2651,9 @@ version = "1.0.1" [[deps.Tables]] deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "f2c1efbc8f3a609aadf318094f8fc5204bdaf344" +git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.12.1" +version = "1.12.0" [[deps.Tar]] deps = ["ArgTools", "SHA"] @@ -2744,16 +2744,14 @@ version = "0.4.1" [[deps.Unitful]] deps = ["Dates", "LinearAlgebra", "Random"] -git-tree-sha1 = "02c1ac8104c9cf941395db79c611483909c04c7d" +git-tree-sha1 = "d62610ec45e4efeabf7032d67de2ffdea8344bed" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" -version = "1.23.0" -weakdeps = ["ConstructionBase", "ForwardDiff", "InverseFunctions", "Printf"] +version = "1.22.1" +weakdeps = ["ConstructionBase", "InverseFunctions"] [deps.Unitful.extensions] ConstructionBaseUnitfulExt = "ConstructionBase" - ForwardDiffExt = "ForwardDiff" InverseFunctionsUnitfulExt = "InverseFunctions" - PrintfExt = "Printf" [[deps.UnitfulLatexify]] deps = ["LaTeXStrings", "Latexify", "Unitful"] @@ -2927,28 +2925,28 @@ uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" version = "0.4.0+1" [[deps.Xorg_xcb_util_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll"] -git-tree-sha1 = "68da27247e7d8d8dafd1fcf0c3654ad6506f5f97" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] +git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" -version = "0.4.1+0" +version = "0.4.0+1" [[deps.Xorg_xcb_util_keysyms_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] -git-tree-sha1 = "44ec54b0e2acd408b0fb361e1e9244c60c9c3dd4" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" -version = "0.4.1+0" +version = "0.4.0+1" [[deps.Xorg_xcb_util_renderutil_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] -git-tree-sha1 = "5b0263b6d080716a02544c55fdff2c8d7f9a16a0" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" -version = "0.3.10+0" +version = "0.3.9+1" [[deps.Xorg_xcb_util_wm_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_jll"] -git-tree-sha1 = "f233c83cad1fa0e70b7771e0e21b061a116f2763" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" -version = "0.4.2+0" +version = "0.4.1+1" [[deps.Xorg_xkbcomp_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxkbfile_jll"] @@ -3039,10 +3037,10 @@ uuid = "1183f4f0-6f2a-5f1a-908b-139f9cdfea6f" version = "0.2.2+0" [[deps.libevdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "56d643b57b188d30cccc25e331d416d3d358e557" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "141fe65dc3efabb0b1d5ba74e91f6ad26f84cc22" uuid = "2db6ffa8-e38f-5e21-84af-90c45d0032cc" -version = "1.13.4+0" +version = "1.11.0+0" [[deps.libfdk_aac_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -3075,10 +3073,10 @@ uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" version = "1.3.7+2" [[deps.mtdev_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "b4d631fd51f2e9cdd93724ae25b2efc198b059b1" +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" uuid = "009596ad-96f7-51b1-9f1b-5ce2d5e8a71e" -version = "1.1.7+0" +version = "1.1.6+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] From 2551319507b5ba0d0ab288284f7fee9c017fcdcb Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Thu, 12 Jun 2025 00:51:42 +0530 Subject: [PATCH 11/15] refactor --- .../HybridJumps/VR_Aggregator_Benchmark.jmd | 589 +++++++++++++----- 1 file changed, 422 insertions(+), 167 deletions(-) diff --git a/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd b/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd index 6ce9766ad..5483ef6ce 100644 --- a/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd @@ -15,208 +15,463 @@ rng = StableRNG(12345) # Introduction -This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and -visualizes example solution trajectories for the test cases from `variable_rate_test.jl`. -The benchmark compares `VR_Direct`,`VR_DirectFW` and `VR_FRM` aggregators, while the visualization shows -state variables vs. time to verify simulation behavior. +This document benchmarks the performance of variable rate jumps in `JumpProcesses.jl` and visualizes example solution trajectories. The benchmark compares `VR_Direct`, `VR_DirectFW`, and `VR_FRM` aggregators for variable rate jumps, and includes a constant rate jump model with `Direct`. Visualization shows state variables vs. time to verify behavior. The test cases are: -1. **Scalar ODE with Variable Rate Jumps**: Solved with `Tsit5` and `Rosenbrock23` (with/without autodiff). +1. **Scalar ODE with Variable Rate Jumps**: Solved with `Tsit5` and `Rosenbrock23` (autodiff). 2. **Complex ODE with Variable Rate Jump**: Solved with `Tsit5`. 3. **DNA Gene Model**: ODE with 10 variable rate jumps from the RSSA paper, solved with `Tsit5`. +4. **Negative Feedback Gene Expression**: Constant rate jumps solved with `SSAStepper`, variable rate jumps with `Tsit5`, from Marchetti et al. (2017). -For visualization, we solve one trajectory per test case with 2 jumps. For benchmarking, we vary jumps from 1 to 20. +For visualization, we solve one trajectory per test case with 2 jumps (10 for Test 3, 8 for Test 4). For benchmarking, we vary jumps from 1 to 20 for Tests 1 and 2, use fixed jumps for Test 3 (10) and Test 4 (8), running 50 trajectories. Benchmarking saves only at the final time with `save_positions=(false, false)`. -# Benchmark and Visualization Setup +# Benchmark and Plot Test 1 -We define factories for each test case to create problems with a variable number of jumps. +We benchmark Test 1 for 1 to 20 jumps, running 50 trajectories, and plot mean execution times as a line plot. ```julia -algorithms = Tuple{Any, Any, String, String}[ - (VR_Direct(), Tsit5(), "VR_Direct", "Test 1 Tsit5 (VR_Direct)"), - (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 1 Tsit5 (VR_DirectFW)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 1 Tsit5 (VR_FRM)"), - (VR_Direct(), Rosenbrock23(autodiff=false), "VR_Direct", "Test 1 Rosenbrock23 (no autodiff, VR_Direct)"), - (VR_DirectFW(), Rosenbrock23(autodiff=false), "VR_DirectFW", "Test 1 Rosenbrock23 (no autodiff, VR_DirectFW)"), - (VR_FRM(), Rosenbrock23(autodiff=false), "VR_FRM", "Test 1 Rosenbrock23 (no autodiff, VR_FRM)"), - (VR_Direct(), Rosenbrock23(), "VR_Direct", "Test 1 Rosenbrock23 (autodiff, VR_Direct)"), - (VR_DirectFW(), Rosenbrock23(), "VR_DirectFW", "Test 1 Rosenbrock23 (autodiff, VR_DirectFW)"), - (VR_FRM(), Rosenbrock23(), "VR_FRM", "Test 1 Rosenbrock23 (autodiff, VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 2 Tsit5 (VR_Direct)"), - (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 2 Tsit5 (VR_DirectFW)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 2 Tsit5 (VR_FRM)"), - (VR_Direct(), Tsit5(), "VR_Direct", "Test 3 Tsit5 (VR_Direct, DNA Model)"), - (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 3 Tsit5 (VR_DirectFW, DNA Model)"), - (VR_FRM(), Tsit5(), "VR_FRM", "Test 3 Tsit5 (VR_FRM, DNA Model)"), -] - -function create_test1_problem(num_jumps, vr_aggregator, solver) - f = (du, u, p, t) -> (du[1] = u[1]) - prob = ODEProblem(f, [0.2], (0.0, 10.0)) - jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2); interp_points=100) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(jump_prob) - return ensemble_prob, jump_prob -end +let + algorithms = Tuple{Any, Any, String, String}[ + (VR_Direct(), Tsit5(), "VR_Direct", "Test 1 Tsit5 (VR_Direct)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 1 Tsit5 (VR_DirectFW)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 1 Tsit5 (VR_FRM)"), + (VR_Direct(), Rosenbrock23(), "VR_Direct", "Test 1 Rosenbrock23 (autodiff, VR_Direct)"), + (VR_DirectFW(), Rosenbrock23(), "VR_DirectFW", "Test 1 Rosenbrock23 (autodiff, VR_DirectFW)"), + (VR_FRM(), Rosenbrock23(), "VR_FRM", "Test 1 Rosenbrock23 (autodiff, VR_FRM)"), + ] -function create_test2_problem(num_jumps, vr_aggregator, solver) - f4 = (dx, x, p, t) -> (dx[1] = x[1]) - rate4 = (x, p, t) -> t - affect4! = (integrator) -> (integrator.u[1] = integrator.u[1] * 0.5) - prob = ODEProblem(f4, [1.0 + 0.0im], (0.0, 6.0)) - jumps = [VariableRateJump(rate4, affect4!) for _ in 1:num_jumps] - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(jump_prob) - return ensemble_prob, jump_prob -end + function create_test1_problem(num_jumps, vr_aggregator, solver) + f = (du, u, p, t) -> (du[1] = u[1]) + prob = ODEProblem(f, [0.2], (0.0, 10.0)) + jumps = [VariableRateJump((u, p, t) -> u[1], (integrator) -> (integrator.u[1] = integrator.u[1] / 2.0); interp_points=20) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng, save_positions=(false, false)) + ensemble_prob = EnsembleProblem(jump_prob) + return ensemble_prob, jump_prob + end + + num_jumps_range = append!([1], 5:5:20) + bs = Vector{Vector{BenchmarkTools.Trial}}() + errors = Dict{String, Vector{String}}() + + for (algo, stepper, agg_name, label) in algorithms + @info "Benchmarking $label" + push!(bs, Vector{BenchmarkTools.Trial}()) + errors[label] = String[] + _bs = bs[end] + for var in num_jumps_range + ensemble_prob, jump_prob = create_test1_problem(var, algo, stepper) + trial = try + @benchmark( + solve($jump_prob, $stepper, saveat=[$jump_prob.prob.tspan[2]]), + samples=50, + evals=1, + seconds=100 + ) + catch e + push!(errors[label], "Error at Num Jumps = $var: $(sprint(showerror, e))") + BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=50, evals=1, seconds=100)) + end + push!(_bs, trial) + mean_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(mean(trial.times)))" : "nan" + println("algo=$label, Num Jumps = $var, length = $(length(trial.times)), mean time = $mean_time") + end + end -function create_test3_problem(num_jumps, vr_aggregator, solver) - # Parameters from the RSSA paper - r = [0.043, 0.0007, 0.0715, 0.0039, 0.0199, 0.4791, 0.00019, 0.8765, 0.083, 0.5] - k = -log(2) / 30 - u0 = [10.0, 10.0, 30.0, 0.0, 0.0, 0.0] # [DNA, M, D, RNA, DNAD, DNA2D] - tspan = (0.0, 120.0) - - function f_dna(du, u, p, t) - du .= 0.0 - nothing - end - - # Define 10 variable rate jumps (fixed set, num_jumps ignored for consistency) - function rate1(u, p, t) r[1] * u[4] end - function affect1!(integrator) integrator.u[2] += 1; nothing end - jump1 = VariableRateJump(rate1, affect1!) - - function rate2(u, p, t) r[2] * u[2] end - function affect2!(integrator) integrator.u[2] -= 1; nothing end - jump2 = VariableRateJump(rate2, affect2!) - - function rate3(u, p, t) r[3] * u[5] end - function affect3!(integrator) integrator.u[4] += 1; nothing end - jump3 = VariableRateJump(rate3, affect3!) - - function rate4(u, p, t) r[4] * u[4] end - function affect4!(integrator) integrator.u[4] -= 1; nothing end - jump4 = VariableRateJump(rate4, affect4!) - - function rate5(u, p, t) r[5] * exp(k * t) * u[1] * u[3] end - function affect5!(integrator) integrator.u[1] -= 1; integrator.u[3] -= 1; integrator.u[5] += 1; nothing end - jump5 = VariableRateJump(rate5, affect5!) - - function rate6(u, p, t) r[6] * u[5] end - function affect6!(integrator) integrator.u[5] -= 1; integrator.u[1] += 1; integrator.u[3] += 1; nothing end - jump6 = VariableRateJump(rate6, affect6!) - - function rate7(u, p, t) r[7] * exp(k * t) * u[5] * u[3] end - function affect7!(integrator) integrator.u[5] -= 1; integrator.u[3] -= 1; integrator.u[6] += 1; nothing end - jump7 = VariableRateJump(rate7, affect7!) - - function rate8(u, p, t) r[8] * u[6] end - function affect8!(integrator) integrator.u[6] -= 1; integrator.u[1] += 1; integrator.u[3] += 1; nothing end - jump8 = VariableRateJump(rate8, affect8!) - - function rate9(u, p, t) r[9] * exp(k * t) * u[2] * (u[2] - 1) / 2 end - function affect9!(integrator) integrator.u[2] -= 2; integrator.u[3] += 1; nothing end - jump9 = VariableRateJump(rate9, affect9!) - - function rate10(u, p, t) r[10] * u[3] end - function affect10!(integrator) integrator.u[3] -= 1; integrator.u[2] += 2; nothing end - jump10 = VariableRateJump(rate10, affect10!) - - prob = ODEProblem(f_dna, u0, tspan) - jumps = (jump1, jump2, jump3, jump4, jump5, jump6, jump7, jump8, jump9, jump10) - jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng) - ensemble_prob = EnsembleProblem(jump_prob) - return ensemble_prob, jump_prob + # Log errors + for (label, err_list) in errors + if !isempty(err_list) + @warn "Errors for $label:" + for err in err_list + println(err) + end + end + end + + # Plot results + fig = plot( + yscale=:log10, + xlabel="Number of Jumps", + ylabel="Time (ns)", + legend_position=:outertopright, + title="Test 1: Simulations, 50 samples" + ) + for (i, (algo, stepper, agg_name, label)) in enumerate(algorithms) + _bs, _vars = [], [] + for (j, b) in enumerate(bs[i]) + if length(b) == 50 + push!(_bs, mean(b.times)) + push!(_vars, num_jumps_range[j]) + end + end + if !isempty(_bs) + plot!(_vars, _bs, label=label) + else + @warn "No valid data for $label in Test 1" + end + end + display(plot(fig, layout=(1, 1), format=fmt, size=(width_px, height_px))) end ``` -# Benchmark Execution +# Benchmark and Plot Test 2 -We benchmark each test case for 1 to 20 jumps. Errors are logged to diagnose failures. +We benchmark Test 2 for 1 to 20 jumps, running 50 trajectories, and plot mean execution times as a line plot. ```julia -num_jumps_range = append!([1], 5:5:20) -bs = Vector{Vector{BenchmarkTools.Trial}}() -errors = Dict{String, Vector{String}}() - -for (algo, stepper, agg_name, label) in algorithms - @info label - push!(bs, Vector{BenchmarkTools.Trial}()) - errors[label] = String[] - _bs = bs[end] - test_num = parse(Int, match(r"Test (\d+)", label).captures[1]) - range_var = num_jumps_range - for (i, var) in enumerate(range_var) - if test_num == 1 - ensemble_prob, jump_prob = create_test1_problem(var, algo, stepper) - elseif test_num == 2 +let + algorithms = Tuple{Any, Any, String, String}[ + (VR_Direct(), Tsit5(), "VR_Direct", "Test 2 Tsit5 (VR_Direct)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 2 Tsit5 (VR_DirectFW)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 2 Tsit5 (VR_FRM)"), + ] + + function create_test2_problem(num_jumps, vr_aggregator, solver) + f4 = (dx, x, p, t) -> (dx[1] = x[1]) + rate4 = (x, p, t) -> t + affect4! = (integrator) -> (integrator.u[1] = integrator.u[1] * 0.5) + prob = ODEProblem(f4, [1.0 + 0.0im], (0.0, 6.0)) + jumps = [VariableRateJump(rate4, affect4!) for _ in 1:num_jumps] + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng, save_positions=(false, false)) + ensemble_prob = EnsembleProblem(jump_prob) + return ensemble_prob, jump_prob + end + + num_jumps_range = append!([1], 5:5:20) + bs = Vector{Vector{BenchmarkTools.Trial}}() + errors = Dict{String, Vector{String}}() + + for (algo, stepper, agg_name, label) in algorithms + @info "Benchmarking $label" + push!(bs, Vector{BenchmarkTools.Trial}()) + errors[label] = String[] + _bs = bs[end] + for var in num_jumps_range ensemble_prob, jump_prob = create_test2_problem(var, algo, stepper) - elseif test_num == 3 - ensemble_prob, jump_prob = create_test3_problem(var, algo, stepper) + trial = try + @benchmark( + solve($jump_prob, $stepper, saveat=[$jump_prob.prob.tspan[2]]), + samples=50, + evals=1, + seconds=100 + ) + catch e + push!(errors[label], "Error at Num Jumps = $var: $(sprint(showerror, e))") + BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=50, evals=1, seconds=100)) + end + push!(_bs, trial) + mean_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(mean(trial.times)))" : "nan" + println("algo=$label, Num Jumps = $var, length = $(length(trial.times)), mean time = $mean_time") end - trial = try - @benchmark( - solve($jump_prob, $stepper), - samples=50, - evals=1, - seconds=10 - ) - catch e - push!(errors[label], "Error at Num Jumps = $var: $(sprint(showerror, e))") - BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=50, evals=1, seconds=10)) + end + + # Log errors + for (label, err_list) in errors + if !isempty(err_list) + @warn "Errors for $label:" + for err in err_list + println(err) + end end - push!(_bs, trial) + end - median_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(median(trial.times)))" : "nan" - println("algo=$label, Num Jumps = $var, length = $(length(trial.times)), median time = $median_time") + # Plot results + fig = plot( + yscale=:log10, + xlabel="Number of Jumps", + ylabel="Time (ns)", + legend_position=:outertopright, + title="Test 2: Simulations, 50 samples" + ) + for (i, (algo, stepper, agg_name, label)) in enumerate(algorithms) + _bs, _vars = [], [] + for (j, b) in enumerate(bs[i]) + if length(b) == 50 + push!(_bs, mean(b.times)) + push!(_vars, num_jumps_range[j]) + end + end + if !isempty(_bs) + plot!(_vars, _bs, label=label) + else + @warn "No valid data for $label in Test 2" + end end + display(plot(fig, layout=(1, 1), format=fmt, size=(width_px, height_px))) end +``` + +# Benchmark and Plot Test 3 + +We benchmark Test 3 for fixed 10 jumps, running 50 trajectories, and plot mean execution times as a bar plot. + +```julia +let + algorithms = Tuple{Any, Any, String, String}[ + (VR_Direct(), Tsit5(), "VR_Direct", "Test 3 Tsit5 (VR_Direct, DNA Model)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 3 Tsit5 (VR_DirectFW, DNA Model)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 3 Tsit5 (VR_FRM, DNA Model)"), + ] -# Log errors -for (label, err_list) in errors - if !isempty(err_list) - @warn "Errors for $label:" - for err in err_list - println(err) + function create_test3_problem(num_jumps, vr_aggregator, solver) + r = [0.043, 0.0007, 0.0715, 0.0039, 0.0199, 0.4791, 0.00019, 0.8765, 0.083, 0.5] + k = -log(2) / 30 + u0 = [10.0, 10.0, 30.0, 0.0, 0.0, 0.0] # [DNA, M, D, RNA, DNAD, DNA2D] + tspan = (0.0, 120.0) + + function f_dna(du, u, p, t) + du .= 0.0 + nothing end + + function rate1(u, p, t) r[1] * u[4] end + function affect1!(integrator) integrator.u[2] += 1; nothing end + jump1 = VariableRateJump(rate1, affect1!) + + function rate2(u, p, t) r[2] * u[2] end + function affect2!(integrator) integrator.u[2] -= 1; nothing end + jump2 = VariableRateJump(rate2, affect2!) + + function rate3(u, p, t) r[3] * u[5] end + function affect3!(integrator) integrator.u[4] += 1; nothing end + jump3 = VariableRateJump(rate3, affect3!) + + function rate4(u, p, t) r[4] * u[4] end + function affect4!(integrator) integrator.u[4] -= 1; nothing end + jump4 = VariableRateJump(rate4, affect4!) + + function rate5(u, p, t) r[5] * exp(k * t) * u[1] * u[3] end + function affect5!(integrator) integrator.u[1] -= 1; integrator.u[3] -= 1; integrator.u[5] += 1; nothing end + jump5 = VariableRateJump(rate5, affect5!) + + function rate6(u, p, t) r[6] * u[5] end + function affect6!(integrator) integrator.u[5] -= 1; integrator.u[1] += 1; integrator.u[3] += 1; nothing end + jump6 = VariableRateJump(rate6, affect6!) + + function rate7(u, p, t) r[7] * exp(k * t) * u[5] * u[3] end + function affect7!(integrator) integrator.u[5] -= 1; integrator.u[3] -= 1; integrator.u[6] += 1; nothing end + jump7 = VariableRateJump(rate7, affect7!) + + function rate8(u, p, t) r[8] * u[6] end + function affect8!(integrator) integrator.u[6] -= 1; integrator.u[1] += 1; integrator.u[3] += 1; nothing end + jump8 = VariableRateJump(rate8, affect8!) + + function rate9(u, p, t) r[9] * exp(k * t) * u[2] * (u[2] - 1) / 2 end + function affect9!(integrator) integrator.u[2] -= 2; integrator.u[3] += 1; nothing end + jump9 = VariableRateJump(rate9, affect9!) + + function rate10(u, p, t) r[10] * u[3] end + function affect10!(integrator) integrator.u[3] -= 1; integrator.u[2] += 2; nothing end + jump10 = VariableRateJump(rate10, affect10!) + + prob = ODEProblem(f_dna, u0, tspan) + jumps = (jump1, jump2, jump3, jump4, jump5, jump6, jump7, jump8, jump9, jump10) + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=vr_aggregator, rng=rng, save_positions=(false, false)) + ensemble_prob = EnsembleProblem(jump_prob) + return ensemble_prob, jump_prob end + + num_jumps_range = [10] + bs = Vector{Vector{BenchmarkTools.Trial}}() + errors = Dict{String, Vector{String}}() + + for (algo, stepper, agg_name, label) in algorithms + @info "Benchmarking $label" + push!(bs, Vector{BenchmarkTools.Trial}()) + errors[label] = String[] + _bs = bs[end] + for var in num_jumps_range + ensemble_prob, jump_prob = create_test3_problem(var, algo, stepper) + trial = try + @benchmark( + solve($jump_prob, $stepper, saveat=[$jump_prob.prob.tspan[2]]), + samples=50, + evals=1, + seconds=100 + ) + catch e + push!(errors[label], "Error at Num Jumps = $var: $(sprint(showerror, e))") + BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=50, evals=1, seconds=100)) + end + push!(_bs, trial) + mean_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(mean(trial.times)))" : "nan" + println("algo=$label, Num Jumps = $var, length = $(length(trial.times)), mean time = $mean_time") + end + end + + # Log errors + for (label, err_list) in errors + if !isempty(err_list) + @warn "Errors for $label:" + for err in err_list + println(err) + end + end + end + + # Plot results + fig = plot( + yscale=:log10, + xlabel="Method", + ylabel="Time (ns)", + title="Test 3: DNA Model, 10 Jumps, 50 samples", + xticks=(1:length(algorithms), [split(a[3], " (")[1] for a in algorithms]), + xrotation=45 + ) + means = [] + for (i, (algo, stepper, agg_name, label)) in enumerate(algorithms) + b = bs[i][1] # Single jump count (10) + if length(b) == 50 + push!(means, mean(b.times)) + else + push!(means, NaN) + @warn "No valid data for $label in Test 3" + end + end + bar!(1:length(algorithms), means, label="", fillalpha=0.7) + display(plot(fig, layout=(1, 1), format=fmt, size=(width_px, height_px))) end ``` -# Benchmark Results +# Benchmark and Plot Test 4 -We plot the median execution times for each test case, comparing `VR_Direct`,`VR_DirectFW` and `VR_FRM`. +We benchmark Test 4 for fixed 8 jumps, running 50 trajectories, and plot mean execution times as a bar plot. ```julia -let figs = [] - for test_num in 1:3 - test_algorithms = filter(a -> parse(Int, match(r"Test (\d+)", a[4]).captures[1]) == test_num, algorithms) - range_var = num_jumps_range - fig = plot( - yscale=:log10, - xlabel="Number of Jumps", - ylabel="Time (ns)", - legend_position=:outertopright, - title="Test $test_num: Simulations, 50 samples" - ) - for (i, (algo, stepper, agg_name, label)) in enumerate(test_algorithms) - algo_idx = findfirst(a -> a[4] == label, algorithms) - _bs, _vars = [], [] - for (j, b) in enumerate(bs[algo_idx]) - if length(b) == 50 - push!(_bs, median(b.times)) - push!(_vars, range_var[j]) - end +let + algorithms = Tuple{Any, Any, String, String}[ + #(Direct(), SSAStepper(), "Direct", "Test 4 SSAStepper (Direct, NegFeedback, Constant Rate)"), + (VR_Direct(), Tsit5(), "VR_Direct", "Test 4 Tsit5 (VR_Direct, NegFeedback, Variable Rate)"), + (VR_DirectFW(), Tsit5(), "VR_DirectFW", "Test 4 Tsit5 (VR_DirectFW, NegFeedback, Variable Rate)"), + (VR_FRM(), Tsit5(), "VR_FRM", "Test 4 Tsit5 (VR_FRM, NegFeedback, Variable Rate)"), + ] + + function create_test4_problem(num_jumps, aggregator, solver) + rn = @reaction_network begin + c1, G --> G + M + c2, M --> M + P + c3, M --> 0 + c4, P --> 0 + c5, 2P --> P2 + c6, P2 --> 2P + c7, P2 + G --> P2G + c8, P2G --> P2 + G + end + rnpar = [:c1 => 0.09, :c2 => 0.05, :c3 => 0.001, :c4 => 0.0009, :c5 => 0.00001, + :c6 => 0.0005, :c7 => 0.005, :c8 => 0.9] + u0 = [:G => 500, :M => 0, :P => 0, :P2 => 0, :P2G => 0] + tspan = (0.0, 100.0) + + if aggregator isa Direct + prob = DiscreteProblem(rn, u0, tspan, rnpar) + jump_prob = JumpProblem(rn, prob, Direct(), rng=rng, save_positions=(false, false)) + ensemble_prob = EnsembleProblem(jump_prob) + else + function f_gene(du, u, p, t) + du .= 0.0 + nothing + end + u0_numeric = [500.0, 0.0, 0.0, 0.0, 0.0] + p_numeric = [0.09, 0.05, 0.001, 0.0009, 0.00001, 0.0005, 0.005, 0.9] + var_rate = true + prob = ODEProblem(f_gene, u0_numeric, tspan, (p_numeric, var_rate)) + + function rate1(u, p, t) p[1][1] * (p[2] ? (1 + 0.1 * sin(t)) : 1.0) * u[1] end + function affect1!(integrator) integrator.u[2] += 1; nothing end + jump1 = VariableRateJump(rate1, affect1!) + + function rate2(u, p, t) p[1][2] * u[2] end + function affect2!(integrator) integrator.u[3] += 1; nothing end + jump2 = VariableRateJump(rate2, affect2!) + + function rate3(u, p, t) p[1][3] * u[2] end + function affect3!(integrator) integrator.u[2] -= 1; nothing end + jump3 = VariableRateJump(rate3, affect3!) + + function rate4(u, p, t) p[1][4] * u[3] end + function affect4!(integrator) integrator.u[3] -= 1; nothing end + jump4 = VariableRateJump(rate4, affect4!) + + function rate5(u, p, t) p[1][5] * (p[2] ? (1 + 0.1 * cos(t)) : 1.0) * u[3] * (u[3] - 1) / 2 end + function affect5!(integrator) integrator.u[3] -= 2; integrator.u[4] += 1; nothing end + jump5 = VariableRateJump(rate5, affect5!) + + function rate6(u, p, t) p[1][6] * u[4] end + function affect6!(integrator) integrator.u[4] -= 1; integrator.u[3] += 2; nothing end + jump6 = VariableRateJump(rate6, affect6!) + + function rate7(u, p, t) p[1][7] * u[4] * u[1] end + function affect7!(integrator) integrator.u[4] -= 1; integrator.u[1] -= 1; integrator.u[5] += 1; nothing end + jump7 = VariableRateJump(rate7, affect7!) + + function rate8(u, p, t) p[1][8] * u[5] end + function affect8!(integrator) integrator.u[5] -= 1; integrator.u[4] += 1; integrator.u[1] += 1; nothing end + jump8 = VariableRateJump(rate8, affect8!) + + jumps = (jump1, jump2, jump3, jump4, jump5, jump6, jump7, jump8) + jump_prob = JumpProblem(prob, Direct(), jumps...; vr_aggregator=aggregator, rng=rng, save_positions=(false, false)) + ensemble_prob = EnsembleProblem(jump_prob) + end + return ensemble_prob, jump_prob + end + + num_jumps_range = [8] + bs = Vector{Vector{BenchmarkTools.Trial}}() + errors = Dict{String, Vector{String}}() + + for (algo, stepper, agg_name, label) in algorithms + @info "Benchmarking $label" + push!(bs, Vector{BenchmarkTools.Trial}()) + errors[label] = String[] + _bs = bs[end] + for var in num_jumps_range + ensemble_prob, jump_prob = create_test4_problem(var, algo, stepper) + trial = try + @benchmark( + solve($jump_prob, $stepper, saveat=[$jump_prob.prob.tspan[2]]), + samples=50, + evals=1, + seconds=1000 + ) + catch e + push!(errors[label], "Error at Num Jumps = $var: $(sprint(showerror, e))") + BenchmarkTools.Trial(BenchmarkTools.Parameters(samples=10, evals=1, seconds=1000)) end - if !isempty(_bs) - plot!(_vars, _bs, label=label) - else - @warn "No valid data for $label in Test $test_num" + push!(_bs, trial) + mean_time = length(trial) > 0 ? "$(BenchmarkTools.prettytime(mean(trial.times)))" : "nan" + println("algo=$label, Num Jumps = $var, length = $(length(trial.times)), mean time = $mean_time") + end + end + + # Log errors + for (label, err_list) in errors + if !isempty(err_list) + @warn "Errors for $label:" + for err in err_list + println(err) end end - push!(figs, fig) end - plot(figs..., layout=(3, 1), format=fmt, size=(width_px, 4*height_px)) + + # Plot results + fig = plot( + yscale=:log10, + xlabel="Method", + ylabel="Time (ns)", + title="Test 4: NegFeedback, 8 Jumps, 50 samples", + xticks=(1:length(algorithms), [split(a[3], " (")[1] for a in algorithms]), + xrotation=45 + ) + means = [] + for (i, (algo, stepper, agg_name, label)) in enumerate(algorithms) + b = bs[i][1] # Single jump count (8) + if length(b) == 50 + push!(means, mean(b.times)) + else + push!(means, NaN) + @warn "No valid data for $label in Test 4" + end + end + bar!(1:length(algorithms), means, label="", fillalpha=0.7) + display(plot(fig, layout=(1, 1), format=fmt, size=(width_px, height_px))) end ``` \ No newline at end of file From 42a2d3bd68335d851a24d9f6786a2971c58af017 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Thu, 12 Jun 2025 01:37:37 +0530 Subject: [PATCH 12/15] Added benchmark in Synapse --- benchmarks/HybridJumps/Synapse.jmd | 51 ++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/benchmarks/HybridJumps/Synapse.jmd b/benchmarks/HybridJumps/Synapse.jmd index 66e21e280..43b0e0c22 100644 --- a/benchmarks/HybridJumps/Synapse.jmd +++ b/benchmarks/HybridJumps/Synapse.jmd @@ -1954,7 +1954,8 @@ function SynapseProblem( p_synapse, nu, algo::T, - agg = nothing; + agg = nothing + vr_agg = VR_FRM(); saveat = [], save_everystep = isempty(saveat), kwargs..., @@ -2127,7 +2128,8 @@ function SynapseProblem( p_synapse, nu, algo, - agg; + agg + vr_agg; jumps = nothing, save_positions = (false, true), saveat = [], @@ -2158,6 +2160,7 @@ function SynapseProblem( oprob, agg, jumps; + vr_aggregator = vr_agg, dep_graph, save_positions, saveat, @@ -2185,7 +2188,8 @@ function evolveSynapse( is_glu_released, nu, algos, - agg = nothing; + agg = nothing + vr_agg = VR_FRM(); progress = false, abstol = 1e-8, reltol = 1e-7, @@ -2204,7 +2208,8 @@ function evolveSynapse( is_glu_released, nu, algos, - agg; + agg + vr_agg; progress, abstol, reltol, @@ -2227,7 +2232,8 @@ function evolveSynapse_noformat( is_glu_released, nu, algos, - agg = nothing; + agg = nothing + vr_agg = VR_FRM(); progress = false, abstol = 1e-8, reltol = 1e-7, @@ -2273,7 +2279,8 @@ function evolveSynapse_noformat( p_synapse, nu, algos[1], - agg; + agg + vr_agg; jumps, reltol, abstol, @@ -2295,7 +2302,8 @@ function evolveSynapse_noformat( p_synapse, nu, algos[2], - agg; + agg + vr_agg; jumps, reltol, abstol, @@ -2415,12 +2423,35 @@ const algorithms = ( ( label = "PDMP", agg = nothing, + vr_agg = VR_FRM(), solver = (CHV(solver), CHV(solver)), saveat = [], ), ( label = "Coevolve", agg = Coevolve(), + vr_agg = VR_FRM(), + solver = (solver, solver), + saveat = 1 / p_synapse.sampling_rate, + ), + ( + label = "VR_Direct", + agg = Coevolve(), + vr_agg = VR_Direct(), + solver = (solver, solver), + saveat = 1 / p_synapse.sampling_rate, + ), + ( + label = "VR_DirectFW", + agg = Coevolve(), + vr_agg = VR_DirectFW(), + solver = (solver, solver), + saveat = 1 / p_synapse.sampling_rate, + ), + ( + label = "VR_FRM", + agg = Coevolve(), + vr_agg = VR_FRM(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate, ), @@ -2445,7 +2476,8 @@ for algo in algorithms [true], nu, algo.solver, - algo.agg; + algo.agg + alg.vr_agg; save_positions = (false, true), saveat = algo.saveat, save_everystep = false, @@ -2491,7 +2523,8 @@ for algo in algorithms [true], nu, $(algo).solver, - $(algo).agg; + $(algo).agg + $(algo).vr_agg; save_positions = (false, true), saveat = $(algo).saveat, save_everystep = false, From d2c8148585cd28bb71ea7de88645771a85807bf5 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Thu, 12 Jun 2025 02:50:41 +0530 Subject: [PATCH 13/15] added benchmark for hawkes --- benchmarks/HybridJumps/MultivariateHawkes.jmd | 97 ++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/benchmarks/HybridJumps/MultivariateHawkes.jmd b/benchmarks/HybridJumps/MultivariateHawkes.jmd index ecf52e137..4fd8be9c8 100644 --- a/benchmarks/HybridJumps/MultivariateHawkes.jmd +++ b/benchmarks/HybridJumps/MultivariateHawkes.jmd @@ -117,6 +117,7 @@ end function hawkes_problem( p, agg; + vr_agg = VR_FRM(), u = [0.0], tspan = (0.0, 50.0), save_positions = (false, true), @@ -125,7 +126,7 @@ function hawkes_problem( ) oprob = ODEProblem(f!, u, tspan, p) jumps = hawkes_jump(u, g; use_recursion) - jprob = JumpProblem(oprob, agg, jumps...; save_positions = save_positions) + jprob = JumpProblem(oprob, agg, jumps...; vr_aggregator = vr_agg, save_positions = save_positions) return jprob end ``` @@ -840,6 +841,100 @@ let fig = plot( end ``` +# Benchmarking Variable Rate Aggregators + +We benchmark the variable rate aggregators (`VR_Direct`, `VR_DirectFW`, `VR_FRM`) for the Multivariate Hawkes process, using the same setup as above: networks from `1` to `50` nodes, `tspan=(0.0, 25.0)`, `\lambda=0.5`, `\alpha=0.1`, `\beta=5.0`, and 50 trajectories with a 10-second limit per configuration. We test both recursive and brute-force formulations. + +```julia +vr_aggs = [ + (VR_Direct(), Tsit5(), false, "VR_Direct (brute-force)"), + (VR_DirectFW(), Tsit5(), false, "VR_DirectFW (brute-force)"), + (VR_FRM(), Tsit5(), false, "VR_FRM (brute-force)"), + (VR_Direct(), Tsit5(), true, "VR_Direct (recursive)"), + (VR_DirectFW(), Tsit5(), true, "VR_DirectFW (recursive)"), + (VR_FRM(), Tsit5(), true, "VR_FRM (recursive)"), +] + +tspan = (0.0, 25.0) +p = (0.5, 0.1, 5.0) +Vs = append!([1], 5:5:95) +Gs = [erdos_renyi(V, 0.2, seed = 6221) for V in Vs] + +vr_bs = Vector{Vector{BenchmarkTools.Trial}}() + +for (vr_agg, stepper, use_recursion, label) in vr_aggs + @info label + global _stepper = stepper + push!(vr_bs, Vector{BenchmarkTools.Trial}()) + _vr_bs = vr_bs[end] + for (i, G) in enumerate(Gs) + local g = [neighbors(G, i) for i in 1:nv(G)] + local u = [0.0 for i in 1:nv(G)] + if use_recursion + global h = zeros(eltype(tspan), nv(G)) + global urate = zeros(eltype(u), nv(G)) + global ϕ = zeros(eltype(tspan), nv(G)) + _p = (p[1], p[2], p[3], h, urate, ϕ) + else + global h = [eltype(tspan)[] for _ in 1:nv(G)] + global urate = zeros(eltype(u), nv(G)) + _p = (p[1], p[2], p[3], h, urate) + end + global jump_prob = hawkes_problem(_p, Direct(); vr_agg, u, tspan, g, use_recursion) + trial = try + if use_recursion + @benchmark( + solve(jump_prob, _stepper), + setup = (h .= 0; urate .= 0; ϕ .= 0), + samples = 50, + evals = 1, + seconds = 10, + ) + else + @benchmark( + solve(jump_prob, _stepper), + setup = ([empty!(_h) for _h in h]; urate .= 0), + samples = 50, + evals = 1, + seconds = 10, + ) + end + catch e + BenchmarkTools.Trial( + BenchmarkTools.Parameters(samples=50, evals=1, seconds=10), + ) + end + push!(_vr_bs, trial) + if (nv(G) == 1 || nv(G) % 10 == 0) + median_time = + length(trial) > 0 ? "$(BenchmarkTools.prettytime(median(trial.times)))" : "nan" + println("algo=$label, V=$(nv(G)), length=$(length(trial.times)), median time=$median_time") + end + end +end +``` + +```julia +let fig = plot( + yscale = :log10, + xlabel = "V", + ylabel = "Time (ns)", + legend_position = :outertopright, +) + for (i, (vr_agg, _, use_recursion, label)) in enumerate(vr_aggs) + _bs, _Vs = [], [] + for (j, b) in enumerate(vr_bs[i]) + if length(b) == 50 + push!(_bs, median(b.times)) + push!(_Vs, Vs[j]) + end + end + plot!(_Vs, _bs, label=label) + end + title!("Variable Rate Simulations, 50 samples: nodes × time") +end +``` + # References [1] D. J. Daley and D. Vere-Jones. An Introduction to the Theory of Point Processes: Volume I: Elementary Theory and Methods. Probability and Its Applications, An Introduction to the Theory of Point Processes. Springer-Verlag, 2 edition. doi:10.1007/b97277. From 242563a70649296665407a8313b7f20a1f6b35bc Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Thu, 12 Jun 2025 14:30:12 +0530 Subject: [PATCH 14/15] bug in benchmarking fixed --- benchmarks/HybridJumps/Synapse.jmd | 49 ++++++++----------- .../HybridJumps/VR_Aggregator_Benchmark.jmd | 2 +- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/benchmarks/HybridJumps/Synapse.jmd b/benchmarks/HybridJumps/Synapse.jmd index 43b0e0c22..874f16e87 100644 --- a/benchmarks/HybridJumps/Synapse.jmd +++ b/benchmarks/HybridJumps/Synapse.jmd @@ -1954,8 +1954,8 @@ function SynapseProblem( p_synapse, nu, algo::T, - agg = nothing - vr_agg = VR_FRM(); + agg = nothing; + vr_agg = VR_FRM(), saveat = [], save_everystep = isempty(saveat), kwargs..., @@ -2128,8 +2128,8 @@ function SynapseProblem( p_synapse, nu, algo, - agg - vr_agg; + agg; + vr_agg = VR_FRM(), jumps = nothing, save_positions = (false, true), saveat = [], @@ -2188,8 +2188,8 @@ function evolveSynapse( is_glu_released, nu, algos, - agg = nothing - vr_agg = VR_FRM(); + agg = nothing; + vr_agg, progress = false, abstol = 1e-8, reltol = 1e-7, @@ -2208,8 +2208,8 @@ function evolveSynapse( is_glu_released, nu, algos, - agg - vr_agg; + agg; + vr_agg, progress, abstol, reltol, @@ -2232,8 +2232,8 @@ function evolveSynapse_noformat( is_glu_released, nu, algos, - agg = nothing - vr_agg = VR_FRM(); + agg = nothing; + vr_agg, progress = false, abstol = 1e-8, reltol = 1e-7, @@ -2279,8 +2279,8 @@ function evolveSynapse_noformat( p_synapse, nu, algos[1], - agg - vr_agg; + agg; + vr_agg, jumps, reltol, abstol, @@ -2302,8 +2302,8 @@ function evolveSynapse_noformat( p_synapse, nu, algos[2], - agg - vr_agg; + agg; + vr_agg, jumps, reltol, abstol, @@ -2428,33 +2428,26 @@ const algorithms = ( saveat = [], ), ( - label = "Coevolve", + label = "Coevolve(VR_FRM)", agg = Coevolve(), vr_agg = VR_FRM(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate, ), ( - label = "VR_Direct", + label = "Coevolve(VR_Direct)", agg = Coevolve(), vr_agg = VR_Direct(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate, ), ( - label = "VR_DirectFW", + label = "Coevolve(VR_DirectFW)", agg = Coevolve(), vr_agg = VR_DirectFW(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate, ), - ( - label = "VR_FRM", - agg = Coevolve(), - vr_agg = VR_FRM(), - solver = (solver, solver), - saveat = 1 / p_synapse.sampling_rate, - ), ); ``` @@ -2476,8 +2469,8 @@ for algo in algorithms [true], nu, algo.solver, - algo.agg - alg.vr_agg; + algo.agg; + algo.vr_agg, save_positions = (false, true), saveat = algo.saveat, save_everystep = false, @@ -2523,8 +2516,8 @@ for algo in algorithms [true], nu, $(algo).solver, - $(algo).agg - $(algo).vr_agg; + $(algo).agg; + $(algo).vr_agg, save_positions = (false, true), saveat = $(algo).saveat, save_everystep = false, diff --git a/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd b/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd index 5483ef6ce..a93e2fea5 100644 --- a/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd +++ b/benchmarks/HybridJumps/VR_Aggregator_Benchmark.jmd @@ -6,7 +6,7 @@ weave_options: --- ```julia -using DiffEqBase, JumpProcesses, OrdinaryDiffEq, StochasticDiffEq +using DiffEqBase, Catalyst, JumpProcesses, OrdinaryDiffEq, StochasticDiffEq using Random, LinearSolve, StableRNGs, BenchmarkTools, Plots, LinearAlgebra fmt = :png width_px, height_px = default(:size) From e7531a7ff0ed3563ac8596c40060a846ddf6feb8 Mon Sep 17 00:00:00 2001 From: sivasathyaseeelan Date: Fri, 13 Jun 2025 23:02:40 +0530 Subject: [PATCH 15/15] Direct() for Synapse methord --- benchmarks/HybridJumps/Synapse.jmd | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/benchmarks/HybridJumps/Synapse.jmd b/benchmarks/HybridJumps/Synapse.jmd index 874f16e87..4eee4ed9b 100644 --- a/benchmarks/HybridJumps/Synapse.jmd +++ b/benchmarks/HybridJumps/Synapse.jmd @@ -1640,7 +1640,7 @@ function J_synapse(p_synapse::SynapseParams, nu) # we order the jumps in their order they appear in the dependency graph jumps = JumpSet(; - constant_jumps = [ + constant_jumps = ( # AMPA #2line-GO @j_jump(1, p_synapse, nu, 4 * AMPA_k1 * p.Glu * p.xd[1]), # 1 @@ -1740,8 +1740,8 @@ function J_synapse(p_synapse::SynapseParams, nu) @j_jump(97, p_synapse, nu, GABA_r_c1 * p.xd[49]), # 97 @j_jump(98, p_synapse, nu, GABA_r_ro2 * p.xd[48]), # 98 @j_jump(99, p_synapse, nu, GABA_r_c2 * p.xd[50]), # 99 - ], - variable_jumps = [ + ), + variable_jumps = ( # R-type VGCC @j_jump( 56, @@ -1913,7 +1913,7 @@ function J_synapse(p_synapse::SynapseParams, nu) @j_jump(77, p_synapse, nu, p.xd[37] * P_rate, 1, typemax(Float64)), # 77 @j_jump(78, p_synapse, nu, p.xd[36] * P_rate, 1, typemax(Float64)), # 78 @j_jump(79, p_synapse, nu, p.xd[38] * D_rate, 1, typemax(Float64)), # 79 - ], + ), ) return jumps @@ -2428,22 +2428,29 @@ const algorithms = ( saveat = [], ), ( - label = "Coevolve(VR_FRM)", + label = "Coevolve", agg = Coevolve(), vr_agg = VR_FRM(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate, ), ( - label = "Coevolve(VR_Direct)", - agg = Coevolve(), + label = "Direct(VR_FRM)", + agg = Direct(), + vr_agg = VR_FRM(), + solver = (solver, solver), + saveat = 1 / p_synapse.sampling_rate, + ), + ( + label = "Direct(VR_Direct)", + agg = Direct(), vr_agg = VR_Direct(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate, ), ( - label = "Coevolve(VR_DirectFW)", - agg = Coevolve(), + label = "Direct(VR_DirectFW)", + agg = Direct(), vr_agg = VR_DirectFW(), solver = (solver, solver), saveat = 1 / p_synapse.sampling_rate,