% funname The name of the function to be transformed.
% t The transform argument (usually a snapshot of time).
% ilt The value of the inverse transform
% L number of coefficient ---> depends on computer word length used
% (examples: L=8, 10, 12, 14, 16, so on..)
% Numerical Inverse Laplace Transform using Gaver-Stehfest method
% 1. Villinger, H., 1985, Solving cylindrical geothermal problems using
% Gaver-Stehfest inverse Laplace transform, Geophysics, vol. 50 no. 10 p.
% 2. Stehfest, H., 1970, Algorithm 368: Numerical inversion of Laplace transform,
% Communication of the ACM, vol. 13 no. 1 p. 47-49
% Simple (and yet rush) examples included in functions fun1 and fun2 with
% their comparisons to the exact value (use testgs.m to run the examples)
Easy to use function
How Can I get this file? I not familiar how to download from file exchange
I am trying to solve the heat equation with both conduction and advective terms:
where v=u*Cw/Cv, alpha is a constant. According to the literature the temperature frequency cariation solution of equation 1 is:
where T0 and omega are constants. To get the actual temperature (T) value I am trying to use the Gaver-Stehfest numerical inversion. However, the values I get are not realistic, while my input parameters are fine. What am I doing wrong?
My input function is:
%Define constants u=3.08*10^-8; %ms^-1 Cw=4.18*10^6; %Jm^-3K^-1 Cv=0.7*10^6; %Jm^-3K^-1 k=0.3; %Wm^-1K^-1 L=1; %m alpha=0.4*10^-6; %m^2 s^-1 omega=(2*pi())/(365.25*86400); theta0=11.5112; z=1;
which I then run with the following to get a daily temperature value:
for i=1:l T(i)=gavsteh('fun_s',t(i),18); end
Any help on this will be greatly appreciated!
this one totally helps a lot
Thank you. It was interesting because of its simplicity.
Worked great for me. Nice job.
You need to use multi-precision toolbox to enhance results. Very good results for one staircase simulation with a big L. Beware when you simulate multiple staircase.
I see something about this algorithm,but it is a different formula.Can you give me some data about this algorithm.Thank you! My E-mail is email@example.com
This is a solid implementation of the Stehfest Laplace Inversion algorithm. It computes the Stehfest-vector for arbitrary even L. Two examples are supplied, the inversion of 1/s^2 and 1/(s^2+1).
The main advantage of the algorithm is that it only uses real numbers. Hence it can easily be ported to other programming languages.
The algorithm is accurate for overdamped and slightly underdamped systems. But it is not accurate for systems with prolonged oscillations.
This function is not able to fit a simple cosinus!
This is the version 1.0
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.