Skip to content

Commit

Permalink
Finish bifurcation function
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed Nov 1, 2023
1 parent 06aea47 commit 2065fb4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
# Creates a BifurcationProblem, using a ReactionSystem as an input.
function BK.BifurcationProblem(rs::ReactionSystem, u0_bif, ps, bif_par, args...; plot_var=nothing, record_from_solution=BK.record_sol_default, jac=true, u0=[], kwargs...)

Check warning on line 4 in ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl

View check run for this annotation

Codecov / codecov/patch

ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl#L4

Added line #L4 was not covered by tests

println("HERE")

# Converts symbols to symbolics.
(bif_par isa Symbol) && (bif_par = rs.var_to_name[bif_par])
(plot_var isa Symbol) && (plot_var = rs.var_to_name[plot_var])
(u0_bif isa Vector{Symbol}) && (u0_bif = symmap_to_varmap(rs, u0_bif))
(ps isa Vector{Symbol}) && (ps = symmap_to_varmap(rs, ps))

println("HERE")
(u0_bif isa Vector{Pair{Symbol, Float64}}) && (u0_bif = symmap_to_varmap(rs, u0_bif))
(ps isa Vector{Pair{Symbol, Float64}}) && (ps = symmap_to_varmap(rs, ps))
(u0 isa Vector{Pair{Symbol, Float64}}) && (u0 = symmap_to_varmap(rs, u0))

Check warning on line 11 in ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl

View check run for this annotation

Codecov / codecov/patch

ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl#L7-L11

Added lines #L7 - L11 were not covered by tests

# Creates NonlinearSystem.
conservationlaw_errorcheck(rs, vcat(ps, u0))
nsys = covnert(NonlinearSystem, rs; defaults=u0)
#conservationlaw_errorcheck(rs, vcat(ps, u0))
nsys = convert(NonlinearSystem, rs; remove_conserved=true, defaults=Dict(u0))

Check warning on line 15 in ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl

View check run for this annotation

Codecov / codecov/patch

ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl#L15

Added line #L15 was not covered by tests

# Makes BifurcationProblem.
return BK.BifurcationProblem(nsys, u0_bif, ps, bif_par, args...; plot_var=plot_var, record_from_solution=record_from_solution, jac=jac, kwargs...)

Check warning on line 18 in ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl

View check run for this annotation

Codecov / codecov/patch

ext/CatalystBifurcationKitExtension/bifurcation_kit_extension.jl#L18

Added line #L18 was not covered by tests
Expand Down

0 comments on commit 2065fb4

Please sign in to comment.