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

A way to combine variable-step integration with a discrete-time controller #936

Open
sawyerbfuller opened this issue Oct 20, 2023 · 1 comment

Comments

@sawyerbfuller
Copy link
Contributor

sawyerbfuller commented Oct 20, 2023

Perhaps using a different integrator than the default (e.g. LSODA?) in scipy.integrate.solve_ivp?

The example in https://github.com/python-control/python-control/blob/main/examples/simulating_discrete_nonlinear.ipynb is one option, but it uses a fixed-step integrator (edit: which is not as accurate as a variable step integrator and potentially slower). Constructing discrete-time systems that repeatedly call ``scipy.integrate.solve_ivp``` inside the dynamics function is another option, but it is very slow.

@murrayrm
Copy link
Member

murrayrm commented Oct 21, 2023

I've thought about this a bit in the past (though done nothing about it -:). One possibility might be to use the events parameter in solve_ivp, which could be set up to create events whenever a discrete time "tick" occurs. Another would be to call continuous time integration between discrete clock ticks (similar to the discussion in #933). I'm not sure whether either of those are faster than using a fixed-step integrator.

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

No branches or pull requests

2 participants