⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 control_system_toolbox.htm

📁 MATLAB中的control tools box
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<H4>Discrete-time transfer functions</H4><P>Discrete-time (z-)transfer functions and state-space models are created inthe same way as for continuous-time models.</P><P>As an example, to create the transfer function</P><P ALIGN="CENTER">Hdis(z)=(z+0.5)/(z<SUP>2</SUP>+1.5*z+2)</P><P>with sampling time 0.4 (time-units), we execute</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>numdis=[1,0.5]; dendis=[1,1.5,2]; Tsdis=0.4;<BR>Hdis=tf(numdis,dendis,Tsdis);</P></TD></TR></TABLE><P>To display Hdis we execute</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>Hdis</P></TD></TR></TABLE><P> MATLAB's response is </P><BLOCKQUOTE><DL><DT>Transfer function:</DT><DT>z + 0.5</DT><DT>---------------</DT><DT>z^2 + 1.5 z + 2</DT><DT>Sampling time: 0.4</DT></DL></BLOCKQUOTE><P>In digital signal processing (DSP) it is common to use z<SUP>-1</SUP> in thetransfer functions (and not explicitly z). The function &quot;filt&quot;supports this DSP-format, and &quot;filt&quot; requires two vectors (one forthe numerator and one for the denominator) containing the coefficients fordescending orders of z<SUP>-1</SUP>. As an example, to create the transferfunction </P><P ALIGN="CENTER">Hdsp(z)=(1+0.5*z<SUP>-1</SUP>)/(1+1.5*z<SUP>-1</SUP>+2*z<SUP>-2</SUP>)</P><P>with sampling time 0.4 (time-units), we execute</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP" HEIGHT="85"> <P>numdsp=[1,0.5];<BR>dendsp=[1,1.5,2];<BR>Tsdsp=0.4;<BR>Hdsp=filt(numdsp,dendsp,Tsdsp);</P></TD></TR></TABLE><P>To display Hdsp we execute</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>Hdsp</P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P>&nbsp;</P><DL><DT>Transfer function:</DT><DT>1 + 0.5 z^-1</DT><DT>---------------------</DT><DT>1 + 1.5 z^-1 + 2 z^-2</DT><DT>Sampling time: 0.4</DT></DL></BLOCKQUOTE><P>Note: Hdsp(s) is not equal to Hdis(s), although the coefficient vectors areequal! </P><H4>Discrete-time state-space models</H4><P>Discrete-time state-space models are assumed to have the form</P><P ALIGN="CENTER">x(k+1)=Ad*x(k) + Bd*u(k)</P><P ALIGN="CENTER">y(k)=Cd*x(k) + Dd*u(k)</P><P ALIGN="LEFT">where Ad, Bd, Cd, and Dd are matrices. x(k) is thestate-variable, u(k) is the input variable, and y is the output variable (thesevariables are generally vectors having one or more elements). k is thediscrete-time or time-index. Discrete-time state-space models are created usingthe syntax</P><P ALIGN="CENTER">ssdis=ss(Ad, Bd, Cd, Dd, Ts)</P><P>where Ts is the sampling-time. </P>      <hr><H3><A NAME="c22"></A>2.2 Extracting subsystems</H3><P>To create a new system (say, sys1) which is a subsystem of an existingsystem (say, sys), we use the syntax</P><P ALIGN="CENTER">sys1=sys(outputno,inputno)</P><P>As an example, let us extract the transfer function Hsub from input 2 (u2)to the output (y) from the MIMO-transfer function H defined earlier in thischapter:</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>outputno=1; inputno=2;<BR>Hsub=H(outputno,inputno)</P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P>Transfer function from input 2 to output:</P><P>3<BR>-------<BR>5 s + 1</P><P>Input delay: 2</P></BLOCKQUOTE><P>In fact, we can use ordinary matrix-like accessing, like for example&quot;subsys=sys(1,2:4)&quot; which selects inputs 2 to 4 and output 1, thatis, three subsystems altogether. </P>      <hr><H3><A NAME="c23"></A>2.3 Setting and accessing LTI-properties</H3><P>Several <I>properties</I> can be attached to the LTI-objects (orLTI-models). The table belos gives an overview over the properties. To getdetailed information about legal values of the properties, execute &quot;helpltiprops&quot;. </P><P>In the table below, NU, NY, and NX refer to the number of inputs, outputs,and states (when applicable). TF refers to transfer functions, SS tostate-space models, and ZPK to zero-pole-gain models.</P><TABLE STYLE="background:#FFFFFF" BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="306"><TR><TD WIDTH="32%" VALIGN="TOP"> <P><B>Name</B></P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Description</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>Applies to LTI-object of type</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Ts</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Sample Time</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>All</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Td</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Input delays</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>All (only continuous systems)</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Inputname</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Input names</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>All</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Outputname</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Output names</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>All</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Notes</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Notes on model history</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>All</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP">Userdata</TD><TD WIDTH="37%" VALIGN="TOP"> <P>Additional data</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>All</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Num</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Numerator</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>TF</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Den</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Denominators</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>TF</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Variable</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Transfer function variable (e.g. 's' or 'z') </P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>TF, ZPK</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>Z</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Zeros</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>ZPK</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>P</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Poles</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>ZPK</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>K</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Gains</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>ZPK</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>A</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Matrix A</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>SS</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>B</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Matrix B</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>SS</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>C</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Matrix C</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>SS</P></TD></TR><TR><TD WIDTH="32%" VALIGN="TOP"> <P>D</P></TD><TD WIDTH="37%" VALIGN="TOP"> <P>Matrix D</P></TD><TD WIDTH="31%" VALIGN="TOP"> <P>SS</P></TD></TR></TABLE><P>To see the values of the properties of a model, we use &quot;get&quot;. Letus as an example look at the properties of the MIMO-transfer function H definedearlier:</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>get(H)</P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P>num={1x2 cell}</P><P>den={1x2 cell}</P><P>Variable='s'</P><P>Ts=0</P><P>Td=[1 2]</P><P>InputName={2x1 cell}</P><P>OutputName={''}</P><P>Notes={}</P><P>UserData=[]</P></BLOCKQUOTE><P>We can access specific LTI-properties. Let us as an example assign the valueof the property Td of H to the variable Tdvec:</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>Tdvec=get(H,'Td') </P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P>Tdvec=</P><P>1 2</P></BLOCKQUOTE><P> To <I>set </I>certain LTI-properties, we use &quot;set&quot;. Let us as anexample set the property InputName of H to {'Voltage';'Flow'}, which is a cellarray:</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>set(H,'InputName',{'Voltage';'Flow'})</P></TD></TR></TABLE><P>These input names are now used when displaying information about H:</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>H</P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P> Transfer function from input &quot;Voltage&quot; to output: </P><P>2 s<BR>-------<BR>4 s + 1</P><P>Transfer function from input &quot;Flow&quot; to output:</P><P>3<BR>-------<BR>5 s + 1</P><P>Input delays (listed by channel): 1 2</P></BLOCKQUOTE>      <hr><H3><A NAME="c24"></A>2.4 Conversion between transfer functions and state-spacemodels </H3><H4>From state-space model to transfer function</H4><P>The function &quot;tf&quot; converts state-space models to a correspondingtransfer function according to the formula(s)</P><BLOCKQUOTE> <P>H(s)=C(sI-A)<SUP>-1</SUP>B + D (continuous-time case)</P><P>Hd(z)=Cd(zI-Ad)<SUP>-1</SUP>Bd + Dd (discrete-time case)</P></BLOCKQUOTE><P>In the following example a <I>continuous-time</I> state-space model isconverted to a corresponding (continuous-time) transfer function:</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>A= -1; B=2; C=3; D=4; <BR>sscont1=ss(A,B,C,D);<BR>Hcont1=tf(sscont1)</P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P>Transfer function:</P><P>4 s + 10<BR>--------<BR>s + 1</P></BLOCKQUOTE><P>And in the following example a <I>discrete-time</I> state-space model isconverted to a corresponding (discrete-time) transfer function (thesampling-time is 0.1):</P><TABLE BORDER="1" CELLSPACING="1" BORDERCOLOR="#000000" CELLPADDING="4" WIDTH="633"><TR><TD VALIGN="TOP"> <P>Ad=0.5; Bd=0.2; Cd=0.3; Dd=0.4; Ts=0.1;<BR>ssdis1=ss(Ad,Bd,Cd,Dd,Ts);<BR>Hdis1=tf(ssdis1)</P></TD></TR></TABLE><P>MATLAB's response is</P><BLOCKQUOTE> <P>Transfer function:</P><P>0.4 z - 0.14<BR>------------<BR>z - 0.5</P><P>Sampling time: 0.1</P></BLOCKQUOTE><H4>From transfer function to state-space model</H4><P>&quot;ss&quot; converts a transfer function to a state-space model. But thisconvertion is not unique, since there are an infinite number of state-spacemodels which have the same transfer functions. Hence, &quot;ss&quot; choosesone such realization, called the controller-canonical form. </P>      <hr><H3> <A NAME="c25"></A>2.5 Conversion between continuous-time and discrete-timemodels</H3><H4> From discrete-time to continuous-time</H4><P>A continuous-time LTI-model can be discretized using the function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -