- Notifications
You must be signed in to change notification settings - Fork441
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Tested on control 0.9.2 and again on 0.9.4 The resulting impulse response (unit sample response) for the following transfer function (accumulator scaled by 0.1) is not properly scaled: With the sample duration set to To further clarify below is the implementation diagram: If we pass a unit sample into this, it would scale by Code to repeat problem:
I do see in the docs "For continuous time systems, the initial condition is altered to account for the initial impulse. For discrete-time systems, the impulse is sized so that it has unit area", but would argue that it should not be rescaled especially if Octave and MATLAB are not doing that (I haven't confirmed MATLAB) and should represent the output of the discrete time system described by |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 6 comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
There is some discussion of the current approach in#812. Something to try in python-control, MATLAB, and Octave is the following:
The output in python-control is This shows that the scaling makes sense when you think about the discrete time system being a sampled version of the continuous system (as described in#812). |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Ah thank you! I was trying to find if this was already posted. I see now from a friend that MATLAB also scales it this way. Regarding your comment on scaling, yes it totally makes sense in the mapping of an ODE from continuous time IF we were doing that. If I have a discrete time system then there is no further mapping and any connection to some continuous time system should already be in the scaling for that function. My example of an accumulator was exactly that: I included the If it were to do the scaling as part of the c2d, that would make sense to me. But when I already have a discrete time system that I am modelling with its specific gain constants whatever they may be, it seems better (to me) that it represent what we would expect given the definition of the "unit sample response" as a discrete time impulse response. (Should I be writing this under#812 and not here?) |
BetaWas this translation helpful?Give feedback.
All reactions
-
#812 is merged, so better to keep the comments here. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
This is typically tied to the common problem of defining the dirac function as a standaloneunit sample function however that is not the definition of a unit impulse function. Hence, there is no right or wrong, it's just the definition. The discrete version is the Kronecker delta and both have only mathematical meaning under an integral or summation sign because they are technically generalized functions (or tempered distributions and so on depending on who you are hanging out with). They are not functions of time. And they should have the property Because an impulse does not carry the value of 1 throughout the whole sample but when summed up (again only under summation sign) equals to unity mimicking the dirac delta That's why it is not a proper function of
By mentioning that there is a continuous time system, we don't mean that wealways start from a continuous one and derive all discrete-time models from. What I meant over#812, is that there is an "equivalence-class" between such systems that you can argue about an impulse response of all such systems which should result in the same behavior.
I think you meant the other way around. In control software generally you don't need to include Note that if this is an integrator, then either it is yourinterpretation since you already have the information that it is linked to continuous time integrator or it is an information that you have beforehand. However suppose someone hands you a Tustin approximation of it I am not suggesting that your argument is wrong or inaccurate but I am trying to portray how the convention is typically constructed. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thank you@ilayn and I understand your points (and yes, you are correct, I meant the other way around). I really appreciate you taking the time to respond to my previous comments and helping me understand the broader perspective with the detail that you wrote, thank you! I'm thinking of applications where I am simulating a discrete time system, and for a step and "impulse" response, I really want the result to be for the unit sample function (so the unit sample response specifically), and for my model to match the specific results I would get without "hidden" gain modifications (hence my examples). An "impulse response" does not really exist in discrete time so I would have expected the unit sample response from a con.impulse_response function. To your point about "interpretation"; I am using the discrete time models as they are without concern of a mapping or equivalence to a continuous time model: my interpretation of the Tustin approximation of an integrator if that was handed to me as So, that's my two cents, but I also get that there must be value in having the dt automatically scale when using the discrete time transfer functions to model continuous time systems. I can get to what I need without too much grief by simply always using dt=1 for my applications and scaling the time axis myself, and perhaps that is the best solution. (And I see that if it was changed to what I really want, then the inclusion of dt is trivial since it would only serve to scale the t that the function returns and have no other effect). |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ok understood I deleted my comment there to clean up. |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #974 on March 03, 2024 17:50.