Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrete to continuous #888

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kletze
Copy link

@kletze kletze commented Apr 27, 2023

Added a function to convert discrete time LTI systems to continuous time LTI systems.
The function uses the inverse of the zoh-method. A mathematical derivation can be found for example on this page: https://studywolf.wordpress.com/tag/zero-order-hold/

@murrayrm
Copy link
Member

murrayrm commented Apr 30, 2023

I'm not sure this function is really needed. What's the use case where one wants to convert from continuous time to a (zero-order hold) continuous time model?

If we do include this, it needs to use python-control coding conventions and include unit tests (in the control/tests/ directory).

@sawyerbfuller
Copy link
Contributor

thanks for the contribution!

I have not run into a need for this function but it has been suggested before in #294 , and it is available in Matlab https://www.mathworks.com/help/control/ref/dynamicsystem.d2c.html (but not, as far as I can tell, in scipy).

In addition to adding unit tests, I suggest moving this to being a method of the LTI class in lti.py because it applies equally to both ss and tf systems. and adding a function that calls that method. Please also see the example of lti.sample_system to see how to properly pass other system parameters like signal and system names.

@sawyerbfuller
Copy link
Contributor

I just found that Harold has a cont2discrete method — see _undescretize in https://github.com/ilayn/harold/blob/main/harold/_discrete_funcs.py

might have some good ideas.

@ilayn
Copy link

ilayn commented May 4, 2023

Possibly my most useless spent week on a nerdy subject 😃 It is certainly possible but like Richard, I don't know what value it adds to anything. I just generalized this paper. Not that it makes it more useful but I was neck deep in IQCs so seemed simple enough. Didn't publish it but put it in harold instead. You can do arbitrary LFR connections between s and z in case needed.

The trick is to know how you ended up with that particular discrete model. Otherwise if you go --> zoh this way and tustin <-- this way, things get complicated very quickly.

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.

None yet

4 participants