Message Boards Message Boards

0
|
1676 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

State space equation obtained with Systemmodeler command

Posted 1 year ago

I use Boolean signals to control the opening and closing of the switch. The state space equation obtained by using the Systemmodeler command is inconsistent with the correct result. What is the reason? Or how did the number 100000 in the result come from?

1) Buck circuit with Boolean switch enter image description here

2) State space equation with boolean switch enter image description here

3) Buck circuit without Boolean switch enter image description here

4) State space equation without Boolean switch (correct) enter image description here

My code:

spacemodel = SystemModelLinearize["Model2", 
    Method -> {"SymbolicDerivative", 
        "SymbolicParameters" -> {"r", "l", "c", "k1", "k2"}}];
rule1 = {QuantityVariable["r", IndependentPhysicalQuantity[""]] -> r, 
   QuantityVariable["l", IndependentPhysicalQuantity[""]] -> l, 
   QuantityVariable["c", IndependentPhysicalQuantity[""]] -> c, 
   QuantityVariable["k1", IndependentPhysicalQuantity[""]] -> k1, 
   QuantityVariable["k2", IndependentPhysicalQuantity[""]] -> k2};
A = spacemodel[[1, 1]] /. rule1 // UnitSimplify // FullSimplify
B = spacemodel[[1, 2]] /. rule1 // UnitSimplify // FullSimplify
Attachments:
POSTED BY: James James
2 Replies

The switch component that is used in this model actually has a non-zero conductance when the switch is open and a non-zero resistance when the switch is closed:

https://reference.wolfram.com/system-modeler/libraries/Modelica/Modelica.Electrical.Analog.Ideal.IdealOpeningSwitch.html

This is the origin of the odd 100000 term that you are seeing. You can use the component Modelica.Electrical.Analog.Ideal.Idle to represent a fully open circuit and a direct connection to represent 0 resistance.

POSTED BY: Sergio Vargas
Posted 1 year ago

Thank you, sir!

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