function [t_k,N,Phi,Q] = weathervane_system(omega_n,zeta,q_C,dt,T) % % Inputs: % % Written by: % -- % John L. Weatherwax 2005-08-14 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- a = -omega_n^2; b = -2*zeta*omega_n; % Generate the grid we consider measurements on: N = T/dt; t_k = 0:dt:T; % Compute the discrete system matrix Phi: F = [ 0, 1; -omega_n^2, -2*zeta*omega_n ]; Phi = expm( F * dt ); % Use the previous code to compute the discretized noise covariance matrix Q(\Delta t): L = [ 0; 1 ]; L_Qc_LT = L * q_C * L'; Nsteps = 100; % number of integration steps Q = example_4_2_2_compute_qkm1( a, b, L_Qc_LT, dt, Nsteps ); % before multiplication of omega_n^4 Q = omega_n^4 * Q; % after multiplication of omega_n we have the complete process noise covariance