I have an idea that if "Indeterminate" appears in the matrix using a judgment method, then remove this matrix. Is my idea feasible? If possible, what command statements can be used to remove the matrix?
It's possible to write that code, but it'd be simpler to use the kVals
I wrote above. What you are suggesting here could be done with something like this
Select[res, FreeQ[#, Indeterminate] &]
, with res being the list of things you want to filter. For instance
res = {1, x, Indeterminate, 4};
Select[res, FreeQ[#, Indeterminate] &]
returns {1, x, 4}
. After this filter you can then use TableForm
to get the result formatted as a table.
But please take into account that this is not the core issue here. The core issue is that, for linearization purposes, the switch components that are used in that model can not have Ron
and Goff
be set to 0. Even if the model simulates with those values, the system of equations depends heavily on them being not 0, so the linearization simply won't work, as you have seen. As I mentioned in the other posts, to be able to model those vanishing values you are going to have to use other components, and not use the switch. That means using Modelica.Electrical.Analog.Ideal.Idle
for a fully open circuit, or just a direct connection if you want to model 0 resistance.