Skip to content

Redesign ControlParameter for uniform constant/time-varying representation #92

Description

@AlCap23

What to build

Redesign ControlParameter (src/local_controls.jl) so it can represent every tunable parameter of the underlying DE problem, not just piecewise-constant controls. A constant tunable parameter (e.g. a rate constant being estimated) is just the degenerate case of a ControlParameter with a single breakpoint spanning the whole tspan, with bounds=(v,v) if it must stay fixed.

This is part of a broader redesign (tracked across this and several follow-up issues) replacing SingleShootingLayer/MultipleShootingLayer's split control_indices/tunable_p/bounds_p/parameter_initialization machinery with one named, uniform mechanism: every entry of the DE's p is addressed by name (via SymbolicIndexingInterface's setp/getp) rather than by position. This issue covers only the ControlParameter type itself and its accessors — not the layer/ps wiring (that's covered in later issues).

Keep the existing time-grid API surface (get_timegrid, control_length, get_controls, get_bounds, build_index_grid, collect_tspans) working for the genuinely time-varying case; make sure the single-breakpoint (constant) case degrades cleanly through the same functions without special-casing call sites.

Acceptance criteria

  • ControlParameter can represent a constant value (single breakpoint spanning a given tspan) using the same type and the same accessor functions as a genuinely time-varying control
  • Existing time-varying behavior (multiple breakpoints, function-valued controls/bounds) is preserved
  • Unit tests cover both the constant and time-varying cases through get_timegrid/control_length/get_controls/get_bounds

Blocked by

None - can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions