Skip to content

11 refactor model analysis#12

Merged
rdesarz merged 18 commits intomainfrom
11-refactor-model-analysis
Feb 21, 2026
Merged

11 refactor model analysis#12
rdesarz merged 18 commits intomainfrom
11-refactor-model-analysis

Conversation

@rdesarz
Copy link
Copy Markdown
Owner

@rdesarz rdesarz commented Feb 21, 2026

This changelog summarizes the work developed on branch 11-refactor-model-analysis.

Added

  • Checked model constructors with typed errors:
    • ContinuousStateSpaceModel::try_from_matrices(...)
    • DiscreteStateSpaceModel::try_from_matrices(...)
    • ModelError (MatrixANotSquare, DimensionMismatch, InvalidSamplingDt, SingularMatrix)
  • Consolidated LTI analysis API:
    • analysis::analyze_lti(...)
    • TimeDomain (Continuous, Discrete)
    • LtiAnalysisReport (poles, spectral radius, stability, controllability/observability diagnostics)
  • Expanded simulator API and tests:
    • Generic simulate(...)
    • Step, impulse, and ramp response validation with nominal-value tests
    • Error-path tests for invalid dimensions/duration/sampling time
  • New analysis-first example:
    • examples/analysis_report.rs

Changed

  • Discretization strategy simplified and refocused for control-library coherence:
    • Exposed discretization narrowed to ZOH only
  • Simulation behavior uses full output equation consistently:
    • y = Cx + Du
  • Documentation improvements:
    • Expanded Rustdoc in model.rs with equations and assumptions
    • Detailed comments on matrix exponential algorithm, including references
    • Added explanatory comments for all unit tests
    • Added top-of-file purpose comments in examples
  • CI workflow hardening:
    • Reliable fontconfig install in GitHub Actions (apt-get update + libfontconfig1-dev)

Removed

  • Controller implementation from this branch scope (deferred to future work)
  • LQR implementation/example behavior (placeholder kept for future controller work)
  • simulate_with_noise(...) (kept simulator scope deterministic)
  • Non-target discretization methods from public API:
    • Forward Euler
    • Backward Euler
    • Tustin

Breaking Changes

  • Legacy/unsafe model constructors were deprecated or removed in favor of checked constructors.
  • Controller APIs introduced earlier in the branch were removed before final scope stabilization.
  • Discretization API reduced to ZOH to keep the public surface minimal.

Quality / Verification

  • Unit test suite expanded substantially for analysis and simulation behavior.
  • Edge/error cases now covered explicitly (dimension mismatch, invalid duration, invalid dt).
  • Current branch state passes:
    • cargo test (unit tests + doctests)

@rdesarz rdesarz self-assigned this Feb 21, 2026
@rdesarz rdesarz merged commit 55c8681 into main Feb 21, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d212a5a58b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +15 to +19
- Controller helpers:
- SISO pole placement
- Discrete LQR
- Continuous LQR approximation
- Closed-loop assembly (`A-BK`)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove non-existent controller APIs from README highlights

The README now advertises controller helpers (pole placement/LQR/closed-loop assembly), but this commit’s public API only exposes analysis, model, simulator, and trajectory modules (src/lib.rs), so users relying on these bullets will look for APIs that are not present and hit compile-time failures when trying to adopt the library from documentation alone. Please align the highlights with what this revision actually ships.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant