Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"MethodError: no method matching create_array(..." When computing periodic orbits from ModelingToolkit type function #61

Closed
TorkelE opened this issue Jun 16, 2022 · 6 comments

Comments

@TorkelE
Copy link

TorkelE commented Jun 16, 2022

Hello,

If I try the following code, I can successfully compute the periodic orbits of a brusselator model:

using Revise, ForwardDiff, Parameters, Setfield, Plots, LinearAlgebra
using BifurcationKit
using Catalyst, DifferentialEquations
const BK = BifurcationKit

norminf(x) = norm(x, Inf);
function brusselator_func(dz, z, p, t)    
	A, B = p
	X, Y = z
	dz[1] = A + 0.5*Y*X^2 - B*X-X
	dz[2] = B*X - 0.5*Y*X^2
	dz
end

F_func = (z, p) -> brusselator_func(similar(z), z, p, 0) 
J_func = (z,p) -> ForwardDiff.jacobian(x -> F_func(x,p), z)
jet_func = BK.getJet(F_func, J_func);
F = F_func
J = J_func
jet = jet_func;
# parameter values
par_tm = [1.0,1.0]     ### New parameter values ###

# initial condition
z0 = [1.0, 1.0];     ### New initial condition ###

# continuation options
opts_br = ContinuationPar(pMin = 1.0, pMax = 4.0,
	# parameters to have a smooth result
	ds = 0.04, dsmax = 0.05,
	# this is to detect bifurcation points precisely with bisection
	detectBifurcation = 3,
	# Optional: bisection options for locating bifurcations
	nInversion = 8, maxBisectionSteps = 25, nev = 3)

# continuation of equilibria
br, = continuation(F,J, z0, par_tm, (@lens _[2]), opts_br;
	recordFromSolution = (x, p) -> x[1],
	tangentAlgo = BorderedPred(),
	plot = false, normC = norminf)

scene = plot(br, plotfold=false, markersize=3, legend=:topleft)

br;
# newton parameters
optn_po = NewtonPar(verbose = false, tol = 1e-8,  maxIter = 10);

# continuation parameters
opts_po_cont = ContinuationPar(dsmax = 0.1, ds= -0.0001, dsmin = 1e-4, pMax = 4., pMin=1.0,     ### Changed pMin and pMax ###
	maxSteps = 110, newtonOptions = (@set optn_po.tol = 1e-7),
	nev = 3, precisionStability = 1e-8, detectBifurcation = 3, plotEveryStep = 10, saveSolEveryStep=1)

# arguments for periodic orbits
args_po = (	recordFromSolution = (x, p) -> (xtt = BK.getPeriodicOrbit(p.prob, x, p.p);
		return (max = maximum(xtt.u[1,:]),
				min = minimum(xtt.u[1,:]),
				period = x[end])),
	plotSolution = (x, p; k...) -> begin
		xtt = BK.getPeriodicOrbit(p.prob, x, p.p)
		plot!(xtt.t, xtt.u[1,:]; label = "X", k...)
		plot!(xtt.t, xtt.u[2,:]; label = "Y", k...)  ### Removed one variable from plot ###
		plot!(br,subplot=1, putbifptlegend = false)
		end,
	normC = norminf)

Mt = 200 # number of time sections
	br_potrap, utrap = continuation(jet...,
	# we want to branch form the 4th bif. point
	br, 1, opts_po_cont,                 ### Now uses 1st bp ###
	# we want to use the Trapeze method to locate PO
	PeriodicOrbitTrapProblem(M = Mt);
	# this jacobian is specific to ODEs
	# it is computed using AD and
	# updated inplace
	linearPO = :Dense,
	# regular continuation options
	verbosity = 0,	plot = false, δp = 0.005, 
	args_po...)

scene = plot(br, br_potrap, markersize = 3)
plot!(scene, br_potrap.param, br_potrap.min, label = "")

image

However, if I instead create my function using some ModelingToolkit function, I get an error. Replace the 2nd and 3rd box with:

brusselator_cat = @reaction_network begin
    A, ∅  X
    1, 2X + Y  3X
    B, X  Y
    1, X end A B;

odefun = ODEFunction(convert(ODESystem,brusselator_cat),jac=true)
F_cat = (z,p) -> odefun(z,p,0)      
J_cat = (z,p) -> odefun.jac(z,p,0)
jet_cat = BK.getJet(F_cat, J_cat);
F = F_cat
J = J_cat
jet = jet_cat;

and the last box gives an error:

MethodError: no method matching create_array(::Type{Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}}, ::Nothing, ::Val{1}, ::Val{(2,)}, ::Float64, ::Float64)
Closest candidates are:
  create_array(::Type{<:LabelledArrays.SLArray}, ::Any, ::Val, ::Val{dims}, ::Any...) where dims at ~/.julia/packages/SymbolicUtils/v2ZkM/src/code.jl:546
  create_array(::Type{<:LabelledArrays.LArray}, ::Any, ::Val, ::Val{dims}, ::Any...) where dims at ~/.julia/packages/SymbolicUtils/v2ZkM/src/code.jl:555
  create_array(::Type{<:StaticArrays.SArray}, ::Nothing, ::Val, ::Val{dims}, ::Any...) where dims at ~/.julia/packages/SymbolicUtils/v2ZkM/src/code.jl:528
  ...

Stacktrace:
  [1] create_array
    @ ~/.julia/packages/SymbolicUtils/v2ZkM/src/code.jl:511 [inlined]
  [2] macro expansion
    @ ~/.julia/packages/SymbolicUtils/v2ZkM/src/code.jl:444 [inlined]
  [3] macro expansion
    @ ~/.julia/packages/RuntimeGeneratedFunctions/KrkGo/src/RuntimeGeneratedFunctions.jl:129 [inlined]
  [4] macro expansion
    @ ./none:0 [inlined]
  [5] generated_callfunc
    @ ./none:0 [inlined]
  [6] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x1ffd89af, 0x3085b8c1, 0x1ffc2b0f, 0xa3198a76, 0xc9561182)})(::SubArray{Float64, 1, Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, ::Vector{Float64}, ::Int64)
    @ RuntimeGeneratedFunctions ~/.julia/packages/RuntimeGeneratedFunctions/KrkGo/src/RuntimeGeneratedFunctions.jl:117
  [7] (::ModelingToolkit.var"#f#389"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x1ffd89af, 0x3085b8c1, 0x1ffc2b0f, 0xa3198a76, 0xc9561182)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x4e53a95a, 0xc7fb9b4e, 0x0d2545c4, 0x9d32ba9c, 0x2b0c5a41)}})(u::SubArray{Float64, 1, Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, p::Vector{Float64}, t::Int64)
    @ ModelingToolkit ~/.julia/packages/ModelingToolkit/vZUs5/src/systems/diffeqs/abstractodesystem.jl:378
  [8] (::ODEFunction{true, ModelingToolkit.var"#f#389"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x1ffd89af, 0x3085b8c1, 0x1ffc2b0f, 0xa3198a76, 0xc9561182)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x4e53a95a, 0xc7fb9b4e, 0x0d2545c4, 0x9d32ba9c, 0x2b0c5a41)}}, UniformScaling{Bool}, Nothing, Nothing, ModelingToolkit.var"#_jac#393"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x136c5686, 0x60e48f05, 0x969ba9b3, 0xee62da1d, 0xc495284f)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x7e8e6214, 0xdb7705cb, 0x3d7f428f, 0x3248757e, 0x6a7f3829)}}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, ModelingToolkit.var"#449#generated_observed#396"{Bool, ODESystem, Dict{Any, Any}}, Nothing})(::SubArray{Float64, 1, Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, ::Vararg{Any})
    @ SciMLBase ~/.julia/packages/SciMLBase/chsnh/src/scimlfunctions.jl:1593
  [9] (::var"#83#84")(z::SubArray{Float64, 1, Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, p::Vector{Float64})
    @ Main ./In[41]:9
 [10] applyF(pb::PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, dest::SubArray{Float64, 1, Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, x::SubArray{Float64, 1, Base.ReshapedArray{Float64, 2, SubArray{Float64, 1, Vector{Float64}, Tuple{UnitRange{Int64}}, true}, Tuple{}}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}, p::Vector{Float64})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/periodicorbit/PeriodicOrbits.jl:36
 [11] POTrapFunctional!(pb::PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, out::Vector{Float64}, u::Vector{Float64}, par::Vector{Float64})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/periodicorbit/PeriodicOrbitTrapeze.jl:210
 [12] PeriodicOrbitTrapProblem
    @ ~/.julia/dev/BifurcationKit/src/periodicorbit/PeriodicOrbitTrapeze.jl:275 [inlined]
 [13] newton(Fhandle::PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, Jhandle::BifurcationKit.var"#752#757"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}}, x0::Vector{Float64}, p0::Vector{Float64}, options::NewtonPar{Float64, BifurcationKit.FloquetWrapperLS{DefaultLS}, FloquetQaD{DefaultEig{typeof(abs)}}}; normN::typeof(norminf), callback::Function, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:iterationC, :p), Tuple{Int64, Float64}}})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/Newton.jl:103
 [14] iterate(it::ContIterable{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, BifurcationKit.var"#752#757"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}}, Vector{Float64}, Vector{Float64}, Setfield.IndexLens{Tuple{Int64}}, Float64, BifurcationKit.FloquetWrapperLS{DefaultLS}, FloquetQaD{DefaultEig{typeof(abs)}}, SecantPred, BorderingBLS{BifurcationKit.FloquetWrapperLS{DefaultLS}, Float64}, BifurcationKit.var"#817#821"{BifurcationKit.var"#817#818#822"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, var"#116#119"}}, BifurcationKit.var"#807#811"{BifurcationKit.var"#807#808#812"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, var"#115#118"}}, typeof(norminf), BifurcationKit.DotTheta{BifurcationKit.var"#168#170", BifurcationKit.var"#169#171"}, BifurcationKit.var"#799#803"{BifurcationKit.var"#799#800#804"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, Int64}}, typeof(BifurcationKit.cbDefault), Nothing, String}; _verbosity::Int64)
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/Continuation.jl:276
 [15] iterate
    @ ~/.julia/dev/BifurcationKit/src/Continuation.jl:259 [inlined]
 [16] continuation(it::ContIterable{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, BifurcationKit.var"#752#757"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}}, Vector{Float64}, Vector{Float64}, Setfield.IndexLens{Tuple{Int64}}, Float64, BifurcationKit.FloquetWrapperLS{DefaultLS}, FloquetQaD{DefaultEig{typeof(abs)}}, SecantPred, BorderingBLS{BifurcationKit.FloquetWrapperLS{DefaultLS}, Float64}, BifurcationKit.var"#817#821"{BifurcationKit.var"#817#818#822"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, var"#116#119"}}, BifurcationKit.var"#807#811"{BifurcationKit.var"#807#808#812"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, var"#115#118"}}, typeof(norminf), BifurcationKit.DotTheta{BifurcationKit.var"#168#170", BifurcationKit.var"#169#171"}, BifurcationKit.var"#799#803"{BifurcationKit.var"#799#800#804"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, Int64}}, typeof(BifurcationKit.cbDefault), Nothing, String})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/Continuation.jl:478
 [17] continuation(Fhandle::PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, Jhandle::Function, x0::Vector{Float64}, par::Vector{Float64}, lens::Setfield.IndexLens{Tuple{Int64}}, contParams::ContinuationPar{Float64, BifurcationKit.FloquetWrapperLS{DefaultLS}, FloquetQaD{DefaultEig{typeof(abs)}}}, linearAlgo::BorderingBLS{BifurcationKit.FloquetWrapperLS{DefaultLS}, Float64}; bothside::Bool, kwargs::Base.Pairs{Symbol, Any, NTuple{7, Symbol}, NamedTuple{(:recordFromSolution, :linearPO, :verbosity, :plot, :plotSolution, :normC, :finaliseSolution), Tuple{BifurcationKit.var"#807#811"{BifurcationKit.var"#807#808#812"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, var"#115#118"}}, Symbol, Int64, Bool, BifurcationKit.var"#817#821"{BifurcationKit.var"#817#818#822"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, var"#116#119"}}, typeof(norminf), BifurcationKit.var"#799#803"{BifurcationKit.var"#799#800#804"{PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, Int64}}}}})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/Continuation.jl:0
 [18] continuationPOTrap(prob::PeriodicOrbitTrapProblem{var"#83#84", var"#85#86", Nothing, Nothing, Nothing, Vector{Float64}, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}, orbitguess::Vector{Float64}, par::Vector{Float64}, lens::Setfield.IndexLens{Tuple{Int64}}, contParams::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, linearAlgo::BorderingBLS{DefaultLS, Float64}; jacobianPO::Symbol, updateSectionEveryStep::Int64, kwargs::Base.Pairs{Symbol, Any, NTuple{6, Symbol}, NamedTuple{(:recordFromSolution, :linearPO, :verbosity, :plot, :plotSolution, :normC), Tuple{var"#115#118", Symbol, Int64, Bool, var"#116#119", typeof(norminf)}}})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/periodicorbit/PeriodicOrbitTrapeze.jl:917
 [19] #continuation#762
    @ ~/.julia/dev/BifurcationKit/src/periodicorbit/PeriodicOrbitTrapeze.jl:979 [inlined]
 [20] continuation(F::var"#83#84", dF::var"#85#86", d2F::BifurcationKit.var"#d2f#283"{BifurcationKit.var"#d1f#281"{var"#83#84"}}, d3F::BifurcationKit.var"#d3f#285"{BifurcationKit.var"#d2f#283"{BifurcationKit.var"#d1f#281"{var"#83#84"}}}, br::ContResult{NamedTuple{(:x, :param, :itnewton, :itlinear, :ds, :θ, :n_unstable, :n_imag, :stable, :step), Tuple{Float64, Float64, Int64, Int64, Float64, Float64, Int64, Int64, Bool, Int64}}, Vector{ComplexF64}, Matrix{ComplexF64}, BifurcationKit.SpecialPoint{Float64, NamedTuple{(:x,), Tuple{Float64}}, Vector{Float64}}, Nothing, ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, Nothing, Vector{Float64}, Setfield.IndexLens{Tuple{Int64}}}, ind_bif::Int64, _contParams::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, prob::PeriodicOrbitTrapProblem{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, DefaultLS, BifurcationKit.TimeMesh{Int64}, Nothing}; Jᵗ::Nothing, δ::Float64, δp::Float64, ampfactor::Int64, usedeflation::Bool, nev::Int64, updateSectionEveryStep::Int64, kwargs::Base.Pairs{Symbol, Any, NTuple{6, Symbol}, NamedTuple{(:linearPO, :verbosity, :plot, :recordFromSolution, :plotSolution, :normC), Tuple{Symbol, Int64, Bool, var"#115#118", var"#116#119", typeof(norminf)}}})
    @ BifurcationKit ~/.julia/dev/BifurcationKit/src/periodicorbit/PeriodicOrbits.jl:410
 [21] top-level scope
    @ In[54]:23
 [22] eval
    @ ./boot.jl:373 [inlined]
 [23] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:1196

It seems to be something specifically with the catalyst type model, and the last box. I can declare the functions using Catalyst, find the bifurcation diagram, then replace F, J, and jet with the _func version, and successfully run the last box. Trying any combination like :

F = F_func
J = J_func
jet = BK.getJet(F_cat, J_cat);

or

F = F_func
J = J_func
jet = BK.getJet(F_cat, J_func);

both give the error. Trying something like

odefun = ODEFunction(convert(ODESystem,brusselator_cat),jac=true)
F_cat = (z,p) -> odefun(z,p,0)      
J_cat = (z,p) -> ForwardDiff.jacobian(x -> F_cat(x,p), z)
jet_cat = BK.getJet(F_cat, J_cat);

also does. The one thing that does work is:

F = F_cat
J = J_cat
jet = BK.getJet(F_func, J_func);

There seems to be something weird that goes on with one function call, but I am unsure what is actually going on with the jet thing, so not sure how to circumvent it.

@rveltz
Copy link
Member

rveltz commented Jun 16, 2022

I have not given MTK the love it deserves yet. I am changing the pacakge a lot for an interface similar to DE.jl and it is a lot of work.

Dont you have the answer here by any chance?
#45

@rveltz
Copy link
Member

rveltz commented Jun 16, 2022

In passing, remember that 'jet_func = BK.getJet(F_func, J_func);' can compute the AD jacobian for you, dont need to pass it.

@TorkelE
Copy link
Author

TorkelE commented Jun 16, 2022

The linked issue contained the solution, thanks! :)

@TorkelE TorkelE closed this as completed Jun 16, 2022
@TorkelE
Copy link
Author

TorkelE commented Jun 16, 2022

I have not given MTK the love it deserves yet. I am changing the pacakge a lot for an interface similar to DE.jl and it is a lot of work.

I can imagine so! I'd offer to help, but I feel I know neither MTK nor BK well enough...

@rveltz
Copy link
Member

rveltz commented Jun 16, 2022

posting issue is a lot of help already! Feel free to continue even with seemingly trivial questions, it does not matter.

but I feel I know neither MTK nor BK well enough...

hopefully, with the new interface it will be easier. There will be a BifurcationProblem similar to 'ODEProblem'. We just need to write 'convert' methods then.

Here is a snapshot of the the future interace

prob = BifurcationProblem(F_func, z0, par_tm, (@lens _[2]); recordFromSolution = (x, p) -> x[1])
br = continuation(prob, PALC(tangent = Bordered()), opts_br;
	plot = false, normC = norminf)

@TorkelE
Copy link
Author

TorkelE commented Jun 17, 2022

Here is a snapshot of the the future interact

br = continuation(prob, PALC(tangent = Bordered()), opts_br;
   plot = false, normC = norminf)

I'd make that smiley with stars/hearts for eyes, but don't think that is possible on GitHub. That looks really cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants