📄 matlab.tex
字号:
\chapter{\matlab{} Functions}\hysdel{} comes with a number of \matlab{} functions. This sectionreports verbatim the \matlab{} help for those commands.\section{Main Routines}\subsection{hysdel}\index{hysdel}{\footnotesize\begin{verbatim}% hysdel(filename,simname,options)% Compiles the HYSDEL list <filename.hys>,% generates the M-file <filename.m>%% INPUT:% filename: the hysdel source% simname : if not empty, generates the HYSDEL simulator (see manual)% options : a string of space separated command line switches to append to% HYSDEL call (see HYSDEL manual, it includes: -p -a -5% --no-symbol-table --no-row-info --no-params-checks% --matlab-symbolic -v[0-3])%% OUTPUT:% filename.m and simname.m on disk%% (C) 2000--2002 F.D. Torrisi,% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{hybsim}\index{hybsim}{\footnotesize\begin{verbatim}% [XX,DD,ZZ,YY]=HYBSIM(X0,UU,FILE,PARS,OPT)% Simulates a hybrid system% if sys is a simulator-file-name, uses the Matlab simulator (see HYSDEL Manual)% if sys is a MLDstructure, uses MLDSIM which solves a Mixed Integer Program% (see MLDSIM)%% INPUT:% X0 : is the initial condition;% UU : is the input vector u(t) = UU(:,t);% SYS : system either the filename of the Matlab simulator% or the Name of the MLD struct% PARS: is the parameters structure passed to the one step% Matlab simulator (see HYSDEL Manual, Simulator)% OPT : are the options passed to the one step MLDsimulator MLDSIM (see MLDSIM)%% OUTPUT:% XX : is the state trajectory% DD : is the auxiliary bool variables trajectory% ZZ : is the auxiliary real variables trajectory% YY : is the output trajectory%% REMARK:% using the matlab simulator is much faster. The results produced by the two% approaches should be the same.%% SEE:% matlab simulator (in the HYSDEL manual, simulator)% MLDSIM% PANMIP% MIQP%% (C) 2002 F.D. Torrisi% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{hylink}\index{hylink}{\footnotesize\begin{verbatim}%HYLINK: HYSDEL models in simulink via S-function%% use: drag a simulink block of type 'S-function' in your simulink model% set the function name to hylink and the filename as parameter.% The optional parameter x0 sets the initial state.% Use multiplex/demultiplex to access all the inputs/outputs%% (C) 2000--2002 F.D. Torrisi,% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{syminfo}\index{syminfo}{\footnotesize\begin{verbatim}% info = syminfo(S, vname, vtype, vkind, vindex)% extract infos from the symble table% look up the symble table for entries matching the query% item.name == name AND item.type == type AND item.kind == kind% empty field ('') matches all entries%% INPUT:% S : the system name% vname : var name as in the Hysdel source% vtype : var type ('b','r')% vkind : var kind ('x','u','d','z')% vindex: var index%% OUTPUT% info : cell array of info records saisfying the query%% REMARK% the contents of the syminfo records are detailed in the HYSDEL manual in the% section describing the MLD-structure%% (C) 2001 by F.D. Torrisi% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{gen\_log}\index{gen\_log}{\footnotesize\begin{verbatim}% gen_log(S, log)% generates log-file of all variables%% INPUT:% S : structure containing the MLD-model% log: structure containing the log-data of all variables (d, z, u, x, y)% obtained by runing 'hybsim.m' i.e.: log.x has the dimensions% nx times nm (nx=number of states, nm=number of time-steps)%% OUTPUT:% a logfile ''systemname''.log on disk%% (C) 2002 Tobias Geyer% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% geyer@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{mldsim}{\footnotesize\begin{verbatim}% function [xt1, dt, zt, yt, fl, eps] = mldsim( m, xt, ut, Options )% Simulates an MLD System. Given the MLD system and the current state and% input, computes the next state and the current output.%% INPUT:% m : MLD system% xt : current state% ut : current input% Options: 1. Specify with Options.solver the miqp solver desired, e.g. like:% Options.solver = 'miqp';% SEE PANMIP% 2. Specify options for the choosen solver e.g. like:% Options.miqp.solver = 'linprog';% SEE PANMIP% 3. Specify options for the simulation% Options.large : specifies the magnitude of the box bounds% for the solver% 4. Specify options to debug models (see implementation for details)% Options.relaxIneq = 1: relax inequalities to maintain feasibility% Options.relaxU = 1 : relax inputs%% OUTPUT:% xt1 : next time step% dt : delta vector% zt : zeta vector% yt : output vector% fl : flags from the MIP solver% eps : epsilon needed in relaxation (see implementation for details)%% REMARK:% Requires panmip as solver interface and some solver supported by panmip%% (C) 1998--2002 D. Mignone% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% mignone@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{hysdel\_old}\index{hysdel\_old}{\footnotesize\begin{verbatim}% hysdel_old(filename)% THIS FILE GENERATES THE DEPRECATED MLD STRUCTURE 1.0% IT IS PROVIDED FOR BACKWARDS COMPATIBILITY.%% INPUT:% filename: the hysdel source%% OUTPUT:% filename.mat on disk%% REMARK:% the M-file <hout.m> contains the system in the new format. Use% load filename.mat if you want to access the system in the old format.%% (C) 2000--2002 by F.D. Torrisi, A. Bemporad, T. Geyer% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi|bemporad|geyer@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\subsection{new2old}{\footnotesize\begin{verbatim}% Sold = new2old(S)% THIS FILE TRANSLATES THE MLD STRUCTURE INTO THE DEPRECATED MLD STRUCTURE 1.0% IT IS PROVIDED FOR BACKWARDS COMPATIBILITY.%% INPUT:% S : a MLD-structure 2.0%% OUTPUT:% Sold: a MLD-structure 1.0%% (C) 2002 by F.D. Torrisi% Automatic Control Laboratory, ETH Zentrum, CH-8092 Zurich, Switzerland% torrisi@aut.ee.ethz.ch%% see license.txt for the terms and conditions.\end{verbatim}}\section{Support Routines}This is the list of additional routines that come with \hysdel{}:mld2mat.m (extracts matrices from the MLD structure), panmip.m(common MIP interface), miqp.m (free MIQP solver).\section{Contributed Routines}The subdirectory contrib of the \hysdel{} distribution, containsroutines contributed by the users: pwa2hys.m (Piecewise affine to\hysdel{}), con\_list6.m (adjacency map for a polyhedralpartition)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -