Problem when assessing parameter identifiability using ODE system built with @mtkbuild

Hello,

I have built several models of protein dynamics with ModelingToolkit.jl (using @mtkmodel and @mtkbuild) and I would like to perform a parameter identifiability assessement with StructuralIdentifiability.jl.

But apparently I’m unable to pass the ODE system built with @mtkbuilt to StructuralIdentifiability.assess_local_identifiability(). It cannot find the output functions although they have been specified. It works if I define the ODE system with @ODEmodel as explained on the tutorial: ODE Tools · StructuralIdentifiability.jl, but if possible, I’d like to avoid having to redefine all models.

As an example, here is the error message I get when I copy-paste the code provided on ModelingToolkit tutorial: Parameter Identifiability in ODE Models · ModelingToolkit.jl

using StructuralIdentifiability, ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D

@mtkmodel Biohydrogenation begin
    @variables begin
        x4(t)
        x5(t)
        x6(t)
        x7(t)
        y1(t), [output = true]
        y2(t), [output = true]
    end
    @parameters begin
        k5
        k6
        k7
        k8
        k9
        k10
    end
    # define equations
    @equations begin
        D(x4) ~ -k5 * x4 / (k6 + x4)
        D(x5) ~ k5 * x4 / (k6 + x4) - k7 * x5 / (k8 + x5 + x6)
        D(x6) ~ k7 * x5 / (k8 + x5 + x6) - k9 * x6 * (k10 - x6) / k10
        D(x7) ~ k9 * x6 * (k10 - x6) / k10
        y1 ~ x4
        y2 ~ x5
    end
end

# define the system
@mtkbuild de = Biohydrogenation()

# query local identifiability
# we pass the ode-system
local_id_all = assess_local_identifiability(de, prob_threshold = 0.99)
ERROR: LoadError: Measured quantities (output functions) were not provided and no outputs were found.

I get the same error message with my MTK models. Does anyone know how to fix this?

It’s missing measured_quantities as that states.

We might need to update that MTK tutorial.

Many thanks for the input, I could make it run.