I want to animate in 3D the plane wave $\sin(\omega t+kx+\phi)$, but following the form from the documentation, I can only make $k$ or $\omega$ vary, and I want $t$ to change. How do I do that?

  • 1
    $\begingroup$ Welcome! Please do add more info, especially your code. Consider that the more precise and informative your question, the better your chances for good answers will be. $\endgroup$
    – Yves Klett
    May 1, 2015 at 18:15
  • $\begingroup$ Thank you. There's no really much of a code. I just don't know how to use this function. There may be some proper tag for questions like this, maybe, that I should have used. I wrote this: Animate[Plot3D[ Sin[[Omega]*t + k*x + [Pi]/3], {x, -2, 2}, {t, -5, 5}], {k, -1, 1}] $\endgroup$ May 1, 2015 at 18:29

1 Answer 1


What about this?:

wave[x_, t_, k_, ω_, ϕ_] := Sin[ω*t + k.x + ϕ];
Animate[Plot3D[wave[{x, y}, t, {1, 1}, 1, 0], {x, 0, 3}, {y, 0, 3}],
 {t, 0, 10}]

Mathematica session

where {x,y} or x in the wave function definition is a 2D vector (in order to be able to draw it; in reality, x is a 3D vector and there would be no way to plot), k is the wave vector (I just used {1, 1} for demonstration), its magnitude is related to wavelength as $k = 2\pi/\lambda$ where $\lambda$ is the wavelength, its direction relates to the direction of the wave (energy) propagation. ω is the frequency (I chose 1) and ϕ is the phase which I chose as 0.

  • $\begingroup$ Thank you very much. This is what I have been looking for. What do these numbers: t, {1, 1}, 1, 0 represent and how should this be read? $\endgroup$ May 1, 2015 at 18:35
  • $\begingroup$ Aha, I get, it is $k$, $\omega$ and $\phi$. Whoa, I'm really a beginner. $\endgroup$ May 1, 2015 at 18:37
  • 2
    $\begingroup$ I guess "fucked up" should mean having low plot resolution because of default PerformanceGoal->"Speed" chosen due to Animate. One might want to use explicit PerformanceGoal->"Quality" option for Plot3D. $\endgroup$
    – Ruslan
    May 1, 2015 at 19:09
  • $\begingroup$ They are very polygonal, and at the saddle points there are differently colored triangles. Animations in Wolfram demonstrations usually look much smoother. Sorry for my use of imprecise and non-academic "fucked up". $\endgroup$ May 1, 2015 at 20:21
  • 1
    $\begingroup$ PerformanceGoal -> "Quality" did the job, kinda. Thank you. $\endgroup$ May 1, 2015 at 20:22

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.