状态空间模型仿真

时间:2019-04-06 05:41:32

标签: matlab simulation state-space

我需要模拟和绘制如下所示的状态空间系统的帮助:

https://i.imgur.com/lBzvRif.png

对于第一个过程,我尝试从初始值x 0 = 0开始,并模拟一个时间序列:x 1 -> x T ; T = 500。 并且,最终以总共50个实现绘制了仿真图。 到目前为止,这是我尝试做的事情:

R = 50;   % Number of realizations  
% ----- PROCESS 1: x_t = x_t-1 + u_t ----- %
T = (1:500)';                                     % Time vector (column vector)
x = 0;                                            % x Initial value
sigma_sq = 1; sigma = sqrt(sigma_sq);             % Obtain 
variance/standard deviation of noise
u = normrnd(0, sigma, length(T), 1);              % Draw noise random samples

figure('Name', 'Case 1: Process 1');              
grid on;                                          
% Simulate Process for 50 Realizations %
hold on;
for i = 1:R % Number of Realizations
    x = x + u;  % Calculate Process 1 Signal
    plot(t, x, 'LineWidth', 0.1);  
end
hold off;

0 个答案:

没有答案