JuliaControl / JuliaControl/ControlSystems.jl

Marginplot raises method error for certain transfer functions

Open
#381 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
582
Forks
92
Avg merge
1h 12m
Merged PRs (30d)
2

Description

The error is the following:
"ERROR: MethodError: no method matching _extract_group_attributes(::Int64, ::Array{Float64,1}, ::Array{Float64,1})",
and is produced for certain transfer functions.

In reproducing this error, tested different numerators and denominators of s in the transfer function. The denominator polynomial is in all cases given by the coefficients [1; 1; 1; 1], so of degree 3. The error was successfully reproduced for the following numerator polynomials of degree 1, 3 and 5:

[1; 1]
[1; 1; 1; 1]
[1; 1; 1; 1; 1; 1]

The margin function does some time return the right values. It does however sometimes return inexact errors like Int64(NaN)
or Int64(1.0116379797662072). From what I can tell now, margin sometimes worked as expected when I define the transfer function as some fraction with s, where s is defined with s=tf("s") (script in VSCode), not at all when I define the transfer function with arrays of coefficients as seen above (script in VSCode), and not at all in the REPL. I have also gotten ERROR: BoundsError: attempt to access 1-element Array{Float64,1} at index [100] a couple of times. I have no idea what causes this.

My ControlSystems version is 0.8.0. I have copied the return from versioninfo() below:

Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through the marginplot and margin entry points with the listed transfer-function coefficient arrays in Julia 1.5.2 and ControlSystems 0.8.0. Trace the _extract_group_attributes MethodError and related Int64 or BoundsError failures; done means these inputs return correct margin results without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.