System modeler obtains state space equations

I used the SystemModelLinearize instruction to perform symbol linearization on the system. After execution, the system reported an error. May I ask where the problem occurred? I have used the same method before and have not made any errors before.

model = Import["C:\\Users\\james\\Desktop\\Model2.mo", 
   "MO"];(*file location*)
SystemModelLinearize[model, 
  Method -> {"SymbolicDerivative", 
      "SymbolicParameters" -> {"r", "l", "c", "k1", "k2"}}]

The model position can be changed according to your needs.

Model2.mo (5.55 KB)

Hello, sir! Do I need to assign values (True or False) to k1 and k2 and get different state equations? Or is it possible for Systemmodeler to identify all switch states by itself, and then give all possible state space equations (sorry, I may think too well haha).

I’ve updated my answer showing the result with all the boolean parameter combinations.

Thank you very much for your informative and patient answers!!!

Hello, sir! I used your method and achieved the desired effect. But (k1->True k2->True) and (k1->False k2->False) are not what I need because they do not meet the actual situation. How can I remove the state space equations for these two situations?

spacemodel = SystemModelLinearize["Model2", 
    Method -> {"SymbolicDerivative", 
        "SymbolicParameters" -> {"r", "l", "c", "k1", "k2"}}];
kVals = Thread[{QuantityVariable[
       "k1",IndependentPhysicalQuantity[""]], QuantityVariable[
       "k2",IndependentPhysicalQuantity[""]]} -> #] & /@ 
   Tuples[{{True, False}, {True, False}}];
{#, spacemodel /. #} & /@ kVals // TableForm

Model2.mo (5.55 KB)