Convolution of two functions (symbolic) -> closed-form expression
Show older comments
I want to solve the convolution integral of two functions (fx and fy) obtaining a closed-form expression
syms x t l1 l2 C positive
fx(x) = (l1*l2/(l1-l2))*(exp(-l2*x)-exp(-l1*x));
fy(x) = (C/sqrt(2*pi))*(1/(x^(3/2)))*exp(-C^2/(2*x));
fz = int(fx(x)*fy(t-x),'x',-Inf,+Inf);
Result:
simplify(fz) =
int(-(2383560469838099*exp(-11/(50*(t - x)))*(exp(-x)/9 - exp(-x/10)/9))/(9007199254740992*(t - x)^(3/2)), x, -Inf, Inf)
No luck using Fourier transform
simplify(ifourier(fourier(fx,x,t)*fourier(fy,x,t),t,x))
=
-(2383560469838099*fourier(fourier(exp(-11/(50*x))/x^(3/2), x, t)*fourier(exp(-x), x, t), t, -x) - 2383560469838099*fourier(fourier(exp(-11/(50*x))/x^(3/2), x, t)*fourier(exp(-x/10), x, t), t, -x))/(162129586585337856*pi)
Is this a limitation of the symbolic toolbox or there is no closed-form of this convolution integral?
11 Comments
David Goodmanson
on 29 Jul 2022
Hi Walter/JL
this expression is complex for x>t (likely not intended), and increases without bound for x--> -inf, so there need to be restrictions on fx,fy (such as both being zero for negative argument) or this integral will not work.
Walter Roberson
on 29 Jul 2022
Is there good reason to expect that a closed form expression of the convolution exists?
syms x t
rng(12345); l1 = rand(), l2 = rand(), C = rand()
fx(x) = (l1*l2/(l1-l2))*(exp(-l2*x)-exp(-l1*x));
fy(x) = (C/sqrt(2*pi))*(1/(x^(3/2)))*exp(-C^2/(2*x));
X = linspace(-10, 10, 250);
FZ =(sum(fx(X).*fy(t-X)));
vpa(FZ, 10)
FZN = matlabFunction(FZ);
T = linspace(0,15,300);
y = FZN(T);
yr = real(y); yr = min(yr, 100);
yi = imag(y); yi = min(yi, 100);
plot(T, yr, 'k-'); title('real part')
plot(T, yi, 'r-.'); title('imaginary part')
j l
on 29 Jul 2022
Torsten
on 29 Jul 2022
And how to solve the problem that fy is not in L^1(0,oo) because of the singularity at 0 and that fy becomes complex for x>t ?
Walter Roberson
on 29 Jul 2022
(x-t)^(3/2) is a problem when x-t is negative.
syms l1 l2 C positive
syms x t real
fx(x) = (l1*l2/(l1-l2))*(exp(-l2*x)-exp(-l1*x))*heaviside(x);
fy(x) = (C/sqrt(2*sym(pi)))*(1/(x^(3/2)))*exp(-C^2/(2*x))*heaviside(x); % note sym(pi)
fy seems well behaved at the origin, for example
fplot(subs(fy(x),C,1),[-1 5])
limit(subs(fy(x),C,1),x,0,'right')
The convolution integral is
fz(x) = int(fx(t)*fy(x-t),t,-inf,inf,'Hold',true)
We see that if t<0 the integrand is 0 and that if x-t < 0 the integrand is 0. So we don't really need worry about (x-t)^3/2 beocoming complex, and the integral is better expressed by changing the limits of integration
fz(x) = int(fx(t)*fy(x-t),t,0,x,'Hold',true)
Of course, we still don't have a closed from expression (at least I couldn't get there)
release(fz(x))
Or
fz(x) = int(fy(t)*fx(x-t),t,0,x)
But a numerical solution seems like it should be feasible.
David Goodmanson
on 29 Jul 2022
Edited: David Goodmanson
on 30 Jul 2022
fy is in L^1(0,oo) since as t--> 0, e^(-C^2/(2*x)) gets small a lot faster than (x^(-3/2) gets large. It seems highly unlikely that this integral has a simple analytic solution.
j l
on 1 Aug 2022
I'm unaware of any "tricks" with ifourier.
IIRC correctly, the CF of a pdf is not defined the same as with the default parameters that Matlab uses for fourier. So either adjust the parameters that Matlab uses via sympref or use the Matlab conventions for the CF definitions.
syms l1 l2 C positive
syms x t real
fx(x) = (l1*l2/(l1-l2))*(exp(-l2*x)-exp(-l1*x))*heaviside(x);
Matlab default fourier:
Fx(t) = simplify(fourier(fx(x),x,t),100)
Using the expressions above
Fx1(t) = (1/(1+t^2*(1/l1)^2))+1i*((t/l1)/(1+t^2*(1/l1)^2));
Fx2(t) = (1/(1+t^2*(1/l2)^2))+1i*((t/l2)/(1+t^2*(1/l2)^2));
[num,den] = numden(simplify(Fx1(t)*Fx2(t),100));
Fxp(t) = simplify(num/den)
These are the conjugates of each other
simplify(Fx(t) - conj(Fxp(t)))
I'll be curious to see the responses at stackexchange. However, I don't think that post is correct. If the upper limit of integration is inf, the definitions of p1 and p2 each must be multiplied by heaviside(x) (actually, with the lower limit of integration being 0, I guess it's really only needed for p2, but I'd show it for both). Or make x the upper limit of integration.
If a closed form expression is obtained, would you mind posting the solution back here?
j l
on 1 Aug 2022
Accepted Answer
More Answers (0)
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!








