Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote a few lines that numerically solve Maxwell's equations.

The result is a moving wave that looks like a single pulse.

This looks strange to me because I expect waves to move in oscillator fashion, perhaps like cos(x).

Why doesn't the wave appear to oscillate?

How does this kind of Gaussian wave work? Can it be broken into solutions?

Do similar solutions exist in 2D? Are they still Gaussian?

%%Super basic FDTD
clear all;
steps = 100;
for i=1:steps
    for j=1:(gsz-1)
    for j=2:gsz
    ez(gsz)= ez(gsz)+exp(-((i-30)^2) /100);
share|cite|improve this question
If you're asking if there are errors in the code that you've posted, it's probably better suited to StackOverflow. But if you're wondering about how these kinds of solutions come from Maxwell's equations, then I suggest you reframe your question with the equations you used. In this form, your question isn't strictly relevant. :) – Kitchi Mar 13 '13 at 11:06
@Kitchi, I am confident there are no errors in the code. I want to know if a pulse like solution should have oscillations as it travels. If I didn't make this clear please rephrase my question. – Mikhail Mar 13 '13 at 14:01
@Mikhail your question isn't bad as is, but it would probably help if you remove the code to make it clear that you're not asking coding questions. You could put an animated image of the solution you found instead. – David Z Mar 13 '13 at 17:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.