You are on page 1of 37

Transformada de Laplace 1.

- ( ) z=20; syms t f=3*(t^z); c= laplace (f) pretty (c) ( )

2.- ( ) z=20; syms t

( )

f= exp(z*t); c= laplace (f) pretty (c)

3.- ( ) z= 20;

( )

w= sym (w); t= sym (t); f=z*sin (w*t); c= laplace (f) pretty (c)

Fracciones parciales 4.( ) z= 20; num=[0 0 1]; den= [1 3 z]; [R,P,K]=residue (num,den) = ( )

5.- ( ) Z=20; num =[2 0 8 z]; a=3*z den =[1 6 11 a];

( )

[R,P,K]=residue (num,den) primera

6.-

( )

)(

( )

z=20; num= [0 0 z];

den=[1 3 2]; [R,P,K]=residue (num,den)

Inversa de Laplace 7.( ) Z=20; syms s f= (z*(s+2))/((s^2)*(s+1)*(s+3));


( ( )( ) ) ( ( ) )

( )

) (

( )(

) )

c= ilaplace (f) pretty (c)

or f= (z*(s+2))/((s^4)+(4*s^3)+(3*s^2)); c= ilaplace (f) pretty (c)

8.-

( )

)(

)(

)(

( )

)(

)(

Z=20; syms s f= (z)/((s+1)*(s+1)*(s+3)); c= ilaplace(f)

pretty (c)

or f= (z)/((s^3)+(5*s^2)+(7*s)+(3)); c= ilaplace (f) pretty (c)

9.-

( )

( )

Z=20; syms s f= ((z)*(s+2))/(s^2); c= ilaplace (f) pretty (c)

or f= ((z*s)+(z*2))/(s^2); c= ilaplace (f) pretty (c)

Buscar help sintaxis >> residue(num,den)


help residue RESIDUE Partial-fraction expansion (residues). [R,P,K] = RESIDUE(B,A) finds the residues, poles and direct term of a partial fraction expansion of the ratio of two polynomials B(s)/A(s). If there are no multiple roots, B(s) R(1) R(2) R(n) ---- = -------- + -------- + ... + -------- + K(s) A(s) s - P(1) s - P(2) s - P(n) Vectors B and A specify the coefficients of the numerator and denominator polynomials in descending powers of s. The residues are returned in the column vector R, the pole locations in column vector P, and the direct terms in row vector K. The number of poles is n = length(A)-1 = length(R) = length(P). The direct term coefficient vector is empty if length(B) < length(A), otherwise length(K) = length(B)-length(A)+1. If P(j) = ... = P(j+m-1) is a pole of multplicity m, then the expansion includes terms of the form R(j) R(j+1) R(j+m-1) -------- + ------------ + ... + -----------s - P(j) (s - P(j))^2 (s - P(j))^m [B,A] = RESIDUE(R,P,K), with 3 input arguments and 2 output arguments, converts the partial fraction expansion back to the polynomials with coefficients in B and A. Warning: Numerically, the partial fraction expansion of a ratio of

polynomials represents an ill-posed problem. If the denominator polynomial, A(s), is near a polynomial with multiple roots, then small changes in the data, including roundoff errors, can make arbitrarily large changes in the resulting poles and residues. Problem formulations making use of state-space or zero-pole representations are preferable. Class support for inputs B,A,R: float: double, single See also poly, roots, deconv. Reference page in Help browser doc residue

>>laplace(f)
help laplace --- help for sym/laplace --LAPLACE Laplace transform. L = LAPLACE(F) is the Laplace transform of the scalar 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 t: L = L(t). By definition L(s) = int(F(t)*exp(-s*t),0,inf), where integration occurs with respect to t. L = LAPLACE(F,t) makes L a function of t instead of the default s: LAPLACE(F,t) <=> L(t) = int(F(x)*exp(-t*x),0,inf). L = LAPLACE(F,w,z) makes L a function of z instead of the default s (integration with respect to w). LAPLACE(F,w,z) <=> L(z) = int(F(w)*exp(-z*w),0,inf). Examples: syms a s t w x laplace(t^5) returns 120/s^6 laplace(exp(a*s)) returns 1/(t-a) 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^sym(3/2),t) returns 3/4*pi^(1/2)/t^(5/2) laplace(diff(sym('F(t)'))) returns laplace(F(t),t,s)*s-F(0) See also sym/ilaplace, sym/fourier, sym/ztrans. Reference page in Help browser doc sym/laplace

>>syms
help syms SYMS Short-cut for constructing symbolic objects. SYMS arg1 arg2 ... is short-hand notation for arg1 = sym('arg1'); arg2 = sym('arg2'); ...

SYMS arg1 arg2 ... real is short-hand notation for arg1 = sym('arg1','real'); arg2 = sym('arg2','real'); ... SYMS arg1 arg2 ... positive is short-hand notation for arg1 = sym('arg1','positive'); arg2 = sym('arg2','positive'); ... SYMS arg1 arg2 ... clear is short-hand notation for arg1 = sym('arg1','clear'); arg2 = sym('arg2','clear'); ... Each input argument must begin with a letter and must contain only alphanumeric characters. By itself, SYMS lists the symbolic objects in the workspace. Examples: syms x beta real is equivalent to: x = sym('x','real'); beta = sym('beta','real'); syms k positive is equivalent to: k = sym('k','positive'); To clear the symbolic objects x and beta of 'real' or 'positive' status, type syms x beta clear See also sym. Reference page in Help browser doc syms

>>pretty
help pretty --- help for sym/pretty --PRETTY Pretty print a symbolic expression. PRETTY(S) prints the symbolic expression S in a format that resembles type-set mathematics. See also sym/subexpr, sym/latex, sym/ccode. Reference page in Help browser doc sym/pretty

>>sym(variable)
help sym SYM Construct symbolic numbers, variables and objects. S = SYM(A) constructs an object S, of class 'sym', from A. If the input argument is a string, the result is a symbolic number or variable. If the input argument is a numeric scalar or matrix, the result is a symbolic representation of the given numeric values. If the input is a function handle the result is the symbolic form of the body of the function handle. x = sym('x') creates the symbolic variable with name 'x' and stores the result in x. x = sym('x','real') also assumes that x is real, so that conj(x) is equal to x. alpha = sym('alpha') and r = sym('Rho','real') are other examples. Similarly, k = sym('k','positive') makes k a positive (real) variable. x = sym('x','clear') restores x to a formal variable with no additional properties (i.e., insures that x is NEITHER real NOR positive). Defining the symbol 'i' will use sqrt(-1) in place of the imaginary i until 'clear' is used. See also: SYMS. Statements like pi = sym('pi') and delta = sym('1/10') create symbolic numbers which avoid the floating point approximations inherent in the values of pi and 1/10. The pi created in this way temporarily replaces the built-in numeric function with the same name. S = sym(A,flag) converts a numeric scalar or matrix to symbolic form. The technique for converting floating point numbers is specified by the optional second argument, which may be 'f', 'r', 'e' or 'd'. The default is 'r'. 'f' stands for 'floating point'. All values are transformed from double precision to exact numeric values N*2^e for integers N and e. 'r' stands for 'rational'. Floating point numbers obtained by evaluating expressions of the form p/q, p*pi/q, sqrt(p), 2^q and 10^q for modest sized integers p and q are converted to the corresponding symbolic form. This effectively compensates for the roundoff error involved in the original evaluation, but may not represent the floating point value precisely. If no simple rational approximation can be found, the 'f' form is used. 'e' stands for 'estimate error'. The 'r' form is supplemented by a term involving the variable 'eps' which estimates the difference between the theoretical rational expression and its actual floating point value. For example, sym(3*pi/4,'e') is 3*pi/4-103*eps/249. 'd' stands for 'decimal'. The number of digits is taken from the current setting of DIGITS used by VPA. Using fewer than 16 digits reduces accuracy, while more than 16 digits may not be warranted. For example, with digits(10), sym(4/3,'d') is 1.333333333, while with digits(20), sym(4/3,'d') is 1.3333333333333332593, which does not end in a string of 3's, but is an accurate decimal

representation of the double-precision floating point number nearest to 4/3. See also syms, class, digits, vpa. Overloaded methods: inline/sym Reference page in Help browser doc sym

>>ilaplace(F)
help ilaplace --- help for sym/ilaplace --ILAPLACE Inverse Laplace transform. F = ILAPLACE(L) is the inverse Laplace transform of the scalar sym L with default independent variable s. The default return is a function of t. If L = L(t), then ILAPLACE returns a function of x: F = F(x). By definition, F(t) = int(L(s)*exp(s*t),s,c-i*inf,c+i*inf) where c is a real number selected so that all singularities of L(s) are to the left of the line s = c, i = sqrt(-1), and the integration is taken with respect to s. F = ILAPLACE(L,y) makes F a function of y instead of the default t: ILAPLACE(L,y) <=> F(y) = int(L(y)*exp(s*y),s,c-i*inf,c+i*inf). Here y is a scalar sym. F = ILAPLACE(L,y,x) makes F a function of x instead of the default t: ILAPLACE(L,y,x) <=> F(y) = int(L(y)*exp(x*y),y,c-i*inf,c+i*inf), integration is taken with respect to y. Examples: syms s t w x y ilaplace(1/(s-1)) returns exp(t) ilaplace(1/(t^2+1)) returns sin(x) ilaplace(t^(-sym(5/2)),x) returns 4/3/pi^(1/2)*x^(3/2) ilaplace(y/(y^2 + w^2),y,x) returns cos(w*x) ilaplace(sym('laplace(F(x),x,s)'),s,x) returns F(x) See also sym/laplace, sym/ifourier, sym/iztrans. Reference page in Help browser doc sym/ilaplace

Practica 2 Polinomio y races de una matriz con >>sym2poly y >>roots . 1.z= 20; s= sym (s); A= [1 2 0; z 2 2; 0 -1 1]; I= eye (3); p= det(s*I-A) pretty (p) p1=sym2poly(p) roots (p1) [ ]

2.-

z= 20; s= sym (s); A= [1 -3 4; 2 -2 z; 2 -1 0]; I= eye (3); p= det(s*I-A) pretty (p) p1=sym2poly(p) roots (p1)

Polinomio y raices con eig () 1.z= 20; A= [1 2 0; z 2 2; 0 -1 1]; [ ]

eig(A)

2.z= 20;

A= [1 -3 4; 2 -2 z; 2 -1 0]; eig(A)

Matrices de Vectores propios sus valores propios 1.z= 20; A= [1 2 0; z 2 2; 0 -1 1]; [X, D]= eig (A) [ ]

2.z= 20;

A= [1 -3 4; 2 -2 z; 2 -1 0]; [X, D]= eig(A)

Resolver si 1.- [ s= sym(s); a= sym(a); c= sym(c); d= sym(d); b= sym(b); A=[-a c; d -b] I=eye(2); C=inv(s*I-A) pretty (C) ]

2.-det [ s= sym(s); a= sym(a); c= sym(c); d= sym(d); b= sym(b); A=[-a c; d -b] I=eye(2); C=det(s*I-A) pretty (C)

Explique cada comando utilizado en la prctica. Utilice help si es necesario revisar la sintaxis Eye() >> help eye EYE Identity matrix. EYE(N) is the N-by-N identity matrix.

EYE(M,N) or EYE([M,N]) is an M-by-N matrix with 1's on the diagonal and zeros elsewhere.

EYE(SIZE(A)) is the same size as A.

EYE with no arguments is the scalar 1.

EYE(M,N,CLASSNAME) or EYE([M,N],CLASSNAME) is an M-by-N matrix with 1's

of class CLASSNAME on the diagonal and zeros elsewhere.

Note: The size inputs M and N should be nonnegative integers. Negative integers are treated as 0.

Example: x = eye(2,3,'int8');

See also speye, ones, zeros, rand, randn.

Overloaded methods: distributed/eye codistributor2dbc/eye codistributor1d/eye codistributed/eye

Reference page in Help browser doc eye det() >> help det DET Determinant. DET(X) is the determinant of the square matrix X.

Use COND instead of DET to test for matrix singularity.

See also cond.

Overloaded methods: sym/det gf/det laurmat/det

Reference page in Help browser doc det >>sym2poly y >>roots >> help sym2poly --- help for sym/sym2poly ---

SYM2POLY Symbolic polynomial to polynomial coefficient vector. SYM2POLY(P) returns a row vector containing the coefficients of the symbolic polynomial P.

Example: sym2poly(x^3 - 2*x - 5) returns [1 0 -2 -5].

See also poly2sym, sym/coeffs.

Reference page in Help browser

doc sym/sym2poly >> help roots ROOTS Find polynomial roots. ROOTS(C) computes the roots of the polynomial whose coefficients are the elements of the vector C. If C has N+1 components, the polynomial is C(1)*X^N + ... + C(N)*X + C(N+1).

Note: Leading zeros in C are discarded first. Then, leading relative zeros are removed as well. That is, if division by the leading coefficient results in overflow, all coefficients up to the first coefficient where overflow occurred are also discarded. This process is repeated until the leading coefficient is not a relative zero.

Class support for input c: float: double, single

See also poly, residue, fzero.

Overloaded methods: gf/roots localpoly/roots

Reference page in Help browser doc roots

eig() >> help eig EIG Eigenvalues and eigenvectors. E = EIG(X) is a vector containing the eigenvalues of a square matrix X.

[V,D] = EIG(X) produces a diagonal matrix D of eigenvalues and a full matrix V whose columns are the corresponding eigenvectors so that X*V = V*D.

[V,D] = EIG(X,'nobalance') performs the computation with balancing disabled, which sometimes gives more accurate results for certain problems with unusual scaling. If X is symmetric, EIG(X,'nobalance') is ignored since X is already balanced.

E = EIG(A,B) is a vector containing the generalized eigenvalues of square matrices A and B.

[V,D] = EIG(A,B) produces a diagonal matrix D of generalized eigenvalues and a full matrix V whose columns are the corresponding eigenvectors so that A*V = B*V*D.

EIG(A,B,'chol') is the same as EIG(A,B) for symmetric A and symmetric positive definite B. It computes the generalized eigenvalues of A and B

using the Cholesky factorization of B. EIG(A,B,'qz') ignores the symmetry of A and B and uses the QZ algorithm. In general, the two algorithms return the same result, however using the QZ algorithm may be more stable for certain problems. The flag is ignored when A and B are not symmetric.

See also condeig, eigs, ordeig.

Overloaded methods: sym/eig lti/eig codistributed/eig

Reference page in Help browser doc eig

>>[X,D]=eig(A),

PRACTICA 3 Funcion transferencia 1.- comando impulse z=20; num = [0 1 z]; den=[1 5 6]; t = [0: 0.1: 5]; ( )

y=impulse(num, den, t); plot (t, y), grid, title (' La respuesta al impulso del sistema con comando impulse ()')

2- Funcion escalon z=20; num = [0 1 z]; den=[1 5 6]; t = [0: 0.1: 5]; y=step(num, den, t); plot (t, y), grid, title (' La respuesta a escaln del sistema con comando step()')

3- Respuesta a una entrada sen(2t) z=20; num = [0 1 z]; den=[1 5 6]; t = [0: 0.2: 20]; u=sin(2*t); y= lsim(num, den, u, t); plot (t, y), grid, title (' La respuesta del sistema a la entrada sen(2t) con comando Isim()')

4.- Seal de salida a exp -t z=20; num = [0 1 z];

den=[1 5 6]; t = [0: 0.1: 5]; u=exp(-t); y= lsim(num, den, u, t); plot (t, y), grid, title (' La seal de salida del sistema a una entrada et con comando Isim()')

2. La dinmica de un sistema en tiempo discreto est representado por la siguiente funcin de transferencia: ( ) num = [0 1 -1]; den=[1 -2.5 1]; t = [0: .1; 1.5]; y= dimpulse(num, den, t); axis([0 10 0 1.5]); plot (t, y), grid, title ('La respuesta al impulso del sistema con comando dimpulse()')

2.- La respuesta a escaln del sistema. Hacer uso de dstep(num, den, t) con axis([0 10 0 1.5]). num = [0 1 -1]; den=[1 -2.5 1]; t = [0: .1; 1.5]; y= dstep(num, den, t); axis([0 10 0 1.5]); plot (t, y), grid, title (' La respuesta a escaln del sistema con comando dstep()')

You might also like