Can anyone tell me how to implement the following time-varying state space model

2 views (last 30 days)

Answers (1)

nick
nick on 4 Oct 2023
Hi Bella,
I understand that you are facing trouble in implementation of state space model with additive white gaussian noise.
The “kalmanand “ss” function can be used for such an implementation.
% Define the system matrices
A = [0.8, 0.2; -0.3, 0.5]; %state transition matrix
B_ = [zeros(size(A,1),1) eye(size(A,1))]; % there is no effect of input, so B=0 and G is identity; B_=[B G]
C = [1 0]; %measurement matrix
D_ = [zeros(size(C,1),1) zeros(size(C,1),size(A,1))]; %H is 0 of appropriate dimension according to question and again due to similar reasons in B_, D=0 ; D_= [D H]
Q = 0.1*eye(size(A,1)); % assumed process covar
R = 0.2*eye(size(C,1)); % assumed measurement covar
N = zeros(size(A,1), size(C,1)); % Nw by Ny matrix ; considered as 0 as there is no correlation between process noise and measurement noise
sys = ss(A,B_,C,D_); % since your state-space model is input independent B=0 and D=0
[kalmf,l,p] = kalman(sys,Q,R,N) %kalmf is state space model that produces state estimates and true plant output estimates
Kindly refer to the below documentations ofkalman” and “ss” function :
Hope it helps.
Regards,
Neelanshu

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!