📄 user_manual.tex
字号:
each \textsl{da-item} is one of the following: %\bs \textsl{var} \verb@=@ \verb@{@ \verb@IF@ \textsl{Boolean-expr}\verb@THEN@ \textsl{affine-expr} \verb@[@\textsl{min}\verb@,@\textsl{max}\verb@,@ \textsl{epsilon}\verb@]@\opt\verb@};@\\\textsl{var} \verb@=@ \verb@{@ \verb@IF@ \textsl{Boolean-expr}\verb@THEN@ \textsl{affine-expr} \verb@[@\textsl{min}\verb@,@\textsl{max}\verb@,@ \textsl{epsilon}\verb@]@\opt \\ \verb@ELSE@ \textsl{affine-expr}\verb@[@\textsl{min}\verb@,@ \textsl{max}\verb@,@\textsl{epsilon}\verb@]@\opt\verb@};@ \es %here, the variable \textsl{epsilon} is a placeholder and isintroduced for symmetry with the AD section\footnote{The oldbounds declaration \texttt{[}\textsl{max}\texttt{,}\textsl{min}\texttt{,} \textsl{epsilon}\texttt{]} is stillaccepted but is deprecated and will raise a warning.}. If the\verb@ELSE@ part is omitted, is is assumed to be 0.\begin{example} The command signal $u$ to an electric motoris passed through a nonlinear amplifier, which has two modes ofoperation: high gain and low gain. In ``low gain'' the amplifiercompletely rejects the noise $d$, while in ``high gain'' it onlyattenuates it. The Boolean input $l=1$ selects the low gain mode.The actual signal $u_{\rm comp}$ applied to the motor is $ u_{\rmcomp} = u$ if $l=1$, otherwise $u_{\rm comp} = 2.3u + 0.4d$.\vinput{l0002.hys}\end{example}\subsubsection{\hs{CONTINUOUS} Section}The \hs{CONTINUOUS} sectiondescribes the linear dynamics, expressed as difference equations.This section models the remainingEquation~(\ref{eq::z-transform-c}) of the SAS.\noindent The general syntax is: %\bs \verb@CONTINUOUS@\verb@{@\textsl{cont-item}\more\verb@}@\es %and each \textsl{cont-item} has the form: %\bs \textsl{var} \verb@=@ \textsl{affine-expr} \verb@;@ \es %% Note that in some former version of \hysdel{}, \textsl{cont-item} had% the form:% \bs \textsl{var} \verb@=@ \textsl{linear-expr} \verb@;@ \es %% see {\bf metti a posto qui}\subsubsection{\hs{LINEAR} Section} \hysdel{} allows also to define acontinuous variable as an affine function of continuous variablesin the \hs{LINEAR} section.\noindent The general syntax is: %\bs \verb@LINEAR@\verb@{@\textsl{lin-item}\more\verb@}@\es %and each \textsl{lin-item} has the form: %\bs \textsl{var} \verb@=@ \textsl{affine-expr} \verb@;@ \es %This section, together with the \hs{CONTINUOUS} and \hs{AD}sections allows more flexibility when modeling the SAS. This extraflexibility allows algebraic loops that may render undefinedtrajectories of the model. The \hysdel{} compiler integrates asemantic checker that is able to detect and report such abnormalsituations.\subsubsection{\hs{AUTOMATA} Section} The \hs{AUTOMATA} sectionspecifies the state transition equations of the finite statemachine (FSM) as Boolean functions $x_b'(k) = f_{\rmB}(x_b(k),u_b(k),\delta_e(k))$.\noindent The general syntax is: %\bs \verb@AUTOMATA@\verb@{@\textsl{automata-item}\more\verb@}@\es %and each \textsl{automata-item} is as follows: %\bs \textsl{var} \verb@=@ \textsl{Boolean-expr} \verb@;@ \es %\begin{example} An outflow unit of a hydroelectric power plant isdescribed by the automaton of Figure~\ref{fig:auto}.\begin{figure}\begin{center}\includegraphics[width=8cm]{fsm.eps}\caption{Finite state machine of an outflow unit} \label{fig:auto}\end{center}\end{figure}{\vinput{l0006.hys}} % add in the header: \usepackage{verbatim}\end{example}\subsubsection{\hs{MUST} Section} \label{sec.must}The \hs{MUST} section specifies constraints on continuous andBoolean variables, i.e., linear constraints and Boolean formulas,and therefore it allows defining the sets $\XX_r$, $\XX_b$,$\UU_r$, $\UU_b$, $\YY_r$, $\YY_b$ (more generally, the \hs{MUST}section allows also mixed constraints on states, inputs, andoutputs).\noindent The general syntax is: %\bs \verb@MUST@\verb@{@\textsl{must-item}\more\verb@}@\es %and each \textsl{must-item} is one of the following: %\bs \textsl{affine-expr} \verb@<=@\textsl{affine-expr} \verb@;@ \\\textsl{affine-expr} \verb@>=@\textsl{affine-expr} \verb@;@ \\\textsl{Boolean-expr} \verb@;@ \es %\begin{example} The level $h$ in a water tank must be nonnegativeand below the maximum height $h_{max}$ of the tank, $0 \leq h \leqh_{max}$. {\vinput{l0007.hys}}\end{example}\subsubsection{Symbolic manipulation, and Cast operator}\hysdel{} implements a simple symbolic computation tool. Thesimple symbolic manipulator handles efficiently linear and affineexpression but cannot detect that an expression is linear if itinvolves cancellation on nonlinear terms.\begin{example}\hysdel{} will report an error with the following source:{\vinput{l0009.hys}}\end{example}A Boolean expression \textsl{Boolean-expr} has a conventionalvalue of 1 if true and 0 otherwise, the value of a Booleanexpression can be used in affine expressions by using the castoperator: \verb@(REAL @ \textsl{Boolean-expr} \verb@)@.\begin{example}The flow through a pipe is 10 l/s if both valve v1 and valve v2are opened, 0 otherwise {\vinput{l0008.hys}}\end{example}\subsection{\hysdel{} Compiler}Once the \hysdel{} model of a system is available, the companion\hysdel{} compiler is able to generate the equivalent MLD model.\subsubsection{Mixed Logical Dynamical (MLD) Systems} \index{MixedLogical Dynamical Systems} In~\cite{BM99}, the authors proposeddiscrete-time hybrid systems denoted as mixed logical dynamical(MLD) systems. An MLD system is described by the followingrelations: \MLDsystem{MLDS}{,} where $x_r \in \rr^{n_{xr}}$, $x_b\in \{0,1\}^{n_{xb}}$, $u_r \in \rr^{n_{ur}}$, $u_b \in\{0,1\}^{n_{ub}}$, $y_r \in \rr^{n_{yr}}$, $y_b \in\{0,1\}^{n_{yb}}$, $z \in \rr^{n_{z}}$, and $\delta \in\{0,1\}^{n_{\delta}}$. All the $E_i$ matrices have $n_e$ rows.A more general form of the MLD systems is: \BDMLDsystem{XMLDS}{,}where $x_{\;\!\centerdot}$, $u_{\;\!\centerdot}$,$y_{\;\!\centerdot}$, $z$, and $\delta$ are as before, we denotethis variant as extended MLD form. Note that the matrices$B_{5c}$, $B_{5d}$, $D_{5c}$, and $D_{5d}$ do not introduce anyfurther expressivity in the MLD model but are useful to keep thesize of the models contained.\index{parameters!Matlab declaration} The parameters declared inthe system form the coefficients of the $E$ matrices. If thesystem has symbolic parameters, then \hysdel{} generates asymbolic output and assumes a structure called \mcmd{params} widtha field with the same name as each symbolic parameter.\begin{example}The interface declaration:\begin{verbatim}INTERFACE { PARAMETER { REAL p1,p2; }}\end{verbatim}assumes that the fields \mcmd{params.p1} and \mcmd{params.p2} aredefined in the structure \mcmd{params}.\end{example}Given the current state $x(k)$ and input $u(k)$, thetime-evolution of~(\ref{XMLDS}) could be determined by solving$\delta(k)$ and $z(k)$ from~(\ref{XMLDS.c}), and then updating$x'(k)$ and $y(k)$ from~(\ref{XMLDS.a})--(\ref{XMLDS.b}).\index{Simulator} \hysdel{} can also produce a function tosimulate the hybrid system, this function directly uses thedefinitions in the \hysdel{} source and does not rely on any mixedinteger solver.\begin{verbatim}function [xn, d, z, y] = sys_name (x, u, params)\end{verbatim}\code{x} is the current state, \code{u} the input, and\code{params} the structure specifying the values for everysymbolic parameter and can be omitted if there is no symbolicparameter. The function computes one time step and returns the newstate as \code{xn} and the output as \code{y}. It also providesthe auxiliary variables \code{d} and \code{z}. \code{xn},\code{d}, \code{z}, \code{y}, \code{x} and \code{u} are vectors.The order of the variables corresponds to the order in which thereal variables are stored before the Boolean ones, otherwise theorder corresponds to the order in which they are declared in the\hysdel{}.\subsubsection{Command Line}\index{Command Line Options}\hysdel{} accepts the following command line options:\begin{description}\item[\texttt{-h},\texttt{--help}]Print help and exit.\item[\texttt{-V},\texttt{--version}]Print version and exit.\item[\texttt{-iSTRING},\texttt{--input=STRING}]\hysdel{} inputfilename (default=stdin). %\item[\texttt{-mSTRING},\texttt{--MLDoutput=STRING}] MLD outputfile name (without extension) (default=stdout). %\item[\texttt{-sSTRING},\texttt{--SIMoutput=STRING}] Simulatorfile name (without extension). %\item[\texttt{-p}, \texttt{--parametric}] Force all parameters tobe handled as symbolic parameters. %\item[\texttt{-a}, \texttt{--allow-affine}] Allow affine state andoutput functions. Former version of \hysdel{} did not allowsconstant terms $a_0$ in the affine state and output functions.This limitation comes directly from equation~(\ref{MLDS.a}) and~(\ref{MLDS.b}). The option \texttt{-a} overrides that limitationby adding an auxiliary variable $z = a_0$. The output generated isbackwards compatiblebut somehow redundant. See also the next \texttt{-5} option.%\item[\texttt{-5}, \texttt{--allow-B5-D5}] Use Extended MLD form(\ref{XMLDS}) (implies -a). Note that the Extended MLD form mayproducewrong results with old algorithms.%\item[\texttt{--no-symbol-table}] Omit the symbol tableinformation. %\item[\texttt{--no-row-info}] Omit row information.\item[\texttt{--no-params-checks}] Omit checks for symbolicparameters. %\item[\texttt{--matlab-symbolic}] Support for \matlab{} symbolictoolbox for parameters. %\item[\texttt{-vINT}, \texttt{--verbose=INT}] Verbosity level(0=silent, 3=max) (default=2).\end{description}\input{MLD_structure.tex}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -