Message Boards Message Boards

0
|
2163 Views
|
5 Replies
|
7 Total Likes
View groups...
Share
Share this post:

System modeler obtains state space equations

Posted 1 year ago

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. enter image description here

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.

Attachments:
POSTED BY: James James
5 Replies

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

POSTED BY: Sergio Vargas

POSTED BY: Sergio Vargas
Posted 1 year ago

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).

POSTED BY: James James
Posted 1 year ago

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

POSTED BY: James James
Posted 1 year ago

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
Attachments:
POSTED BY: James James
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract