# How to define a stochastic electromagnetic field? [closed]

I would like to show the effect of a stochastic electromagnetic field on a relativistic charged particle, using a manipulate box.

The field should be randomly varying in time and in space, and be defined as a superposition of plane waves with a specific frequency distribution. The polarisation state of each plane wave, their amplitude and phase constant should be fully random. And finally the frequency distribution should be Lorentz invariant : $$df = \frac{1}{\pi^2 c^3} \; \omega^2 \, d\omega.$$

Here's a MWE code that shows the effect of a very simple constant and uniform EM field :

a = {0, 1, 0}; (* Polarisation vector should be orthogonal to wave orientation *)
b = {0, 0, 1};

FieldE[t_, x_, y_, z_] := a
FieldB[t_, x_, y_, z_] := b

Velocity[t_] := {x'[t], y'[t], z'[t]}

Force[t_, q_] := q(FieldE[t, x[t], y[t], z[t]] + Cross[Velocity[t], FieldB[t, x[t], y[t], z[t]]])

Acceleration[t_, q_] := Force[t, q] - (Force[t, q].Velocity[t]) Velocity[t]

Motion[q_, v0_, theta_, phi_] := NDSolve[{
x''[t] == Sqrt[1 - Velocity[t].Velocity[t]]{1, 0, 0}.Acceleration[t, q],
y''[t] == Sqrt[1 - Velocity[t].Velocity[t]]{0, 1, 0}.Acceleration[t, q],
z''[t] == Sqrt[1 - Velocity[t].Velocity[t]]{0, 0, 1}.Acceleration[t, q],
x[0] == 0,
y[0] == 0,
z[0] == 0,
x'[0] == v0 Sin[theta]Cos[phi],
y'[0] == v0 Sin[theta]Sin[phi],
z'[0] == v0 Cos[theta]

}, {x, y, z}, {t, 0, 10},
Method -> Automatic, MaxSteps -> Automatic]

Trajectory[t_, q_, v0_, theta_, phi_] := ParametricPlot3D[Evaluate[{x[s], y[s], z[s]}/.Motion[q, v0, theta, phi]], {s, 0.001, t}
]

Manipulate[
Show[
Trajectory[t, q, v0, theta Pi/180, phi Pi/180],
PlotRange -> {{-3, 3}, {-3, 3}, {-3, 3}},
Boxed -> True,
Axes -> True,
AxesOrigin -> {0, 0, 0},
SphericalRegion -> True,
Method -> {"RotationControl" -> "Globe"},
ImageSize -> {700, 700}
],
{{t, 0, "Time"}, 0, 10, 0.01},
{{q, Pi, "Coupling constant"}, -10, 10, 0.01},
{{v0, 0.5, "Initial velocity"}, 0, 1, 0.01},
{{theta, 0, "Theta"}, 0, 180, 0.1},
{{phi, 0, "Phi"}, 0, 360, 0.1}
]


So what would you suggest to change the definitions of a, b, FieldE and FieldB (the first 4 lines of the code above), so to have a stochastic electromagnetic field ?

EDIT 1 : Here's a precision about the plane wave superposition. Consider a single plane wave :

X = {x, y, z}
FieldE[t_, x_, y_, z_] := A a Sin[k.X - omega t + phase]
FieldB[t_, x_, y_, z_] := A Cross[k, a] Sin[k.x - omega t + phase]


where a is a random polarisation vector, that should stay orthogonal to k (the wave vector). A is a random amplitude. We could write k = omega u where u is a random unit vector. And phaseis a random phase constant (between 0 and $2 \pi$).

This plane wave is a solution to Maxwell equations. Now just superpose a large number of these plane waves, each one with a random amplitude A, random orientation of a(that stays orthogonal to k), random orientation of the vector k(or u), and random phase. Now, my only constraint is a distribution of frequencies ($\omega$) that should be Lorentz invariant (this constraint comes from the basic postulate of Stochastic Electrodynamics and has nothing to do with Maxwell equations).

I would like to define at least a superposition of a few (3 or 4 ?) random plane waves, independantly of any frequency distribution. That would already be great.

## closed as too broad by m_goldberg, Jason B., Dr. belisarius, RunnyKine, user9660 Mar 23 '16 at 17:07

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• This doesn't seem like such a simple issue, the way you've written it. The field at any point in time can't be totally random, right? By special relativity, the field at one point in time is connected to the field at previous instants in time, and random changes can't propagate infinitely quickly. – Jason B. Mar 23 '16 at 13:56
• Why the vote to close this question ? By Maxwell equations, the field can have fully random amplitudes and phases without conflicting with relativity theory. This is the base of Stochastic Electrodanymics, which is fully compatible with relativity theory. – Cham Mar 23 '16 at 14:01
• Can I have some explanations about the 3 votes to close this question ? Especially since I already gave a simple solution below ! – Cham Mar 23 '16 at 16:31

Here's an almost complete working solution (the trajectory is pretty !). There's only the Lorentz invariant distribution (amplitude and frequency) to be added.

Clear["Global*"]

X[t_] := {x[t], y[t], z[t]}
V[t_] := {x'[t], y'[t], z'[t]}

n[k_] := n[k] = Normalize[RandomReal[{-1, 1}, 3]]
u[k_] := u[k] = Normalize[RandomReal[{-1, 1}, 3]]

Polarisation[k_] := Polarisation[k] = Normalize[u[k] - (u[k].n[k])n[k]]
Phase[k_] := Phase[k] = RandomReal[{0, 2Pi}]

FieldE[t_] := Sum[Polarisation[k] Sin[2Pi(k)(n[k].X[t] - t) + Phase[k]], {k, 1, 5, 0.1}]
FieldB[t_] := Sum[Cross[n[k], Polarisation[k]] Sin[2Pi(k)(n[k].X[t] - t) + Phase[k]], {k, 1, 5, 0.1}]

Force[t_, q_] := q(FieldE[t] + Cross[V[t], FieldB[t]])
Acceleration[t_, q_] := Force[t, q] - (Force[t, q].V[t])V[t]

Motion[q_, v0_, theta_, phi_] := NDSolve[{
x''[t] == Sqrt[1 - V[t].V[t]] {1, 0, 0}.Acceleration[t, q],
y''[t] == Sqrt[1 - V[t].V[t]] {0, 1, 0}.Acceleration[t, q],
z''[t] == Sqrt[1 - V[t].V[t]] {0, 0, 1}.Acceleration[t, q],
x[0] == 0,
y[0] == 0,
z[0] == 0,
x'[0] == v0 Sin[theta]Cos[phi],
y'[0] == v0 Sin[theta]Sin[phi],
z'[0] == v0 Cos[theta]

}, {x, y, z}, {t, 0, 10}, Method -> Automatic, MaxSteps -> Automatic]

Trajectory[t_, q_, v0_, theta_, phi_] := ParametricPlot3D[Evaluate[{x[s], y[s], z[s]}/.Motion[q, v0, theta, phi]], {s, 0.001, t}]

Manipulate[
Show[Trajectory[t, q, v0, theta Pi/180, phi Pi/180],
PlotRange -> {{-3, 3}, {-3, 3}, {-3, 3}}, Boxed -> True,
Axes -> True, AxesOrigin -> {0, 0, 0}, SphericalRegion -> True,
Method -> {"RotationControl" -> "Globe"},
ImageSize -> {700, 700}
],
{{t, 0, "Time"}, 0, 10, 0.01},
{{q, Pi, "Coupling constant"}, -10, 10, 0.01},
{{v0, 0.5, "Initial velocity"}, 0, 1, 0.01},
{{theta, 0, "Theta"}, 0, 180, 0.1},
{{phi, 0, "Phi"}, 0, 360, 0.1}
]
`

Preview :

Now, I'm wondering about how to improve the code (efficiency and output style), and how to add the random amplitude with the Lorentz invariant spectrum.

Any suggestion on this ?