From f9a3fe7f0e2a94690036e45bfa3818f4f1c94517 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 13 May 2024 16:41:35 -0700 Subject: [PATCH 1/2] Add a laplace transform test It might fail on earlier SymPy: we'll tighten that up later after CI if so. --- inst/@sym/laplace.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inst/@sym/laplace.m b/inst/@sym/laplace.m index bd92c888..4f1ac8eb 100644 --- a/inst/@sym/laplace.m +++ b/inst/@sym/laplace.m @@ -1,5 +1,5 @@ %% Copyright (C) 2014-2016 Andrés Prieto -%% Copyright (C) 2015-2016, 2019 Colin Macdonald +%% Copyright (C) 2015-2016, 2019, 2024 Colin Macdonald %% %% This file is part of OctSymPy. %% @@ -214,3 +214,9 @@ %! % SymPy cannot evaluate? (Issue #170) %! syms s f(t) %! assert(logical( laplace(diff(f(t),t),t,s) == s*laplace(f(t),t,s)-f(0) )) + +%!test +%! % https://github.com/gnu-octave/symbolic/issues/1295 +%! syms t s +%! L = simplify (laplace (3*t*sin (4*t))); +%! assert (isAlways (L == 24*s / (s^2 + 16)^2)) From ec9c2a809efcbe589865f74cb9c69436d095f6e7 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 13 May 2024 17:56:37 -0700 Subject: [PATCH 2/2] Laplace test on SymPy 1.12 only It bases on early SymPy too, just not 1.10 and 1.11 --- inst/@sym/laplace.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inst/@sym/laplace.m b/inst/@sym/laplace.m index 4f1ac8eb..26c9efc1 100644 --- a/inst/@sym/laplace.m +++ b/inst/@sym/laplace.m @@ -217,6 +217,9 @@ %!test %! % https://github.com/gnu-octave/symbolic/issues/1295 -%! syms t s -%! L = simplify (laplace (3*t*sin (4*t))); -%! assert (isAlways (L == 24*s / (s^2 + 16)^2)) +%! % fails on SymPy 1.10.* and 1.11.* +%! if (pycall_sympy__ ('return Version(spver) >= Version("1.12")')) +%! syms t s +%! L = simplify (laplace (3*t*sin (4*t))); +%! assert (isAlways (L == 24*s / (s^2 + 16)^2)) +%! end