Give some parameter values to the model, as in the following version of your model:
In[]:=
model=ImportString,"MO";
And then linearize:
In[]:=
lin=SystemModelLinearize[model,Method->{"SymbolicDerivative","SymbolicParameters"->{"r","l","c","k1","k2","Ron","Goff"}}]//FullSimplify
Out[]=
| | Vi | |
capacitor1.v | - 1. c r | 1. c | 0. |
inductor1.i | - 1. l | - 1.If[ k1 Ron k2 Ron (If[ k1 Goff k2 Ron k1 Ron k2 Goff l | 1.If[ k1 Goff k2 Ron (If[ k1 Goff k2 Ron k1 Ron k2 Goff l |
Vc | 1. | 0 | 0 |
Notice that this switch has a non-zero open circuit conductance and a non-zero closed circuit resistance. To model 0 conductance, it’s recommended to use the Modelica.Electrical.Analog.Ideal component instead. Similarly, use a direct connection to model a closed circuit with 0 resistance.
The introduction of nonlinear or more complicated components can impede the symbolic linearization, and in that case you will only be able to use a numerical method to linearize.
The introduction of nonlinear or more complicated components can impede the symbolic linearization, and in that case you will only be able to use a numerical method to linearize.
Let’s consider all the combinations for the boolean parameters:
In[]:=
kVals=Thread[{,}->#]&/@Tuples[{{True,False},{True,False}}]
k1
k2
Out[]=
{{True,True},{True,False},{False,True},{False,False}}
k1
k2
k1
k2
k1
k2
k1
k2
In[]:=
{#,lin/.#}&/@kVals//TableForm
Out[]//TableForm=
|
| ||||||||||||||||||
|
| ||||||||||||||||||
|
| ||||||||||||||||||
|
| ||||||||||||||||||