In[]:=
SetOptions[EvaluationNotebook[],CellEpilog:>SelectionMove[EvaluationNotebook[],Next,Cell]]
In[]:=
SystemModeler[]
In[]:=
model=Import["/home/fabian/work/modelica/pruebas/AngularSpring.mo","MO"]
Out[]=
In[]:=
modelLinearSystem=SystemModelLinearize[model,"InitialValues"]
Out[]=
| | u | |||
accelerate1.phi | 0. | 1. | 0. | 0. | 0. |
accelerate1.w | 0. | 0. | 0. | 0. | 1. |
body1.w_a[3] | 0. | 0. | 0. | -39.4784 | 0. |
revolute1.phi | 0. | -1. | 1. | 0. | 0. |
y | 0. | 0. | 0. | 0. | 0. |
In[]:=
tfMimo=Simplify[TransferFunctionModel[modelLinearSystem,s]]
Out[]=
| u |
y | 0 |
In[]:=
labels=Cases[tfMimo,Rule[SystemsModelLabels,lst_]->lst][[1]]
Out[]=
{{u},{y},Automatic}
In[]:=
input=Flatten[Position[labels[[1]],"u"]];output=Flatten[Position[labels[[2]],"y"]];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[]=
| u |
y | 0 |
Out[]=