Laboratory Exercise 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

__________________________________________________________________________________

Laboratory Exercise 1

Names:

Number 1
>> syms t s
f=t*exp(-3*t)
F=laplace(f)

F = 1/(s + 3)^2

simplify (F)

ans =

1/(s + 3)^2

pretty (ans)

1
--------
2
(s + 3)

Number 2
f=8*sin(5*t)-exp(-t)*cos(2*t)

f =

8*sin(5*t) - cos(2*t)*exp(-t)

F=laplace (f)

F =

40/(s^2 + 25) - (s + 1)/((s + 1)^2 + 4)

simplify (F)

ans =

40/(s^2 + 25) - (s + 1)/((s + 1)^2 + 4)

pretty (ans)

40 s + 1
------- - ------------
2 2
s + 25 (s + 1) + 4

1
__________________________________________________________________________________

Number 3
t=1/s-(2*s^2+3)/(s^2+9)

t =

1/s - (2*s^2 + 3)/(s^2 + 9)

ilaplace(t)

ans =

5*sin(3*t) - 2*dirac(t) + 1

Number 4
f=(s/s^2-49)-(3/s^2-9)

f =

1/s - 3/s^2 - 40

ilaplace (f)

ans =

exp (-3t) exp(3t) exp(-7t) exp (7t)


-------- - ------- + -------- + --------
2 2 2 2

Number 5
syms y(t) U(t);
ode= diff(y)+ y == 2*U;
cond1 = y(0)== 0;
cond2 = U(0)== 0;
ySol(t) = dsolve(ode,cond1, cond2)

ySol(t) =

piecewise([U(0) == 0, {exp(-t)*int(2*exp(x)*U(x), x == 0..t,


IgnoreAnalyticConstraints)}], [U(0) ~= 0, {}])

1 - 40*dirac(t) - 3*t

Number 6
>>fourier (x^2)
ans =

2
__________________________________________________________________________________

-2*pi*dirac(w, 2)

Number 7
fourier (x*cos(x))

ans =

pi*(dirac(w - 1, 1) + dirac(w + 1, 1))*i

Number 8
ifourier (1/(1+i*w))

ans =

exp(-x)*heaviside(x)

Number 9
a= [2, 4, -1, 2];
fft (a)

ans =

7.0000 3.0000 - 2.0000i -5.0000 3.0000 + 2.0000i

Number 10
syms Fs Ts;
Fs= 500; Ts=1/Fs;
t=0:Ts:0.10;
x= sin(pi*t) + 2*sin(4*pi*t);
y = x+randn(size(t));
plot (y);
yfft=fft(y);
power = conj (yfft).*yfft;
f= 500/150*(0:50);
power=power(1:51);
plot (f, power)

Published with MATLAB® 7.14

You might also like