Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> help laplace
- --- help for sym/laplace ---
- laplace Laplace transform.
- L = laplace(F) is the Laplace transform of the sym F with default
- independent variable t. The default return is a function of s.
- If F = F(s), then laplace returns a function of z: L = L(z).
- By definition, L(s) = int(F(t)*exp(-s*t),t,0,inf).
- L = laplace(F,z) makes L a function of z instead of the default s:
- laplace(F,z) <=> L(z) = int(F(t)*exp(-z*t),t,0,inf).
- L = laplace(F,w,u) makes L a function of u instead of the
- default s (integration with respect to w).
- laplace(F,w,u) <=> L(u) = int(F(w)*exp(-u*w),w,0,inf).
- Examples:
- syms a s t w x F(t)
- laplace(t^5) returns 120/s^6
- laplace(exp(a*s)) returns -1/(a-z)
- laplace(sin(w*x),t) returns w/(t^2+w^2)
- laplace(cos(x*w),w,t) returns t/(t^2+x^2)
- laplace(x^(3/2),t) returns (3*pi^(1/2))/(4*t^(5/2))
- laplace(diff(F(t))) returns s*laplace(F(t),t,s) - F(0)
- See also sym/ilaplace, sym/fourier, sym/ztrans, subs.
- >> syms s
- >> G=(5*s+12)/(s^2+5*s+6)
- G =
- (5*s + 12)/(s^2 + 5*s + 6)
- >> ilaplace(G)
- ans =
- 2*exp(-2*t) + 3*exp(-3*t)
- >> ilaplace(G*1/s)
- ans =
- 2 - exp(-3*t) - exp(-2*t)
- >> G=(5*s+12)/(s^2+5*s)
- G =
- (5*s + 12)/(s^2 + 5*s)
- >> ilaplace(G)
- ans =
- (13*exp(-5*t))/5 + 12/5
- >> help tf
- tf Construct transfer function or convert to transfer function.
- Construction:
- SYS = tf(NUM,DEN) creates a continuous-time transfer function SYS with
- numerator NUM and denominator DEN. SYS is an object of type tf when
- NUM,DEN are numeric arrays, of type GENSS when NUM,DEN depend on tunable
- parameters (see REALP and GENMAT), and of type USS when NUM,DEN are
- uncertain (requires Robust Control Toolbox).
- SYS = tf(NUM,DEN,TS) creates a discrete-time transfer function with
- sample time TS (set TS=-1 if the sample time is undetermined).
- S = tf('s') specifies the transfer function H(s) = s (Laplace variable).
- Z = tf('z',TS) specifies H(z) = z with sample time TS.
- You can then specify transfer functions directly as expressions in S
- or Z, for example,
- s = tf('s'); H = exp(-s)*(s+1)/(s^2+3*s+1)
- SYS = tf creates an empty tf object.
- SYS = tf(M) specifies a static gain matrix M.
- You can set additional model properties by using name/value pairs.
- For example,
- sys = tf(1,[1 2 5],0.1,'Variable','q','IODelay',3)
- also sets the variable and transport delay. Type "properties(tf)"
- for a complete list of model properties, and type
- help tf.<PropertyName>
- for help on a particular property. For example, "help tf.Variable"
- provides information about the "Variable" property.
- By default, transfer functions are displayed as functions of 's' or 'z'.
- Alternatively, you can use the variable 'p' in continuous time and the
- variables 'z^-1', 'q', or 'q^-1' in discrete time by modifying the
- "Variable" property.
- Data format:
- For SISO models, NUM and DEN are row vectors listing the numerator
- and denominator coefficients in descending powers of s,p,z,q or in
- ascending powers of z^-1 (DSP convention). For example,
- sys = tf([1 2],[1 0 10])
- specifies the transfer function (s+2)/(s^2+10) while
- sys = tf([1 2],[1 5 10],0.1,'Variable','z^-1')
- specifies (1 + 2 z^-1)/(1 + 5 z^-1 + 10 z^-2).
- For MIMO models with NY outputs and NU inputs, NUM and DEN are
- NY-by-NU cell arrays of row vectors where NUM{i,j} and DEN{i,j}
- specify the transfer function from input j to output i. For example,
- H = tf( {-5 ; [1 -5 6]} , {[1 -1] ; [1 1 0]})
- specifies the two-output, one-input transfer function
- [ -5 /(s-1) ]
- [ (s^2-5s+6)/(s^2+s) ]
- Arrays of transfer functions:
- You can create arrays of transfer functions by using ND cell arrays
- for NUM and DEN above. For example, if NUM and DEN are cell arrays
- of size [NY NU 3 4], then
- SYS = tf(NUM,DEN)
- creates the 3-by-4 array of transfer functions
- SYS(:,:,k,m) = tf(NUM(:,:,k,m),DEN(:,:,k,m)), k=1:3, m=1:4.
- Each of these transfer functions has NY outputs and NU inputs.
- To pre-allocate an array of zero transfer functions with NY outputs
- and NU inputs, use the syntax
- SYS = tf(ZEROS([NY NU k1 k2...])) .
- Conversion:
- SYS = tf(SYS) converts any dynamic system SYS to the transfer function
- representation. The resulting SYS is always of class tf.
- See also tf/exp, filt, tfdata, zpk, ss, frd, genss, USS, DynamicSystem.
- Reference page for tf
- Other functions named tf
- >> G=tf([5 12], [1 5 6])
- G =
- 5 s + 12
- -------------
- s^2 + 5 s + 6
- Continuous-time transfer function.
- >> pzmap(G)
- >> s=tf('s')
- s =
- s
- Continuous-time transfer function.
- >> G=(s+2)*(s-4)/(s+3)/(s+4)/(s+6)
- G =
- s^2 - 2 s - 8
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> syms K
- >> G=tf([K],[1 13 54 72])
- Error using tf (line 287)
- The values of the "num" and "den" properties must be row vectors or cell arrays of row vectors, where each vector is nonempty and containing numeric data. Type "help tf.num"
- or "help tf.den" for more information.
- >> step(G)
- >> bode(G)
- >> G=(s+2)*(s-4)/(s+3)/(s+4)/(s+6)
- G =
- s^2 - 2 s - 8
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> bode(G)
- >> G=(s+2)*(s+4)/(s+3)/(s+4)/(s+6)
- G =
- s^2 + 6 s + 8
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> bode(G)
- >> G=(s+2)*(s-4)/(s+3)/(s+4)/(s+6)
- G =
- s^2 - 2 s - 8
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> G1=(s+2)*(s+4)/(s+3)/(s+4)/(s+6)
- G1 =
- s^2 + 6 s + 8
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> plot(G)
- Error using plot
- Data must be numeric, datetime, duration or an array convertible to double.
- >> bode(G)
- >> hold on
- >> bode(G1)
- >> G1=100/(s+3)/(s+4)/(s+6)
- G1 =
- 100
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> bode(G1)
- >> G1=10*G1
- G1 =
- 1000
- ------------------------
- s^3 + 13 s^2 + 54 s + 72
- Continuous-time transfer function.
- >> bode(G1)
- >>
- rlocus
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement