Skip to content

Linearizing a model that contains discrete callbacks (synchronous / clocked subsystems) #5166

Open

Description

@baggepinnen

Goal

Linearize a model with a synchronous (clocked) subsystem, and obtain the
loop transfer, the sensitivity functions and the stability margins of the sampled-data loop the way
linearize already gives them for a purely continuous model.

Synchronous programs are lowered to discrete callbacks, so the question is really about linearizing a
model that contains them. linearize today builds its LinearizationFunction from the continuous
problem and takes no account of callbacks, so a model with a clocked controller linearizes to the
plant with the controller's contribution missing. Nothing warns; the result looks like a plant that
happens to be open loop.

  • The single periodic clock case is the tractable one to start from. With one periodic clock the
    closed loop is a linear time-invariant discrete system at that period, and its behaviour between
    samples is a hold — the textbook sampled-data setting, and enough for most control designs.
  • We would like an arbitrary number of periodic callbacks to be handled eventually. Real models
    have more than one rate. For example a controller at 60 s, and
    a Functional Mock-up Unit every 600 s. Multi-rate loops
    where the periods are commensurate seem like the natural next step after the single-clock case.

Possible approaches:

  • For periodic callbacks that all have a common multiple clock interval Tc, linearize what's effectively (pseudo code) solve(prob, span=(t0, t0+Tc)[unknowns(ssys)] a similar for the output map. Clocks with non-zero phase offsets will be a pain. Interesting theoretical exercise to figure out how to interpret this.
  • Linearize continuous and clocked partitions separately and construct the loop-transfer function manually. This requires treating all the partition inputs and outputs as linearization inputs and outputs and outputing also these connection maps for the subsequent call to feedback to assemble. The linearizations of clocked partitions can then be converted with d2c to continuous time and then the final result combined in continuous time. Care must be taken when interpreting this result w.r.t. the Nyquist frequencies involved.
  • If one Ts is much longer than others, we don't want to limit the Nyquist freq based on this, the d2c approach seems much better in that case, with the appropriate precautions in interpreting the result.
  • No matter the approach, a downstream analysis ought to check that all signals crossing a sampler boundary have very little frequency content above that boundary's Nyquist freq.. A component being lowpass is not sufficient since frequency folding happens at the sampling interface before it. The d2c approach requires this property to be at all reliable, the Tc does not strictly need this, folded frequencies are correctly handled, but frequency localization will be poor and determined by the long Tc, so interpretation may be difficult. This indicates that returning all clock partitions as independent systems is the right way to go so that they can be analyzed in isolation.

Activity

  1. added a commit that references this issue on Sep 29, 2026
    f4780d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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