- A major possibility is that you have encountered a roundoff error that demonstrates a fundamental problem with the way computers deal with numbers of vast differences in magnitude.
Index exceeds the number of array elements
15 views (last 30 days)
I am doing normal simulink for a cricuit includes normal elements like mosfet,capacitor, inductor and transformer whaen I run the circuit i received this ereor:-
Warning: Matrix is singular to working precision.
Index exceeds the number of array elements. Index must not exceed 0.
Component:Simulink | Category:Model error
can anyone help pls.
Shivani Dixit on 26 Aug 2022
I understand that you get the error “Matrix is singular to working precision“ while executing your Simulink model.
The following could be the cause of the issue:
Since the machine uses a finite number of bits to represent any number (in MATLAB's case, 64 bits are used), matrices that are poorly scaled are difficult to work with. One way to visualize the problem is using a 2-dimensional system. As an example, consider “A” as a simple non-singular matrix:
>> A = [1 0 ; 0 1];
The two column vectors in this matrix are as linearly independent as possible. However, if we stretch one vector and shrink the other, the matrix becomes closer to [k 0; 0 0], which is singular.For the smaller number, some precision is lost because the computer has difficulty representing both numbers with the same amount of accuracy.
>> format long
>> A=[2^50 0;0 2^(-50)]
Note that, although the machine could represent 2^(-50) by itself, it has lost the number's true value here, because it needs to deal with larger numbers at the same time.
So, even if this matrix is still non-singular in the true world of mathematics, it is singular to working precision on the computer, and singular matrices can cause the same kinds of problems that division by zero causes.