Code Monkey home page Code Monkey logo

Comments (4)

pogudingleb avatar pogudingleb commented on June 2, 2024 1

@saumil-sh
Thanks! I have fixed this, now, for @ODEmodel macro it only allow variable names which are valid Julia identifiers.
Let me know if you spot anything else!

from structuralidentifiability.jl.

pogudingleb avatar pogudingleb commented on June 2, 2024

@saumil-sh
Thanks for reporting!
I will look into this over the weekend.

from structuralidentifiability.jl.

pogudingleb avatar pogudingleb commented on June 2, 2024

@saumil-sh
Thanks again for reporting! I have fixed the issue (for the MTK input) in the current GitHub version (can be installed by Pkg.add("https://github.com/SciML/StructuralIdentifiability.jl"). Could you take a look ?

from structuralidentifiability.jl.

saumil-sh avatar saumil-sh commented on June 2, 2024

Hey,
Thanks for letting me know :)
Just a minor correction for installing from a URL the syntax must be Pkg.add(url="https://github.com/SciML/StructuralIdentifiability.jl").

I can run the second example provided in the first post using the MTK.

Just to update the issue, I ran the first example after defining x just to see what happens.

julia> @variables t x(t)[1:2]
2-element Vector{Any}:
 t
  (x(t))[1:2]

julia> ode_1 = @ODEmodel(
           x[1]'(t) = -k1 * x[2],
           x[2]'(t) = -k2 * x[1],
           y[1](t) = x[1](t),
           y[2](t) = x[2](t)
       )
[ Info: Summary of the model:
[ Info: State variables: x[1], x[2]
[ Info: Parameters: y, k1, k2, x
[ Info: Inputs: 
[ Info: Outputs: y[1], y[2]
ERROR: CanonicalIndexError: setindex! not defined for Symbolics.Arr{Num, 1}
Stacktrace:
   [1] ⋮ internal @ Base
   [2] setindex!
     @ Base ./abstractarray.jl:1396
Use `err` to retrieve the full stack trace.

julia> err
1-element ExceptionStack:
CanonicalIndexError: setindex! not defined for Symbolics.Arr{Num, 1}
Stacktrace:
 [1] error_if_canonical_setindex(#unused#::IndexCartesian, A::Symbolics.Arr{Num, 1}, #unused#::Int64)
   @ Base ./abstractarray.jl:1407
 [2] setindex!(A::Symbolics.Arr{Num, 1}, v::Nemo.QQMPolyRingElem, I::Int64)
   @ Base ./abstractarray.jl:1396
 [3] top-level scope
   @ REPL[11]:1

I hope this helps with the first example.

Thanks for the quick fix ^^

from structuralidentifiability.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.