In[]:=
SetOptions[EvaluationNotebook[],CellEpilog:>SelectionMove[EvaluationNotebook[],Next,Cell]]
In[]:=
SystemModeler[]
In[]:=
model=Import["/home/fabian/work/modelica/pruebas/AccelerationDriver.mo","MO"]
Out[]=
In[]:=
modelLinearSystem=SystemModelLinearize[model,"InitialValues"];
In[]:=
tfMimo=Simplify[TransferFunctionModel[modelLinearSystem,s]]
Out[]=
​
a
f1
f2
f3
f4
y1
◼
◼
◼
◼
◼
y2
◼
◼
◼
◼
◼
y3
◼
◼
◼
◼
◼
y4
◼
◼
◼
◼
◼
In[]:=
labels=Cases[tfMimo,Rule[SystemsModelLabels,lst_]->lst][[1]]
Out[]=
{{a,f1,f2,f3,f4},{y1,y2,y3,y4},Automatic}
In[]:=
input=Flatten[Position[labels[[1]],"f2"]];​​output=Flatten[Position[labels[[2]],"y3"]];​​myTfSiso=SystemsModelExtract[tfMimo,input,output]​​LogLogPlot[Evaluate@Abs[myTfSiso[I*2*Pi*f]],{f,1*^-3,100},Frame->True,GridLines->{Full,Full},ImageSize->Large,FrameLabel->{"f(Hz)","Magnitude"}]
Out[]=
​
f2
y3
-1.
Out[]=
In[]:=
input=Flatten[Position[labels[[1]],"f2"]];​​output=Flatten[Position[labels[[2]],"y2"]];​​myTfSiso=SystemsModelExtract[tfMimo,input,output]​​LogLogPlot[Evaluate@Abs[myTfSiso[I*2*Pi*f]],{f,1*^-3,100},Frame->True,GridLines->{Full,Full},ImageSize->Large,FrameLabel->{"f(Hz)","Magnitude"}]
Out[]=
​
f2
y2
-1.
Out[]=