Skip to content

add some features for plotting describing functions#1043

Open
baggepinnen wants to merge 4 commits into
masterfrom
df2
Open

add some features for plotting describing functions#1043
baggepinnen wants to merge 4 commits into
masterfrom
df2

Conversation

@baggepinnen

Copy link
Copy Markdown
Member

No description provided.

@JuliaControlBot

Copy link
Copy Markdown

This is an automated message.
Plots were compared to references. 4/11 images have changed, see differences below.
After pulling this PR, please update the reference images by creating a PR to ControlExamplePlots.jl here.

Difference Reference Image New Image
✔️ 0.0 Reference New
✔️ 0.0 Reference New
✔️ 0.0 Reference New
✔️ 0.0 Reference New

@codecov

codecov Bot commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.11940% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.50%. Comparing base (ea308d4) to head (6327e5f).
⚠️ Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
lib/ControlSystemsBase/src/nonlinear_components.jl 76.11% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1043      +/-   ##
==========================================
- Coverage   91.51%   91.50%   -0.01%     
==========================================
  Files          42       42              
  Lines        5595     5723     +128     
==========================================
+ Hits         5120     5237     +117     
- Misses        475      486      +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

baggepinnen and others added 2 commits March 15, 2026 12:54
Correctness:
- describing_function(sys::HammersteinWienerSystem) now computes the DF of
  the static callable when the nonlinearity is a Hysteresis, instead of
  dispatching to the analytical relay-with-hysteresis formula which
  describes the composite element realized by hysteresis(), not the static
  function the system applies.
- describing_function_plot(sys::HammersteinWienerSystem) errors for systems
  whose external part is not SISO, and the docstring now states the
  open-loop unity-negative-feedback assumption (do not pass feedback(G*nl)).
- Add promoting outer constructor Hysteresis(amplitude, width, hardness) so
  mixed numeric types work as documented.
- Analytical describing_function overloads validate A > 0 like the generic
  numerical method, instead of silently returning a plausible value.
- Fix docstring example output (the analytical Saturation DF is complex).
- Docstring no longer claims exponential convergence of the trapezoidal
  rule unconditionally; document increasing N for discontinuous
  nonlinearities.
- Restore direction-of-increasing-amplitude cues on the -1/N(A) curve
  (arrow and labeled endpoint markers) that the deleted example code had;
  hover only works with the plotly backend.

Cleanup:
- DeadZone DF computed via the exact identity N_dz(A) = 1 - N_sat(A),
  removing the duplicated formula and handling the asymmetric case exactly.
- Name the numerical quadrature core describing_function_numerical and call
  it directly where analytical dispatch must be bypassed.
- Remove commented-out dead code in the Hysteresis DF method.
- Clarify the dual semantics of the Hysteresis struct (static callable vs
  analytical DF token) in its docstring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants