Skip to content

Guess for parameter not reflected in guesses of systemΒ #3075

@hexaeder

Description

@hexaeder

Describe the bug 🐞

If you attach a guess to a parameter, it isn't reflected in the guesses of the system

Expected behavior

Have guesses contain all guesses.

Minimal Reproducible Example πŸ‘‡
Example 1:

julia> begin
               @independent_variables t
               @parameters a [guess=2]
               @variables x(t) [guess=1]
               @named sys = ODESystem([x ~ a], t)
               guesses(sys)
           end
Dict{Any, Any} with 1 entry:
  x(t) => 1

Example 2:

  @mtkmodel MyMod begin
        @components begin
            a = RealInput(guess=1)
        end
        @parameters begin
            b, [guess=2]
        end
    end
    @named model = MyMod()
    guesses(model)       # knows only about a.u=1
    getguess(model.b)    # guess b=2 locally stored
    getguess(model.a.u)  # guess u=1 not locally stored

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
βŒƒ [13f3f980] CairoMakie v0.12.9
  [459566f4] DiffEqCallbacks v3.9.1
  [7d51a73a] ExplicitImports v1.9.0
  [86223c79] Graphs v1.11.2
βŒ… [ee78f7c6] Makie v0.21.9
βŒƒ [961ee093] ModelingToolkit v9.39.0
βŒƒ [16a59e39] ModelingToolkitStandardLibrary v2.11.0
  [127b3ac7] OrdinaryDiffEqNonlinearSolve v1.2.1
  [43230ef6] OrdinaryDiffEqRosenbrock v1.2.0
  [b1df2697] OrdinaryDiffEqTsit5 v1.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions