Why are the values of z1 and z2 false in the special case a=0?

1 view (last 30 days)
Hi,
Why are the values of z1 and z2 false in the special case a=0?
clear
syms t
syms a real
x(t) =exp(-a*t)*heaviside(t)
x(t) = 
z1 = int(x(t),t, -inf, inf)
z1 = 
z2 = int(exp(-a*t),t,0, +inf)
z2 = 
A big thank you in advance!
  5 Comments
Walter Roberson
Walter Roberson on 21 Jan 2024
Testing what it should be if a is 0, which gives exp(-0*t) which gives exp(0) which is 1
syms t
x(t) = heaviside(t);
z1 = int(x, t, -inf, +inf)
z1 = 
z2 = int(x, t, 0, +inf)
z2 = 
Paul
Paul on 21 Jan 2024
Edited: Paul on 23 Jan 2024
Trying it this way does not even allow for the possibility that a = 0.
syms t
syms a real
x(t) = exp(-a*t)*heaviside(t);
syms b n1 n2
assume([b n1 n2] < 0)
syms c p1 p2 positive
z1 = limit(int(x(t),t,b,n1),b,-inf) + limit(int(x(t),t,n1,n2),n2,0,'Left') ...
+ limit(int(x(t),c,p1),c,0,'Right') + limit(int(x(t),p1,p2),p2,inf);
z1 = simplify(z1)
z1 = 
z2 = limit(int(exp(-a*t),t,c,p1),c,0,'Left') + limit(int(exp(-a*t),t,p1,p2),p2,inf);
z2 = simplify(z2)
z2 = 
subs(z2,a,0)
ans = 
NaN
Apparently int evaluates these imporoper integrals with a different approach, though I thought what I did here is the formal defintions of these improper integrals.
I'm actually quite surprised by the results in the original question insofar as I don't see int return a piecewise result for other cases where it could.
For example:
f(t) = triangularPulse(t);
syms n integer
c(n) = int(exp(-1j*2*sym(pi)/4*n*t)*f(t),t,-inf,inf)
c(n) = 
try
c(0);
catch ME
ME.message
end
ans = 'Division by zero.'
However, c(0) is well defined, as we can see by subbing in n = 0 into the integrand and then integrating
C0 = int(exp(-1j*2*sym(pi)/4*0*t)*f(t),t,-inf,inf)
C0 = 
1
Why didn't int() return a piecewise expression for c(n) in the first place? I've always thought that "int just doesn't do that," but this Question shows that it can. I wonder if int recognizes the expression for c(n) as a Fourier integral and resorts to fourier instead of computing the integral other using other means.

Sign in to comment.

Answers (1)

SAI SRUJAN
SAI SRUJAN on 30 Jan 2024
Hi Mohamed,
I understand that you are trying to examine the values of 'z1' and 'z2' in a special case where 'a = 0'.
In this specific case, both 'z1' and 'z2' approach infinity, because the integrals of the functions 'exp(-a*t)' and 'exp(-a*t)*heaviside(t)' become improper integrals that diverge when 'a = 0'. Let's break down each integral:
For `z1`, the integral is calculated as:
z1 = int(x(t), t, -inf, inf)
Since `a = 0`, the exponential term becomes `exp(0*t) = 1`, and the integral becomes:
z1 = int(1, t, -inf, inf)
This is the integral of a constant function over an infinite interval, which is unbounded and thus diverges to infinity.
For `z2`, the integral is calculated as:
z2 = int(exp(-a*t), t, 0, +inf);
Since `a = 0`, the exponential term becomes `exp(0*t) = 1`, and the integral becomes:
z2 = int(1, t, 0, +inf)
This integral also represents an area under the constant function 1 from 0 to inf, which is again unbounded.
In the particular situation where 'a = 0', the integrals for both 'z1' and 'z2' turn out to be infinite. Therefore, they are deemed "inf" since the result of the integration isn't a finite value.
I hope this helps!

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!