How to deal with Extended Kalman Filter in Simulink when my state transition function is given in continuous time form?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have an EKF with the above state transition function.
where u=[fm omega]
Control Systems Toolkit EKF requires state transition function in the discrete time form:
x(k+1) = f(x(k),w(k),StateTransitionFcnInputs)
However the equation I want to use is in the continuous time with derivative of the state space in LHS. Can I get Simulink EKF to work with such a state transition matrix?
0 Kommentare
Antworten (1)
Bill Tubbs
am 5 Mai 2021
Check out the examples in the documentation here:
The example looks like this:
function x = vdpStateFcn(x)
% vdpStateFcn Discrete-time approximation to van der Pol ODEs for mu = 1.
% Sample time is 0.05s.
%
% Example state transition function for discrete-time nonlinear state
% estimators.
%
% xk1 = vdpStateFcn(xk)
%
% Inputs:
% xk - States x[k]
%
% Outputs:
% xk1 - Propagated states x[k+1]
%
% See also extendedKalmanFilter, unscentedKalmanFilter
% Copyright 2016 The MathWorks, Inc.
%#codegen
% The tag %#codegen must be included if you wish to generate code with
% MATLAB Coder.
% Euler integration of continuous-time dynamics x'=f(x) with sample time dt
dt = 0.05; % [s] Sample time
x = x + vdpStateFcnContinuous(x)*dt;
end
function dxdt = vdpStateFcnContinuous(x)
%vdpStateFcnContinuous Evaluate the van der Pol ODEs for mu = 1
dxdt = [x(2); (1-x(1)^2)*x(2)-x(1)];
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu State-Space Control Design and Estimation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!