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

extrapolation in ufun throwed errors #682

Merged
merged 3 commits into from Dec 26, 2021

Conversation

miroslavfikar
Copy link
Contributor

I came across situation when interpolation of u in ufun was requested beyond the actual time interval. Attached MWE file throws error, proposed modification resolves the issue. There were two possibilities to resolve the issue: either to take the highest value of time known (interpolation) or to prolonge the last interval to the right (extrapolation). I chose the first one to be consistent with already treated case to the left.

testh2.txt

@murrayrm
Copy link
Member

@miroslavfikar It would be great to add a unit test the triggers the error (prior to your fix).

@coveralls
Copy link

coveralls commented Dec 12, 2021

Coverage Status

Coverage decreased (-0.002%) to 92.721% when pulling 9bd61b0 on miroslavfikar:mifi_ufun into 2ce4bbd on python-control:master.

@murrayrm
Copy link
Member

I updated the fix to use extrapolation, since this is what is supposed to happen. The example now runs without throwing and error. (I couldn't figure out how to create a simple unit test since it seem to depend on the integrator asking to sample outside of the time range.)

@miroslavfikar It would be useful if you can confirm that the new version gives a correct result for your example.

@miroslavfikar
Copy link
Contributor Author

@murrayrm Yes, I confirm, I get the correct results with your commit, thanks.

@murrayrm murrayrm merged commit 8356044 into python-control:master Dec 26, 2021
@miroslavfikar miroslavfikar deleted the mifi_ufun branch December 26, 2021 18:39
@murrayrm murrayrm added this to the 0.9.1 milestone Dec 30, 2021
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

3 participants