Skip to content

control.damp(sys) #839

Description

@Nabil-Bishtawi

control.damp(sys) do not deal correctly with overdamped modes and built in print function inside it should be deactivated because even if you put it wn[i],damping[i],eig[i]=control.damp(sys[i]) it is still printing every thing

Activity

  1. roryyorke commented on Jan 8, 2023

    @roryyorke
    Contributor

    It's not clear what you mean by "do[es] not deal correctly with overdamped modes", though I've taken a guess (see below). If I'm wrong, could you give us more detail, preferably as code, with inputs and actual and expected outputs?

    You can prevent printing by setting argument doprint to False .

    My guess is that you want control.damp to handle second-order systems with damping factor > 1 as second-order systems, but it instead treats these as independent first-order poles. I think this is fine, and arguably correct: we can't know if in general if these two poles are conceptually from two different first-order physical models, or from a single over-damped second order system.

  2. Nabil-Bishtawi commented on Jan 14, 2023

    @Nabil-Bishtawi
    Author

    We can determine it, assuming we have those eigenvalues (poles location):

    image

    We can follow the equations here:
    image
    1- use 14.10.3 to calculate undamped frequency.
    2-use 14.10.4 to calculate damping.
    3- use 14.10.2 and 14.10.5 to calculate damped frequency, and if they yield the same damped frequency, that means those two eigenvalues correspond to the same mode; if not, we choose another eigenvalue and do the steps again.

    The results will be like this:
    screenshot

  3. roryyorke commented on Jan 15, 2023

    @roryyorke
    Contributor

    You didn't say what $\lambda_n$ and $\lambda_r$ are, I've assumed they're the real pole positions.

    (14.10.3) and (14.10.4) look OK, and I think (14.10.2) is defining $\omega_d$ to be similar to the under-damped case (where it would be $\sqrt{1-\zeta^2}$.

    It's not so obvious what (14.10.1) (and (14.10.5), which can be derived from (14.10.1)) is for.

    What are either over-damped $\omega_d$ values supposed to tell us? For the case with no zeros, the response is either approximately that of a double pole, or dominated by the slow pole. We can use the $\lambda$ values for that.

    If I apply these equations to the real poles in your example, I don't get the values for the two definitions of $\omega_d$ to match (perhaps I made an error?).

    def overdamped(ln, lr):
        if not ln.imag == 0 and lr.imag == 0:
            raise ValueError('poles must be real')
        if not lr < ln < 0:
            raise ValueError('require lr<ln<0')
        
        wn = (ln * lr) ** 0.5
        zeta = -(ln + lr) / 2 / wn
    
        wnd1 = wn * (zeta**2 - 1)
        wnd2 = 0.5 * (ln - lr)
        print(f'{wn=:.4f}, {zeta=:.4f}, {wnd1=:.4f}, {wnd2=:.4f}')
    
    overdamped(-31.67, -140.8)
    overdamped(-2.121, -2.983)

    gives

    wn=66.7768, zeta=1.2914, wnd1=44.5865, wnd2=54.5650
    wn=2.5153, zeta=1.0146, wnd1=0.0739, wnd2=0.4310
    
  4. Nabil-Bishtawi commented on Jan 21, 2023

    @Nabil-Bishtawi
    Author

    I hope this will clarify the issue

    image

  5. ilayn commented on Jan 21, 2023

    @ilayn

    @Nabil-Bishtawi Damping computation relies heavily on the classical first or second order system interpretation. When you have the system order larger than two, you are basically hoping to separate things into second and first order systems. You can still do this but you can't take the analogy too far.

    Especially if you have more than two real axis poles you don't know which one should be grouped with which pole to assume overdamped 2nd order system. For example, if you have poles (-1, -4, -4.4) how do you decide?

    That's why damp and other natural frequency computations (including matlab) is done per pole basis. They don't give too much information about the system anyways but it is typically used in the educational context. For this reason the algorithm for computing damping is the -cos(angle of the pole) (See bottom table https://www.mathworks.com/help/control/ref/lti.damp.html) and hence capped at 1 because if it is real then damping number is not meaningful.

  6. added this to the 0.9.4 milestone on Mar 26, 2023
  7. locked and limited conversation to collaborators on Mar 27, 2023
  8. converted this issue into a discussion #879 on Mar 27, 2023
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions