SetOptions[Plot, 
  BaseStyle -> {FontSize -> 20}
  ];
SetOptions[ListPlot, 
  BaseStyle -> {FontSize -> 20}
  ];

MODELO BENCHMARK - BICICLETA DE WHIPPLE

MATRIZES DO MODELO

𝕄 (Overscript[𝕢, ..]) + v (Subscript[ℂ, 1]) (OverDot[𝕢]) + (g (Subscript[𝕂, 0]) + (v^2) (Subscript[𝕂, 2])) 𝕢 = 𝕦 
com 𝕢 = (({{ϕ}, {δ}})) e  𝕦  = (({{(Subscript[T, ϕ])}, {(Subscript[T, δ])}}))

𝕄 = (({{80.81722, 2.31941332208709}, {2.31941332208709, 0.29784188199686}}));
(Subscript[𝕂, 0]) = (({{−80.95, −2.59951685249872}, {−2.59951685249872, −0.80329488458618}}));
(Subscript[𝕂, 2]) =(({{0, 76.59734589573222}, {0, 2.65431523794604}}));
(Subscript[ℂ, 1]) = (({{0, 33.86641391492494}, {−0.85035641456978, 1.68540397397560}}));

FORMA DE ESPAÇO DE ESTADOS

(OverDot[𝕩]) = (({{(OverDot[𝕢])}, {(Overscript[𝕢, ..])}})) = (({{𝟘, 𝕀}, {-(𝕄^(-1))(g (Subscript[𝕂, 0])+(v^2) (Subscript[𝕂, 2])), -(𝕄^(-1))(v (Subscript[ℂ, 1]))}}))(({{𝕢}, {(OverDot[𝕢])}})) + (({{𝟘}, {(𝕄^(-1))}}))𝕦

𝔸[v_] = ArrayFlatten[(({{0, IdentityMatrix[2]}, {-Inverse[𝕄].(9.81 (Subscript[𝕂, 0])+(v^2)(Subscript[𝕂, 2])), -Inverse[𝕄].(v (Subscript[ℂ, 1]))}}))]//Simplify//Chop;
𝔹 = ArrayFlatten[(({{0 IdentityMatrix[2] }, {Inverse[𝕄]}}))];
(Subscript[ℂ, o])= {{1,0,0,0}};
(Subscript[𝔻, o])= {{0, 0}};

SS[v_]= StateSpaceModel[{𝔸[v], 𝔹,(Subscript[ℂ, o]), (Subscript[𝔻, o])}]

SS[6]

ESTABILIDADE – POLOS DO SISTEMA

Module[{
xPA = Plot[
Sort@(Re/@Eigenvalues[𝔸[v]]),
{v,0,10},
PlotRange->{-10,+10},
PlotStyle->Hue[0.55],
GridLines->Automatic,
Frame->True,
FrameLabel->{"v (m/s)",None},
PlotLabel->"Modes of the Benchmark Whipple Model",
PlotLegends->Placed[
 LineLegend[{"Re (rad/s)"},LegendMarkerSize->30,LabelStyle->{GrayLevel[.4],FontFamily->"Arial",FontSize->16}],
Before
],
ImageSize->{450,450},
AspectRatio->1
],
xPB = Plot[
Sort@Chop@(Im/@Eigenvalues[𝔸[v]]),
{v,0,10},
PlotStyle->{Hue[0.88], Dashed},
PlotLegends-> Placed[
 LineLegend[{"Im (rad/s)"},LegendMarkerSize->30,LabelStyle->{GrayLevel[.4],FontFamily->"Arial",FontSize->16}],
Before
]
]
},
Show[xPA,xPB]
]

Alternativa - Função RootLocusPlot

SS2[v_]= StateSpaceModel[{𝔸[v], 𝔹[[All,{2}]],(Subscript[ℂ, o]), {{0}} }]

RootLocusPlot[SS2[v],{v,0,10},PlotTheme->"Detailed",GridLinesStyle->LightGray, PoleZeroMarkers->{Automatic,"",Automatic}]

POLOS E ZEROS

TransferFunctionPoles[SS[6]]//TableForm

TransferFunctionZeros[SS[6]]//TableForm

RESPOSTA A EXCITAÇÕES PERIÓDICAS - DIAGRAMA DE BODE

BodePlot[SS[6], PlotTheme->"Scientific", GridLines->Automatic, PlotStyle->100, PlotLabel->{"Magnitude Plot","Phase Plot"}]

DISCRETIZAÇÃO - MATRIZ DE TRANSIÇÃO DE ESTADOS

SSd[v_,h_]=ToDiscreteTimeModel[SS[v],h, Method->"ZeroOrderHold"]

SSd[6,0.1]//Chop

𝔸d[v_,h_] := MatrixExp[𝔸[v]h];
𝔸d[6,0.1] //MatrixForm

𝔹d[v_,h_]:= Integrate[MatrixExp[𝔸[v]t].𝔹/.{v->6}, {t,0,h}]//Chop;
𝔹d[6,0.1]//MatrixForm

SIMULAÇÃO

ssr1= StateResponse[{SS[5.5],{0,0.1,0,0}}, {0,0},{t,0,50}];
Plot[Evaluate[(180/π) ssr1[[{1,2}]]],{t,0,50}, PlotRange->All, PlotTheme->"Detailed", 
FrameLabel->{"t (s)"},
PlotLegends->{"ϕ (º)","δ (º)"}]

ssr2= StateResponse[{SS[5],{0,0,0,0}}, {5UnitStep[t],0},{t,0,50}];
Plot[Evaluate[(180/π) ssr2[[{1,2}]]],{t,0,50}, PlotRange->All, PlotTheme->"Detailed", 
FrameLabel->{"t (s)"},
PlotLegends->{"ϕ (º)","δ (º)"}]

ssr2= StateResponse[{SS[5],{0,0,0,0}}, {0,0.2UnitStep[t]},{t,0,50}];
Plot[Evaluate[(180/π) ssr2[[{1,2}]]],{t,0,50}, PlotRange->All, PlotTheme->"Detailed", 
FrameLabel->{"t (s)"},
PlotLegends->{"ϕ (º)","δ (º)"}]

SIMULAÇÃO - CONTÍNUO vs. DISCRETO

tsim = 40;
tstep = 0.25;
ssr1= StateResponse[{SS[5.5],{0,0.1,0,0}}, {0,0},{t,0,tsim}];
ssrd1 = StateResponse[{SSd[5.5,tstep],{0,0.1,0,0}}, {0,0},{t,0,tsim}]//Chop;

ssrd1[[All,1]]

ssrd1[[All,2]]

𝔸d[5.5,tstep].ssrd1[[All,1]]

Show[
ListPlot[{MapThread[{#1,#2}&,{Range[0,tsim, tstep],(180/π)ssrd1[[1]]}], MapThread[{#1,#2}&,{Range[0,tsim, tstep],(180/π)ssrd1[[2]]}]}, Joined->True, PlotRange->All, PlotTheme->"Detailed", PlotStyle->100,
FrameLabel->{"t (s)"},
PlotLegends->{"(Subscript[ϕ, d]) (º)","(Subscript[δ, d]) (º)"}],
Plot[Evaluate[(180/π) ssr1[[{1,2}]]],{t,0,50}, PlotRange->All, PlotTheme->"Detailed",PlotStyle->{Thickness[0.003]},
FrameLabel->{"t (s)"},
PlotLegends->{"ϕ (º)","δ (º)"}]
]