Comparison of State-Space Model with Retardation Function and Radiation Coefficients

In order to reduce the computational load, we sometimes consider to approximate the retardation function with state-space model. Here is the code which can be used to verify the accuracy of the approximation.

% sys=ss(a,b,c,d); % state-space model
% w: frequency vector
% Ainf: infinite-frequency added mass
% A: Added mass
% B: Potential damping
% t: time


sysFD=freqresp(sys,w);
sysFD=reshape(sysFD,size(w));
Bhat=real(sysFD);
Ahat=imag(sysFD)./w + Ainf;
Khat=impulse(sys,t);
                
Kjw = B+complex(0,w).*(A-Ainf*ones(size(A)));
Kamp = abs(Kjw);
Kpha = angle(Kjw)*180/pi;
[amp,pha]=bode(sys,w);

figure(1);
subplot(211);
plot(w,[A,Ahat]); grid on
legend('A','Aest');
subplot(212);
plot(w,[B,Bhat]); grid on
legend('B','Best');

figure(2);
plot(t,[K,Khat]);
grid on;
legend('K','Kest');

figure(3);
subplot(211);
plot(w,Kamp,w,amp(:));
ylabel('amp');
legend('K','Kest');
subplot(212);
plot(w,Kpha,w,pha(:));
ylabel('pha');

Leave a Comment

Your email address will not be published. Required fields are marked *