-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
BUG: fix signal.dlsim for complex input #13075
base: main
Are you sure you want to change the base?
Conversation
Thanks @IguanaAzul! Can you please add a test case to It looks like this fixes gh-4964, which already has an example that can be turned into a test case. More comprehensive testing is always welcome, but one case should be enough. |
Sure, I added a test case for that |
The test you added is failing on almost all CI jobs @IguanaAzul, and also locally for me. Can you have another look? |
Oh, sorry, I'll check it. |
This commit addresses the bug reported in (stale) PR scipy#13075 with a wider scope: 1. Fixes complex-valued operation. If any SS parameters, input signal, or initial state is complex valued, the output and final state are also complex valued. 2. Better FP precision control. The output and final state are set to the highest precision of the input and system parameters.
This commit addresses the bug reported in (stale) PR scipy#13075 with a wider scope: 1. Fixes complex-valued operation. If any SS parameters, input signal, or initial state is complex valued, the output and final state are also complex valued. 2. Better FP precision control. The output and final state are set to the highest precision of the input and system parameters.
This commit addresses the bug reported in (stale) PR scipy#13075 with a wider scope: 1. Fixes complex-valued operation. If any SS parameters, input signal, or initial state is complex valued, the output and final state are also complex valued. 2. Better FP precision control. The output and final state are set to the highest precision of the input and system parameters.
Reference issue
The problem was that when trying to simulate a system with complex values in the state space matrices, it would perform a matrix multiplication between the input and output matrices, and the output matrices were float by default, so the multiplication casted everyone of them to float, removing the imaginary parts of the complex numbers, so the simulation was wrong.
What does this implement/fix?
I just set the type of the output matrices to be the same as the matrix A in the input, so that it works if the input is complex.
Additional information