Skip to content

Commit d027fae

Browse files
committed
Set τrec if it is not nothing
1 parent f23df29 commit d027fae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/solve.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,12 @@ function solvebg(bgprob::ODEProblem; alg = DEFAULT_BGALG, reltol = 1e-9, abstol
332332
if !successful_retcode(bgsol)
333333
@warn warning_failed_solution(bgsol, "Background"; verbose)
334334
end
335-
if Symbol("τrec") in Symbol.(parameters(bgprob.f.sys))
336-
τrecidx = ModelingToolkit.parameter_index(bgprob, :τrec)
335+
336+
τrecidx = ModelingToolkit.parameter_index(bgprob, :τrec)
337+
if !isnothing(τrecidx)
337338
bgsol.ps[τrecidx] = bgsol[][argmax(bgsol[bgprob.f.sys.b.v])]
338339
end
340+
339341
return bgsol
340342
end
341343
# TODO: more generic shooting method that can do anything (e.g. S8)

0 commit comments

Comments
 (0)