0
$\begingroup$

How does one get Mathematica to return a real answer when using InverseLaplaceTransform? Tried using Re and ComplexExpand to no avail. The inverse of a real rational function must be real (it is a real system). For example:

InverseLaplaceTransform[(s^2 + 3.0)/(s^5 + 3 s^4 + 6 s^3 + 6 s^2 + 3 s^2 + 2 s + 10), s, t] 

returns a complex mess.

$\endgroup$
  • $\begingroup$ ComplexExpand worked fine for me. $\endgroup$ – march Oct 12 '17 at 21:28
0
$\begingroup$

First, it is best to use exact numbers with symbolic methods. The approximate number 3.0 is disguising the situation.

With 3.0 changed to 3:

InverseLaplaceTransform[(s^2 + 3)/(s^5 + 3 s^4 + 6 s^3 + 6 s^2 + 3 s^2 + 2 s + 10), s, t]

(* Long result in terms of algebraic numbers *)

% // N // Chop

(* -0.000165958 (-1019.4 2.71828^(-2.29182 t) + (185.397 - 
    339.966 I) 2.71828^((-0.651002 - 1.91236 I) t) + (185.397 + 
    339.966 I) 2.71828^((-0.651002 + 1.91236 I) t) + (324.304 - 
    498.343 I) 2.71828^((0.29691 - 0.990481 I) t) + (324.304 + 
    498.343 I) 2.71828^((0.29691 + 0.990481 I) t)) *)

In this form, you can see that the imaginary parts of the complex coefficients cancel.

Added 10/19:

You can have an explicitly real formula in the approximate numerical domain:

InverseLaplaceTransform[(s^2 + 3)/(s^5 + 3 s^4 + 6 s^3 + 6 s^2 + 
    3 s^2 + 2 s + 10), s, t] // 
    N // ComplexExpand // Simplify // Chop
(* 0.169178 E^(-2.29182 t) - 0.107642 E^(0.29691 t) Cos[0.990481 t] - 
0.0615362 E^(-0.651002 t) Cos[1.91236 t] +
0.165408 E^(0.29691 t) Sin[0.990481 t] + 
0.11284 E^(-0.651002 t) Sin[1.91236 t] *)

But I think most of us who actually use this math are used to working with complex natural frequencies.

The shortest path between two truths in the real domain passes through the complex domain.

-- Jacques Hadamard

$\endgroup$
  • $\begingroup$ Seems that Mathematica is having trouble getting back to the real domain here. $\endgroup$ – Jim Oct 16 '17 at 15:49
  • 1
    $\begingroup$ @Jim Mathematica yields a real result expressed in terms of complex constants. This is common in algebra, and a fine example of Hadamard's maxim. $\endgroup$ – John Doty Oct 16 '17 at 21:22
  • $\begingroup$ Yeah, but I still think it should make it real with no complex constants. $\endgroup$ – Jim Oct 18 '17 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.