Skip to content

MTK: vectors with mixed initial values and guesses #4448

@B-LIE

Description

@B-LIE

Is your feature request related to a problem? Please describe.

I try to make a component with a semi-discretized (Method of Lines) partial differential equation model, which connects to a port with pressure as potential and mass flow rates as Flow. When defining the variables, this includes:

# State variables
 p(t)[1:N], [unit = u"Pa", guess = p_guess_vec]
 md(t)[1:N] = fill(0.0, N), [unit = u"kg/s"]

The problem is that I really would like to specify initial values for p[2:N-1], and guess values for p[1], p[N].

Describe the solution you’d like

See above.

Describe alternatives you’ve considered

I suspect this can be done by adding initialization_eqs? Or is that in fact the way to do it?

Additional context

The way I have done it now, is to provide p[2:N-1] as initial values in the ODEProblem statement, but that puts an extra burden on the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions