1
$\begingroup$

I'm trying to plot the Laplace transform of a function. Here's my MatLab script

clear
clc

syms t

L = 100;
sigma=(-10:0.1:(10-0.1));
omega = (-L/2:L/2-1)*(2*pi*0.1);

x = sin(2 * pi * t);

X_symbolic = laplace(x);
X = matlabFunction(X_symbolic);

result = [];

for j=1:length(omega)
    resultCol = [];
    
    for k=1:length(sigma)
        sValue = sigma(k) + 1i*omega(j);
        resultCol = [resultCol abs(X(sValue))];
    end
    
    result = [result ; resultCol];
end

mesh(sigma, omega, result)
xlabel('Real Axis(\sigma)', 'fontsize', 13)
ylabel('Imaginary Axis(\omega)', 'fontsize', 13)
zlabel('Magnitude', 'fontsize', 13)
ylim([-30 30])

Here's my output enter image description here And here's the desired output enter image description here

As you can see the desired output plot includes the two poles (±6.28319i). Where did I go wrong?

$\endgroup$
6
  • $\begingroup$ How did you arrive at the desired output? $\endgroup$
    – Uroc327
    Jun 2 at 8:37
  • $\begingroup$ I'm currently on mobile and didn't check, but your obtained result looks not too far off to me. Your desired looks wrong on the other hand. Keep in mind, that the inverse transform does not integrate over the complete complex plane, but only over some line parallel to the imaginary axis. Because of this, complex frequencies are not represented with a delta impulse (which is purely local), but with a pole with less locality (1/x and similar). $\endgroup$
    – Uroc327
    Jun 2 at 9:33
  • $\begingroup$ Why do you say your plot is incorrect? Your plot is just rotated since you have the imaginary axis on the left (y direction) and gives the same result. $\endgroup$ Jun 2 at 11:43
  • $\begingroup$ @Uroc327 it based on my labwork's module $\endgroup$
    – eejo
    Jun 2 at 12:32
  • 2
    $\begingroup$ @Uroc327 the reason complex frequencies are not represented as impulses is because the unilateral Laplace Transform is integrated from t=0 to infinity (so you see the effect of the step function which convolves with the impulses). The FT goes from +/- infinity and hence the impulse on the j omega axis in that case $\endgroup$ Jun 2 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.