function [Ag,Bg,Cg] = adasblocks_utilGetLongVehModelFromParam(tau)
%#codegen
%
% Get state-space continuous vehicle model from vehicle parameters with
% input: longitudinal acceleration
% output: longitudinal velocity
%
% Parameters
%     tau: time constant for acceleration tracking
% Vehicle state-space model with state varaibles x = [ades,Vx]. 
%    ades: desired acceleration
%      Vx: longitudinal velocity

%   Author: Meng Xia, Rong Chen
%   Copyright 2017-2018 The MathWorks, Inc.

% Specify dynamics: dx = [a1,a2;a3,a4]x + [b1;b2]u; y = x.
a1 = -1/tau;
a2 = 0;
a3 = 1;
a4 = 0;
b1 = 1/tau;
b2 = 0;
% Specify state-space matrices.
Ag = [a1,a2;a3,a4];
Bg = [b1;b2];
Cg = [0,1];