Opened 4 years ago
Last modified 4 years ago
#22422 closed enhancement
Laplace transform involving time-shifts — at Version 3
Reported by: | mforets | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.0 |
Component: | calculus | Keywords: | laplace, transform, symbolics, giac, heaviside |
Cc: | kcrisman, paulmasson, frederichan, rws | Merged in: | |
Authors: | Marcelo Forets | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | u/mforets/laplace_transform_involving_time_shifts (Commits, GitHub, GitLab) | Commit: | 20963880dfbc18035cea6159eb13d5c71b0fda59 |
Dependencies: | Stopgaps: |
Description (last modified by )
Sage allows to compute the inverse Laplace transform through Maxima's ilt
function,
sage: var('s t') sage: inverse_laplace(1/s, s, t) 1
An unevaluated expression is returned when no explicit inverse Laplace transform is computed, as in
sage: inverse_laplace(exp(-s)/s, s, t) ilt(e^(-s)/s, s, t)
The result in this case is h(t-1), where h is the Heaviside step function. In Sage it is available as heaviside
.
The problem in this ticket is to extend the current behavior of inverse_laplace
to provide explicit expressions for proper real-rational functions with any number of real exponentials linear in the transform variable s (time-shifts) in the numerator. For consistency, the direct Laplace transform with a heaviside should also work as well.
These are some approaches:
(1) Implement an in-house solution, possibly in the lines of this answer.
(2) Add an algorithm
flag that allows to choose sympy
(similar to integration).
(3) Interface with Giac/XCAS. With this package installed, it is possible to do:
sage: giac('invlaplace(exp(-s)/s, s, t)') Heaviside(t-1)
IMHO, a combination of (2)-(3) is the more robust approach. A small set of experiments show that (3) is, at the time of writing, more convenient than inverse_laplace_transform
of SymPy? in terms of quality of solution and execution time. Unfortunately, the giac interface does not currently support automatic translation back to the symbolic ring, as it does with SymPy? objects via SR(..).
Any recommendations?
See also:
Change History (3)
comment:1 Changed 4 years ago by
- Cc rws added
comment:2 Changed 4 years ago by
- Branch set to u/mforets/laplace_transform_involving_time_shifts
comment:3 Changed 4 years ago by
- Commit set to 20963880dfbc18035cea6159eb13d5c71b0fda59
- Description modified (diff)
- Status changed from new to needs_info
Needs info (please see commit message) to transform heaviside via
_giac_()
. Example:But
heaviside(x)
doesn't seem to be understood by giac.New commits:
Added algorithm='sympy' (needs work) and algorithm='giac' (needs info).