function [A,B,C,D,K,X0] = motor(par,ts,aux)
%MOTOR  Describes the dc-motor with time-constant t (= par) and
%       known static gain G. The sampling interval is ts. The conversion to
%       a sampled model is inhibited if ts is entered as a negative number.
%       This is to allow for desirable features in the 'present'and 'eta2ss'
%       commands.

%	L. Ljung
%	Copyright (c) 1986-95 by the MathWorks, Inc.
%	$Revision: 1.3 $  $Date: 1995/05/10 21:36:59 $

t = par;
G=aux(1); 

A=[0 1;0 -1/t];
B=[0;G/t];
C=eye(2);
D=[0;0];
K=zeros(2,2);
X0=[0;0];
if ts>0 % Sample the model with sampling interval ts
s = expm([[A B]*ts; zeros(1,3)]);
A = s(1:2,1:2);
B = s(1:2,3);
end
