Skip to content

Commit 75fdc56

Browse files
Merge pull request #3161 from vyudu/MTK
fixing record from solution for observables in the BifurcationKit extension
2 parents 91eabc7 + e27da93 commit 75fdc56

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ext/MTKBifurcationKitExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct ObservableRecordFromSolution{S, T}
5959
end
6060
end
6161
# Functor function that computes the value.
62-
function (orfs::ObservableRecordFromSolution)(x, p)
62+
function (orfs::ObservableRecordFromSolution)(x, p; k...)
6363
# Updates the state values (in subs_vals).
6464
for state_idx in 1:(orfs.state_end_idxs)
6565
orfs.subs_vals[state_idx] = orfs.subs_vals[state_idx][1] => x[state_idx]

test/extensions/bifurcationkit.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,12 @@ let
162162
bf = bifurcationdiagram(bp, PALC(), 2, opts_br)
163163

164164
@test bf.γ.specialpoint[1].param0.1 atol=1e-4 rtol=1e-4
165+
166+
# Test with plot variable as observable
167+
pvar = ModelingToolkit.get_var_to_name(fol)[:RHS]
168+
bp = BifurcationProblem(fol, u0, par, bif_par; plot_var = pvar)
169+
opts_br = ContinuationPar(p_min = -1.0,
170+
p_max = 1.0)
171+
bf = bifurcationdiagram(bp, PALC(), 2, opts_br)
172+
@test bf.γ.specialpoint[1].param0.1 atol=1e-4 rtol=1e-4
165173
end

0 commit comments

Comments
 (0)