1.1 Creating tf and state space and different Conversion of forms

1.1.1 Create continuous time transfer function given the poles, zeros and gain

Problem: Find the transfer function \(H(s)\) given zeros \(s=-1,s=-2\), poles \(s=0,s=-4,s=-6\) and gain 5.



Mathematica



 


Matlab



 


Maple

\[ \text{tf} = \left [{\begin{array}{c}{\frac{5\,{s}^{2}+15\,s+10}{{s}^{3}+10\,{s}^{2}+24\,s}}\end{array}} \right ] \]



\[ 5*s^2+15*s+10 \]



\[ s*(s^2+10*s+24) \]



 

1.1.2 Convert transfer function to state space representation

problem 1

Problem: Find the state space representation for the continuous time system defined by the transfer function \[ H(s)=\frac{5s}{s^{2}+4s+25}\]



Mathematica

pict



pict



 


Matlab



 


Maple

\[ \left [{\begin{array}{cc} 0 & 1 \\ -25 & -4 \end{array}} \right ] \]



\[ \left [{\begin{array}{c} 0\\ 1\end{array}} \right ] \]



\[ \left [{\begin{array}{cc} 0&5\end{array}} \right ] \]



\[ \left [{\begin{array}{c} 0\end{array}} \right ] \]



 

problem 2

Problem: Given the continuous time S transfer function defined by \[ H(s)=\frac{1+s}{s^{2}+s+1}\] convert to state space and back to transfer function.



Mathematica

\[ \left ({\begin{array}{cc|c|c} 0 & 1 & 0 \\ -1 & -1 & 1 \\ \hline 1 & 1 & 0 \\ \end{array}} \right )_{} \]

\[ \frac{s+1}{s^2+s+1} \]



 


Matlab





 

1.1.3 Create a state space representation from A,B,C,D and find the step response

Problem: Find the state space representation and the step response of the continuous time system defined by the Matrices A,B,C,D as shown



Mathematica

pict



 


Matlab

pict



 


Maple

pict



 

1.1.4 Convert continuous time to discrete time transfer function, gain and phase margins

Problem: Compute the gain and phase margins of the open-loop discrete linear time system sampled from the continuous time S transfer function defined by \[ H(s)=\frac{1+s}{s^{2}+s+1}\] Use sampling period of 0.1 seconds.



Mathematica

pict



pict





pict



 


Matlab



pict



 

1.1.5 Convert differential equation to transfer functions and to state space

Problem: Obtain the transfer and state space representation for the differential equation \[ 3\frac{d^{2}y}{dt^{2}}+2\frac{dy}{dt}+y\left ( t\right ) = u(t) \]



Mathematica

pict



pict



 


Matlab





 


Maple

\[ \frac{1}{3{s}^{2}+2\,s+1} \]



\[ \left \{ \left [{\begin{array}{cc} 0&1\\ \noalign{\medskip }-1/3&-2/3 \end{array}} \right ] , \left [{\begin{array}{c} 0\\ \noalign{\medskip } 1\end{array}} \right ] , \left [{\begin{array}{cc} 1/3&0\end{array}} \right ] , \left [{\begin{array}{c} 0\end{array}} \right ] \right \} \]



 

1.1.6 Convert from continuous transfer function to discrete time transfer function

Problem: Convert \[ H\left (s\right ) = \frac{1}{s^2+10 s+10} \]

To \(Z\) domain transfer function using sampling period of \(0.01\) seconds and using the zero order hold method.



Mathematica

pict



 


Matlab



 

1.1.7 Convert a Laplace transfer function to an ordinary differential equation

Problem: Give a continuous time transfer function, show how to convert it to an ordinary differential equation. This method works for non-delay systems. The transfer function must be ratio of polynomials. For additional methods see this question at stackexchange



Mathematica