Closed runjaj closed 1 year ago
For this particular problem, all SymPy.jl does is pass along arguments to the underlying sympy functions. So, the issue sits there. Simplification can often help when using SymPy, as can assigning the variable type. You have already done both.
Another response, as I didn't realize I hadn't closed this. All nsimplify
does in this case is convert floats to rationals. I'd suggest having your students do that using //
, as in sympy.inverse_laplace_transform((2//10)/(20s^2 +(352//100)s+1)*1/s, s, t)
. There are a few conversions where you lose the exactness that students expect (pi is converted to sympy.pi, but 2pi is a float in Julia, so a float in SymPy on conversion). So you have to explain that aspect anyways, and rationals are, perhaps, the easiest for them to be mindful of.
Thanks for the answer.
Description of the problem
I'm trying to calculate the inverse Laplace transform of a function that has floating coefficients:
I get a long error message, you can find it bellow.
Thankfully the problem is easy to solve:
I have two questions:
sympy.nsimplify(...)
? I know that Maxima makes this change by default. I have no problem writing it, but I'm afraid it will confuse my students.Anyway, thanks for your amazing work creating and mataining SymPy.jl!
Error message
Description of the system
My system is:
Julia Version 1.9.0-rc2 Commit 72aec423c2a (2023-04-01 10:41 UTC) Platform Info: OS: macOS (x86_64-apple-darwin21.4.0) CPU: 8 × Intel(R) Core(TM) i7-1060NG7 CPU @ 1.20GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, icelake-client) Threads: 1 on 8 virtual cores
And this is my environment:
[f6369f11] ForwardDiff v0.10.35 [b964fa9f] LaTeXStrings v1.3.0 [91a5bcdd] Plots v1.38.10 [438e738f] PyCall v1.95.1 [f2b01f46] Roots v2.0.12 [24249f21] SymPy v1.1.8