MAT LAB-31-08-16
SURYA SAI KUMAR
16BEC1154
LAPLACE TRANSFORM OF PERIODIC FUNCTIONS
clc
clear all
syms t s
T=input('enter the period of periodic function')
n=input('enter the number of partions in one period')
fun=0*t;
for i=[Link]n
a(i)=input('enter the left end point of ith sub interval');
b(i)=input('enter the right end point of ith sub interval')
f(i)=input('enter the function f(i)');
fun=fun+f(i)*(heaviside(t-a(i))-heaviside(t-b(i)));
end
ezplot(fun,[a(1) b(n)])
sum=0
for i=i:n
sum=sum+int(f(i)*exp(-s*t),t,a(i),b(i))
end
g=(1/1-exp(-s*T))*sum
g1=simplify(g)
figure
ezplot(g1,[0 b(n)])
OUTPUT
enter the period of periodic function2
T=
enter the number of partions in one period2
n=
enter the left end point of ith sub interval0
enter the right end point of ith sub interval1
b=
enter the function f(i)t
enter the left end point of ith sub interval1
enter the right end point of ith sub interval2
b=
1 2
enter the function f(i)2-t
Warning: MATLAB has disabled some advanced graphics rendering features by
switching to software OpenGL. For more
information, click here.
sum =
sum =
(exp(-2*s)*(s*exp(s) - exp(s) + 1))/s^2
g=
-(exp(-2*s)*(exp(-2*s) - 1)*(s*exp(s) - exp(s) + 1))/s^2
g1 =
-(exp(-2*s)*(exp(-2*s) - 1)*(s*exp(s) - exp(s) + 1))/s^2
FIGURE 1
FIGURE 2