Plotting inverse Laplace transform

์กฐํšŒ ์ˆ˜: 10 (์ตœ๊ทผ 30์ผ)
Sunday Aloke
Sunday Aloke 2025๋…„ 3์›” 21์ผ
ํŽธ์ง‘: David Goodmanson 2025๋…„ 3์›” 22์ผ
I want to find the inverse Laplace transform and then plot the graph. Below ๐Ÿ‘‡ is the code: syms s t %defines s and t as symbolic variables.
a=0.05;
b=0.0045;
c=0.067;
f=0.0508;
g=0.2;
h=0.45;
x=2.71828;
j=232679478;
r=0.742;
k=(h+r);
F =(1-g)*b*a*j*x^(c+f))/s*(s+a*x^c)(s+b*x^f) + (r*a*j*g*b*x^(c+f))/s*(s+k)*(s+a*x^c)(s+b*x^f); %Definition of the Function F(s)
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
f = ilaplace(F); %calculates the inverse Laplace transform of F(s), resulting in f(t).
f_func = matlabFunction(f) %converts the symbolic function f(t) into a regular MATLAB function.
% Define the time vector for plotting
t_vec = 0:0.1:10; % time from 0 to 10
% Plot the inverse Laplace transform
plot(t_vec, f_func(t_vec))
xlabel('Time (t)')
ylabel('f(t)')
title('Inverse Laplace Transform Plot')
grid on
I got this Error message: undefined function code for input argument of type 'cher'a=0.05;b=0.0045;c=0.067;f=0.0508;g=0.2;h=0.45;x=2.71828;j=232679478;r=0.742;k=(h+r);F =(1-g)*b*a*j*x^(c+f))/s*(s+a*x^c)(s+b*x^f) + (r*a*j*g*b*x^(c+f))/s*(s+k)*(s+a*x^c)(s+b*x^f); %Definition of the Function F(s)f = ilaplace(F); %calculates the inverse Laplace transform of F(s), resulting in f(t).f_func = matlabFunction(f) %converts the symbolic function f(t) into a regular MATLAB function.% Define the time vector for plottingt_vec = 0:0.1:10; % time from 0 to 10% Plot the inverse Laplace transformplot(t_vec, f_func(t_vec))xlabel('Time (t)')ylabel('f(t)')title('Inverse Laplace Transform Plot')grid onI got this Error message: undefined function code for input argument of type 'cher'
  ๋Œ“๊ธ€ ์ˆ˜: 7
Sunday Aloke
Sunday Aloke 2025๋…„ 3์›” 21์ผ

@Sam Chak The image is not downloading. No response whenever I click on it

Sam Chak
Sam Chak 2025๋…„ 3์›” 21์ผ
Perhaps you can find a free image hosting website that requires no registration and allows for simple drag-and-drop functionality, such as Imagebam, Imgbb, or Imgur. Then copy and paste the link in your comment.

๋Œ“๊ธ€์„ ๋‹ฌ๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

์ฑ„ํƒ๋œ ๋‹ต๋ณ€

David Goodmanson
David Goodmanson 2025๋…„ 3์›” 22์ผ
ํŽธ์ง‘: David Goodmanson 2025๋…„ 3์›” 22์ผ
Hi SA
Speculative answer: I don't believe that the function F is a likely candidate for a Laplace transform. What you have is (looking at just the first term)
F = const/s*(s+a*x^c)*(s+b*x^f)
which is actually (by mistake?)
(const/s)*(s+a*x^c)*(s+b*x^f)
i.e. two factors involving s in the numerator. For the inverse transforn, that leads to stuff like the derivative of a delta function. What seems more likely is
const/(s*(s+a*x^c)*(s+b*x^f))
with all the s factors in the denominator. Similarly for the second term.
Both terms have a factor of s in the denominator. If
invLaplace(g(s)/s) = G(t)
then removing the s in the denominator effectively multplies by s and gives the time domain derivative,
invLaplace(g(s)) = dG(t)/dt.
The code below does both cases.
syms s t
a=0.05;
b=0.0045;
c=0.067;
f=0.0508;
g=0.2;
h=0.45;
x=2.71828;
j=232679478;
r=0.742;
k=(h+r);
d1 = (1-g)*b*a*j*x^(c+f)
d2 = r*a*j*g*b*x^(c+f)
F = d1/(s*(s+a*x^c)*(s+b*x^f)) + d2/(s*(s+k)*(s+a*x^c)*(s+b*x^f));
Fs = d1/( (s+a*x^c)*(s+b*x^f)) + d2/( (s+k)*(s+a*x^c)*(s+b*x^f));
f = ilaplace(F);
fs = ilaplace(Fs);
f_fun = matlabFunction(f);
fs_fun = matlabFunction(fs);
% Define the time vector for plotting
tvec = 0:2000; % extend the time
y = f_fun(tvec);
ys = fs_fun(tvec);
% Plot the inverse Laplace transform
figure(1)
plot(tvec,ys)
grid on
xlabel('Time (t)')
ylabel('df(t)/dt')
title('Inverse Laplace Transform Plot')
grid on
figure(2)
plot(tvec,y)
grid on
xlabel('Time (t)')
ylabel('f(t)')
title('Inverse Laplace Transform Plot')
grid on

์ถ”๊ฐ€ ๋‹ต๋ณ€ (0๊ฐœ)

์นดํ…Œ๊ณ ๋ฆฌ

Help Center ๋ฐ File Exchange์—์„œ Calculus์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ

ํƒœ๊ทธ

์ œํ’ˆ


๋ฆด๋ฆฌ์Šค

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by