How can I get a time response from FRD model
조회 수: 29 (최근 30일)
이전 댓글 표시
I have a model in FRD mode, I want to a) get a time response of this model, b) implement it in Simulink (both seems to be unavailable in Matlab)
댓글 수: 0
채택된 답변
Sam Chak
2023년 12월 8일
There isn't a direct function called 'frd2ss()' for the conversion you're looking for. However, you can estimate a state-space model from available frequency response data (FRD) using the 'ssest()' function. This function will provide you with the estimated state-space model, which you can then use in Simulink for simulation. This will allow you to obtain the time response of the equivalent FRD model.
%% Dummy state-space for FRD generation
ssA = [0 1; -1 -2];
ssB = [0; 1];
ssC = [1 0];
ssD = 0*ssC*ssB;
ss_Sys = ss(ssA, ssB, ssC, ssD);
%% Obtain Frequency-Response Data model
w = logspace(-2, 2, 50);
frdSys = frd(ss_Sys, w)
bode(ss_Sys,'b', frdSys,'r--'), grid on
%% Convert Frequency-Response Data model to Linear Time-Invariant System
ltiSys = ssest(frdSys)
%% Extract matrices and store in Workspace for State-space block in Simulink
A = ltiSys.A; % state matrix
B = ltiSys.B; % input matrix
C = ltiSys.C; % output matrix
D = ltiSys.D; % direct matrix
%% Time response of the equivalent FRD model
step(ltiSys), grid on
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!