-
Notifications
You must be signed in to change notification settings - Fork 441
Discrete to continuous #888
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
base: main
Are you sure you want to change the base?
Conversation
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 |
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. |
I just found that Harold has a cont2discrete method — see might have some good ideas. |
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 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. |
Hi folks, I actually ended up here precisely because I just started using the controls system toolbox and was looking for an equivalent of the MATLAB |
Note that, there is no such unique mapping, so you have to make some decision on how to map it back from z to s domain, hence the discussion above. If you have experimental data it is better to get the rest of the models to z domain. But I guess fighting this point forever is not useful in particular for the academic use, so probably there is a need for it. |
I have an (old) implementation that I use, but also in this case it is important to modify the code to follow your conventions.
|
The function discrete_to_continuous is important because of the design of discrete controllers, but it is important to have other methods as only zoh (in particular in education). Usually we proposed to our students the following method in order to design a discrete controller:
|
If someone takes a crack at updating this PR to include more methods, in addition to utilizing @robertobucher's code, you might take a look at @ilayn's implementation of |
I'm happy to take a crack at it next week.
…On Wed, Nov 27, 2024, 08:11 Richard Murray ***@***.***> wrote:
If someone takes a crack at updating this PR to include more methods, in
addition to utilizing @robertobucher <https://github.com/robertobucher>'s
code, you might take a look at @ilayn <https://github.com/ilayn>'s
implementation of undiscretize
<https://github.com/ilayn/harold/blob/2b06ccce1dd64f5d7171fe9e4c914a83c0ecd3d1/harold/_discrete_funcs.py#L220>
in harald <https://github.com/ilayn/harold>.
—
Reply to this email directly, view it on GitHub
<#888 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJN2QZ6NV3GM3AN4DCBWD2CXVKLAVCNFSM6AAAAABSPGB4EKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBUGI3DOMBXGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
My original use case for this PR was to change the sampling time of models estimated in the discrete-time domain from measured values. |
The bilinear transformation ('tustin') is implemented in slicot, it is part of slycot 0.6.
|
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/