# Two waves interference animation

I would like to plot (or to find) an animation where two waves at different frequencies, propagating with different velocities, sum together

$$w_1 (x,t) = \cos(\omega_1 t - k_1 x)\\w_2 (x,t) = \cos(\omega_2 t - k_2 x)$$

and generate the resulting signal

$$w(x,t) = \cos(\omega_1 t - k_1 x) + \cos(\omega_2 t - k_2 x)$$

An envelope and a carrier can be distinguished after some algebra and the animation should show the different propagation velocities of the envelope and the carrier.

1) Is there a site which already provides this? This page (last image) and this page provide different animations and are not suitabile. In fact, the first link (last image of the webpage) doesn't show $w_1$ and $w_2$ moving at different velocities, but just at the same velocity. The second link does never show the three waveforms $w_1$, $w_2$ and $w$ separately

2) Is there a free tool / software / site to generate such an animation?

• Would Mathematica be a better home for this question? – Qmechanic Apr 3 '17 at 8:50
• @Qmechanic My question was not directly asking for a document written with Mathematica, but just for an animation to show a physical phenomenon. The answer provided an excellent Mathematica work, but other answers (with other solutions) are certainly possible. Anyway, if you as a moderator thought this place is better than the original one, I'll adapt to your decision. – BowPark Apr 3 '17 at 9:02
• For the record, I think that migrating this here was unnecessary and against the formulation of the question, which has no mention of Mathematica and explicitly discourages answers from proprietary platforms. This was perfectly on-topic on physics.se. (CC @Qmechanic) – Emilio Pisanty Apr 3 '17 at 9:22

## 1 Answer

If you mean something like this, Mathematica code through Import["http://halirutan.github.io/Mathematica-SE-Tools/decode.m"]["http://i.stack.imgur.com/5xgER.png"]

it is essentially trivial to produce using your software platform of choice. This specific example was generated using Mathematica; to get the notebook, run the Import code above.

• Thank you! This is exactly what I asked for. I never used Mathematica, but I downloaded the decode.m file: does it contain all the source needed to plot that animation? And will it work only with Mathematica? – BowPark Mar 24 '17 at 13:59
• @BowPark No, the decode.m file is part of this package; the notebook is encoded in the image. To get the source, open a notebook, copy from Import until the second ] into a fresh cell, and run it. I can post the plaintext source if you want, but frankly it won't be all that useful outside of Mathematica. – Emilio Pisanty Mar 24 '17 at 14:17