Skip to content

Identifying variable indexes after discretization #440

@mjowen

Description

@mjowen

Question❓

Is there a nice way to identify the indexes of the state vector after discretization? Similar to variable_index(sys, sym) for ModelingToolkit.

I know you can index the final solution by a symbolic variable (solu = sol[u(t, x, y)]), but I can't find a way to do this more generally (like for mutating integrator.u).

I'm imagining something like variable_index(prob.f.sys, u)=1:11 indicating that integrator.u[1:11] are the discretized u variables and variable_index(prob.f.sys, (u(t))[3])=3 for a specific discretized location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions