Group Abstract Group Abstract

Message Boards Message Boards

1
|
10.9K Views
|
6 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Laplace transform with time shifts and trig functions are very slow

Posted 5 years ago
6 Replies

Workaround:

Re[LaplaceTransform[UnitStep[t]*Exp[I t], t, s]] // ComplexExpand // AbsoluteTiming

(* {0.0557801, s/(1 + s^2)}*)

. enter image description here

It's seems very fast.

Regards M.I.

POSTED BY: Mariusz Iwaniuk
Anonymous User
Anonymous User
Posted 5 years ago

I think, until you can justify speeding it up (by offering the source code) in the context of solving all partial differential equations, differential equations, equations, over fields and modulus - you should trust that there is a reason it does that; that it is doing something somewhat complicated (needed in general solving) your math book does not show the need of. The knowlege of some of the math people at Wolfram is quite humbling I think.

You should limit your variables to be [Element] Reals if you don't want complex surprises and you will faster processing, often.

POSTED BY: Anonymous User

Fantastic! Given that I am telling my students that phasors and the frequency domain are excellent for speeding things up, I love that it's complex exponentials that ended up solving this problem!

Nice, really nice! Tanks for sharing!

POSTED BY: Henrik Schachner

You cannot "declare" that symbol t represents a real number with Element[t, Reals]. You must feed the logical assertion to the function that needs to know it as an assumption.

Assuming[Element[t, Reals], LaplaceTransform[UnitStep[t - 1]*Cos[t], t, s]]

On my machine, the assumption appeared to improve the timing, but then I reevaluated the original, and it was faster, too, so the improvement was apparently just from Mathematica's caching mechanisms rather than the assumption.

POSTED BY: John Doty

Greetings - I just checked to see if telling M that t is real helps - I am afraid that it does not:

In[1]:= Element[t, Reals]

Out[1]= t \[Element] Reals

In[2]:= LaplaceTransform[UnitStep[t - 1]*Cos[t], t, 
s] // AbsoluteTiming

Out[2]= {35.4615, (E^-s (s Cos[1] - Sin[1]))/(1 + s^2)}
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard