Breakthrough in inverse Laplace transform procedures
inverselaplace.org
inverselaplace.org
In case the original authors ever come across this article: There is a standard for writing Mathematica modules! Please take a look at some other modules available online, and see how they split the code into small, reusable functions.
Even the name is too short. In the Mathematica naming convention it should be called "InverseLaplaceTransformCME[...]" or something like that. Ideally, use the same calling convention as the built-in function, documented here: https://reference.wolfram.com/language/ref/InverseLaplaceTra...
This would allow your function to be a drop-in replacement, allowing users to switch between the symbolic and approximate versions trivially.
You may even want to contact Wolfram Research! They just implemented a new "Asymptotics" module that includes approximate inverse Laplace transforms as a feature. See: https://reference.wolfram.com/language/guide/Asymptotics.htm...
They might add your approach into the 12.2 release, which would mean that many thousands of people could automatically benefit from your hard work!
You're complaining that it's both too minimalist and too enormous?
An important difference is that a novel doesn't typically require a specialized skillset, but a mathematical development does.
In this case we have a fundamental contribution to mathematics that is succinctly captured in 252 words, producing a 209 word complaint essentially about whitespace.
This is like putting wooden wagon wheels on an F1 race car, and then complaining that people should appreciate the sleek lines of the car and stop commenting about the wheels.
The code posted on GitHub is wasting the effort and the talent that went into this algorithm. It's optimising for brevity, something utterly useless, over utility, which is essential.
The parent is pointing out how the code is the only approachable version of the paper for many people. Making it read like mathematics renders it useless - since it only speaks to the audience that can already understand the paper.
I fall into this category. If the code had reasonable variable names and comments I could probably figure out how it works. But since it reads like the wall of LaTeX on the linked page - I can't pierce it without learning a lot of mathematics. I think that says a lot about mathematic notation.
Often, this kind of paradise is interrupted. Naive sets give way to ones with hyphenated names, and then some mathematicians prefer to branch before such hyphenated names, and in turn prolong the paradise that indeed continues to exist.
Some mathematicians decide to focus on the branching point, call it Paradise in its own respect, and appreciate it for what it is. Not for what it is not.
At the turn of the 19th century to the 20th century, a new kind of mathematician emerged that branched into an emerging area. This emerging area specialises in a form of logic popularly referred to as coding or programming. Very quickly, it turned out that this is a more social area of mathematics (though pure mathematics is indefinitely married to the concept of the mathematical seminar).
However, it is implicitly social. The sociability is in the form of subtle comments, rants about Git conventions, and indeed about the use of whitespace.
This convention somehow seems to have a purpose. That you can write a story through codes and comments, without resorting to the actual English language, but rather the through implementing the English Universal Psuedocode Nonconvention.
And though there shall always be trouble in Paradise, the beauty of this strange new branch is that we can read it as prose—not unlike the great French mathematicians used to do—and have a paradise simply in the bliss of effort.
Of course, of the dark art of machine code, and indeed of the strange validity of mathematics in general, we shall not say much, but simply read jokes about Yoda and try not to argue with a program that beyond all expectation continues to give the correct mapping to the codomain for all individual function inputs from its domain that we can enumerate in a reasonable amount of time.
So there are some droids like you describe; but these are not the ones you're looking for.
What are the domains where this new method can be applied? Is it mostly physics simulations and the likes?
Lots of electrical circuits, mechanical systems and electro-mechanical systems can be modelled using laplace transforms if they are linear systems.
I did an electrical and electronic engineering degree and we got to skip the tedious differential equation solving lectures that the mechanical, civil and chemical engineers had to attend because of Monsieur Laplace.
Is this claim correct?
The Laplace transform takes any exponential spiral in the complex plane, and reduces to the Fourier transform if you only care about the unit circle.
I appreciate that doesn’t make things clearer unless you already have some understanding of integral transforms in the complex plane (in which case, you probably know this already). However, I have never met a simple intuitive explanation of the Laplace transform, - and actually no meaningful explanation that doesn’t involve integrals.
The behaviour of a filter is much easier to describe in the frequency spectral domain than it would be in the time domain.
Now to the direct current (DC) view. This cannot be handled by the Fourier transform -- at least the DC-part of the signal cannot be transformed to the frequency domain. As shown in the article, there were "steps", "ramps" and such. A typical scenario would be to describe what happens in your amplifier during startup, to describe how electrical circuits are behaving during startup before reaching the "running" state.
The Laplace transform will handle these types of scenarios, and can thus be used to study (or describe) systems during other types of transitions than the "steady state" when you are up and running.
Regarding filters, the Fourier transform describes things going on at the unit circle, while the Laplace transform can be used to study both the interior and exterior of the plane. In this sense, creating filters relates to locate "poles" and "zeros" in the plane (amplification and attenuation) which can be observed on the unit circle as the behaviour on periodic signals.
Is the Laplace transform in some sense similar to a one-sided/semi-infinite Fourier transform, provided that change of variables is made?
Years ago in a complex analysis class I worked out the contour integration for a few Fourier transforms as I recall, but I've had no similar training for the Laplace transform and have forgotten many details.
f(t) * e^(iw + 0)t
= f(t) * e^(iwt) * e(at)
= f(t) * e(iwt) * e^(0t)
= f(t) * e(iwt)
integrated over time, which is your fourier transform subject to the condition above. It's just the laplace transform along the Y axis, or, the frequency response at steady state when not growing/decaying exponentially.Similarly, the laplace transform is also a change of basis. But the basis it chooses is a very special one --- it's the eigenvectors of the differential operator. Note that
d/dx(e^(ax)) = ae^ax
So e^(ax) literally an eigenvector of `(d/dx)`. And as we all know, going to
the eigenbasis of a given operator/linear transform/matrix makes it easier
to manipulate. The laplace transform is a change of basis that digonalizes
the differential operator. This makes it easy to solve differentials.> This idea of using exponentials in linear differential equations is almost as great as the invention of logarithms, in which multiplication is replaced by addition. Here differentiation is replaced by multiplication. . . . See how simple it is! Differential equations are immediately converted, by sight, into mere algebraic equations
Fourier transform will show up for an harmonic oscilator in the whole real line with incoming and outgoing wave boundary conditions, while Laplace will show up when working on semi-infinite interval whit initial conditions and proper convergence at infinity.
These are the most common, but not the only transforms one can build. There are also Melin and Hankel transforms, and by playing with the operator, the domain and the boundary conditions, we can construct the adequate transform for each given problem.
Spectral theory of DE’s is such a beautiful topic.
The discrete FT or DFT, however, as the name clearly implied, is the discrete version of FT and similarly discrete Laplace Transform (DLT) is the discrete version of LT. The main difference is that DFT covers finite sum but DLT covers infinite sum.
The faster version of DFT (without compromising the resolution accuracy) is called FFT and it is probably the most useful and important algorithm in the 21st century! The inverse FFT is called IFFT and it was discovered around the same time of FFT. The faster version of DLT is interestingly called Chirp-Z Transform (CZT) and somehow its inverse (ICZT) discovery is at a much later date as has been reported recently [2] and also featured in HN [3]. This much later date of discovery is mainly due to the complexity of complex power exponents (pardon the pun but cannot resist).
Fun fact, CT was discovered by Lawrence Rebinar who was working at AT&T's speech processing lab (SPL) [4]. The lab is so well funded that Kernighan and Ritchie who were belong to the other lab has to scrap by the older computer of the SDL (the infamous PDP-7) where Unix was originally developed on when Multics project got canceled.
[1]https://youtu.be/n2y7n6jw5d0
[2]https://www.electronicsweekly.com/news/research-news/dsp-inv...
To mathematicians I don't think they're so much magic. When I took differential equations class it was frustrating that they went too fast for me to fully digest what was "really" going on. It didn't feel out of reach, but something I needed to look at a couple different ways but didn't have time (or the internet) to do so. Think I'm gonna checkout 3blue1brown after this - he can probably close that gap for me.
You might like this lecture from MIT's OCW: [1]. It's my favorite source for motivating the Laplace transform. It's a bit difficult to make this concept "simple", and this resource assumes that you already have some familiarity with the following concepts: infinite series, power series, radius of convergence, and (indefinite) integration.
The tl;dw is that the Laplace transform is a generalization of a power series.
[1] https://www.youtube.com/watch?v=sZ2qulI6GEk
Edit: I also wrote up a form of this video elsewhere if anyone's interested. It's kinda long though, and I didn't want to spam this thread with it.
I have an interest understanding how IIR filters are designed, and I always get stuck at this part in DSP books. The Laplace transform is used, but as well as finding the mathematics difficut I don't really understand why it is being used at all. I think it is trying to replicate the effect of an analog circuit?
The thing is a lot of questions are easy to answer in the frequency domain.
For instance, you want to know if a circuit with feedback will oscillate. Hard to answer using time domain equations. But in the frequency domain there is a simple constraint. If for all frequencies where the the gain is greater than one the phase shift is less than 180 degrees, circuit won't oscillate. This is obviously rather useful.
Also a point with a lot of 'books' the authors get caught up in describing how something is done that they never explain why something is done. I've found often the answer is simple yet opaque and frustratingly never talked about.
This is a useful fact for a simple circuit in a classroom, but the differential equations for any circuit with more than a few components soon become insanely complex.
With the Laplace transform you (more or less) replace an integral with 1/s and a differential with s, plus some constants derived from the component values.
Then you can simplify for s, and use the Inverse Laplace Transform to convert the final expression in s into an expression in t.
You have now solved an insanely complex differential equation with some basic algebra, and your final expression in t - with component constants, and some exponentials that appear after the inverse transform - accurately models how the circuit responds over time.
There's also a related fairly simple trick for converting the s-domain representation into a frequency/phase plot which tells you how the circuit operates in the frequency domain.
And another related fairly simple trick for converting the continuous s-domain into the z-domain for DSP calculations over a sampled time series.
Because the same theory also applies in other domains - spring/mass systems, and so on - you can use the same technique there too.
Examples
Converting numbers to logs allows you to multiply and divide by mere addition and subtraction. If you wonder why RF engineers represent power in db this is why.
Mapping an equation in terms of forces integrated over a path to one using vectors and energy.
You learn how an image is dissected into two matrices (or one complex matrix) containing amplitudes and phases of respective frequencies. A good start for me was playing around with openCV and reading about JPEG (uses DCT).
Why transform an image in the first place? Because you can just set the highest frequencies to zero without influencing the image in real space too much. This effect is leveraged by classical JPEG compression, you just delete data not that important for the image. Being able to analyze, filter, change frequencies in a signal has a lot of other applications.
There are better links but maybe this is a start: https://www.mathworks.com/help/images/discrete-cosine-transf...
There is a ton of literature about DCT because its widespread application. A few google searches lead to good learning material. Fourier and in general LaPlace transformations are a little different, but far easier to understand after seeing an example of their application in my opinion.
This also touches the topic of the article. The problem is that transforming between real space and spectral space results in rounding errors. The article describes a new approach to minimize these.
Laplace transforms are an entire course?
The result isn't always invertible analytically, but you can almost always invert it numerically and this is why techniques like the one outlined in the paper are so important.
This is a fantastic post and I thoroughly recommend reading it and the 2019 paper that summarises all their work for several reasons:
1. Very clear exposition of previous work and their own.
2. Clear evaluation metrics.
3. They've even made it easy for you to replicate their work and results.
I also know a bit of signal processing\numerical analysis, and I'm not familiar with any practical uses of the Laplace transform there. I don't believe it's used in the numerical solution of pdes or odes, whereas spectral methods are a huge area of study and (until recently, I think) were used in the GFS weather model. And most time series analysis tools either apply the Fourier transform or bail out of this approach and use statistical tools.
My version of Greenspun's 10th rule goes: any sufficiently complex program includes an FFT.
Can anyone help me out here? Is there a problem/theorem the Laplace transform solves/proves which the Fourier transform doesn't?
But seriously, do you have a favorite example where the Laplace transform is used to prove a theorem or used in practice to solve a problem?
I'm familiar with the undergraduate differential equations examples. But there are plenty of things taught at the undergraduate level which are tractable and helpful to build intuition but either a) aren't important from a research perspective or b) aren't used in practice. The Fourier transform has both.
(I know enough signal processing to be dangerous.)
As for the Laplace Transform, it is mainly use in control system applications where the input/output include transient/damping/forcing signal waveforms (on and off unit circle) not only clean steady state signal waveforms (on unit circle). This paper provides a good overview of the sample usages of a Laplace Transform in Electrical and Electronics Engineering [1].
If what you meant by the duality Fourier Transform as FFT/IFFT, Laplace Transform has the equivalent in the form of Chirp-Z Transform (CZT) and recently discovered inverse CZT (ICZT), and the original HN discussions link of the discovery is also provided in my other comments. For CZT/ICZT potential useful application please check the other/older HN topic comments in [2].
Perhaps we should just wait and watch for the torrent of patent filings on this CZT/ICZT topic if the claim of ICZT is really true and feasible.
I will take a look into CZT, I recall the HN post at the time but didn't look into it much.
The laplace transform is the same thing, but instead of matrices, it works on derivatives. Equations involving `d/dt` are often made easier to work with by instead using `s`.
Longer answer: https://www.quora.com/What-is-the-purpose-of-Laplace-transfo...
BIBO stability of IIR systems
Now it's true that the Fourier transform is not well-behaved on L^{\infty}. Any book on harmonic analysis will discuss this point in great lengths. But the context in which these questions are discussed (singular integral operators on spaces like BMO, which contains L^{\infty}) doesn't tend to include the Laplace transform in a useful manner.
Someday I'll have to properly learn harmonic analysis to sort out these questions for myself.
The actual paper is at https://www.sciencedirect.com/science/article/pii/S016653161.... This is a pretty obscure journal. The paper is pretty "soft" -- lots of numerical testing of their approach vs. other well-known approaches and not very much theoretical analysis of convergence rates or such.
The main claim seems to be that their approach has better numerical properties for discontinuous functions and that it can be effectively implemented to high order using double precision arithmetic.
Thanks the authors for putting the code out there for anyone to reproduce and not fall into the unreproduceable "science" that is plaguing us at the moment[1].
[1]: http://polaris.imag.fr/arnaud.legrand/teaching/2016/mosig_sm...
As a researcher I really appreciate the promotion effort, some years ago I came across a similar "landing page" for a numerical technique that helped me a lot: http://people.ece.umn.edu/users/mihailo/software/dmdsp/,
Trying to put together how a new numerical method works scouring for papers with different nomenclatures, different sets of authors, different implementations etc. is often a huge pain. I wish these "landing pages" became a standard, or that a standard repository for them became available. Something like, this is our technique, these are the relevant papers, and here is some demo code.
[Deleted "from authors not associated with an academic institution" from my original reply.]
Over the years a number of approaches have been developed for the inverse Laplace transform, such as MaxEnt, GIFT and many others.
I would love to see how this new approach fares against those.
This might really spark some interesting breakthroughs that I am not smart enough to predict.
Core math breakthroughs like this have huge and unpredictable knock-on advancements...
Thank you for the exposure and feedback! We really appreciate it.
About the code. We have added comments and simple running examples to the code on github. Hopefully that helps make the code more accessible to everyone.
About the contribution. Classic numerical inverse Laplace transformation methods work in some cases but fail in others, while the CME method always gives a good approximation at low computational cost. We recommend it for general use when you just want to invert a function numerically without spending effort to figure out what methods might be applicable.
i found this (https://johnflux.com/2019/02/12/laplace-transform-visualized...) to be pretty cool as well.
Fourier transform: sinusoidals
Laplace transform: sinusoidals + exponentials
Here is nice video explaining it: https://www.youtube.com/watch?v=n2y7n6jw5d0
Not really my, well, domain (sorry), so my only contribution is that there's a spelling error in the dropdown: it refers to the Heaviside step function as the 'Heavyside' function.
There was some talk about supporting the prediction of time-series data. I have absolutely no knowledge of how time-series data should be pre-processed and what kind of algorithms are common or applicable in general. (I'm not in charge of the R&D of the data-science-y features) However, it seems like Laplace transform as a pre-processing step ticks a lot of the checkboxes. As a superset of Fourier, it supports periodic changes in time series, and being about exponentials, it also allows for growth (or decreasing) over time, allowing to transform a time series to data that is more applicable to classical ML algorithms.
Is Laplace transform actually used for such usecases?
Part of the reason for this is because the algorithms to go from discrete data points into a wave form are fairly well known and fast.
DCT is the foundation for most Lossy encoding formats. Using it for time series data makes a lot of sense, especially if you are optimizing for storage space.
Imagine you win the Megabucks lottery. The win is one hundred million dollars. You go to claim your money, but you are told you can choose between the full amount given in monthly payments over 20 years, or a lump sum. But the lump sum is not the full $100MM, it is the present value of the monthly payments discounted at a rate of 5%. To discount an amount received 10 years from now at the 5% rate, you simply divide by 1.05 ^ 10, which is very close to exp(0.05 x 10). If you actually calculate this present value using the exponential function, you say that you use "continuously compounded rates".
So, for any stream of future cashflows one can calculate the present value by multiplying the cashflows with appropriate discount factors (of the type exp(-r t)) and adding them up. For different discounting rates r you obtain different present values. This present value as a function of r is the Laplace transform of the cashflow stream as a function of t.
The inverse Laplace transform is solving the riddle: if I tell you the present value (PV) of some cashflows for any (positive) discount rate you want, can you calculate the cashflows?
Why is this a difficult problem? Because it is "ill-conditioned". Imagine the following two cashflow streams: in the first you get $1MM every year for the next 10 years and another $1MM one hundred years from now. In the second you also get $1MM annually for the first ten years but the last $1MM is 101 years from now. For a zero discount rate the value of both cashstreams is $11MM. For a 5% they are both around $9MM and different by about $300, which is about 0.003%. For any discount rate the PV's will be very very close.
In some cases "in real life" this closeness could be below machine precision level. If someone gives you 2 sets of inputs where their Laplace transforms are different by less than the machine precision levels for all values of the discount rate, then there is no hope to tell them apart knowing only their trasforms only, at least not if you don't use some multiple precision libraries.
That should give you an intuition why the inverse Laplace transform is nasty. All hope is not lost though. First of all, in a typical application the Laplace transform of a function is known in closed (analytical) form, so you can actually use multiple precision libraries if you so wish. I have seen cases where people were using precision of 2000 digits in Mathematica for this. It's slow as hell, but it gets the job done.
Separately, you are free to calculate the Laplace transform at any "discount rate", including complex values. If you are smart about how to choose these values, you can come up with good recipes for the Laplace transform.
For hundreds of years now, the general wisdom was that various inverse numerical Laplace transform algorithms have strengths and weaknesses, but no single one is universally good.
Maybe this one will be, and if so it will be indeed revolutionary.
It seems to be advanced maths but I wonder why the designer (he already know in advance the desired form of the function in order to give him a desirable property (in both cases being more smoothed / continuous / centered)) does not draw graphically the desired function and let a software solve, find automatically the best approximation of the function?
EDIT: well it seems to be a general function approximator so my point doesn't apply (but still apply for the new activation functions in machine learning)