Program for Computing P(t) and P’(t’) (Abraham-Lorentz)
Option Explicit
Private Sub cmdAL_Click()
Const c As Double = 299792458
Const pi As Double = 3.14159265
Const q As Double = 1
Const Amp As Double = 0.000001
Const eps0 As Double = 0.00000000000885
Const omega As Double = 0.0001 * c / Amp
Const tau As Double = 2 * pi / omega
Const N As Double = 10000
Const dt As Double = tau / N
Const K As Double = q ^ 2 / (6 * pi * eps0 * c ^ 3)
Const v As Double = 0.95 * c
Dim t(N), tp(N) As Double
Dim x(N) As Double
Dim ux(N), uxp As Double
Dim ax(N), axp As Double
Dim daxdt(N), daxdtp As Double
Dim PAL(N), PALp(N) As Double
Dim index As Long
Dim gamma, gammap As Double
Dim IntAL, IntALp As Double
Dim dtp As Double
Dim Fx, Fxp As Double
gamma = 1 / Sqr(1 - v ^ 2 / c ^ 2)
'Compute P(t).
For index = 0 To N - 1
t(index) = index * dt
x(index) = Amp * Sin(omega * t(index))
ux(index) = omega * Amp * Cos(omega * t(index))
ax(index) = -omega ^ 2 * Amp * Sin(omega * t(index))
daxdt(index) = -omega ^ 3 * Amp * Cos(omega * t(index))
gammap = 1 / Sqr(1 - ux(index) ^ 2 / c ^ 2)
Fx = -K * gammap ^ 4 * (daxdt(index) + 3 * gammap ^ 2 * ux(index) * ax(index) ^ 2 / c ^ 2)
PAL(index) = Fx * ux(index)
Next index
'Integrate P(t) to find the energy radiated per cycle.
IntAL = 0
For index = 0 To N - 1
IntAL = IntAL + PAL(index) * dt
Next index
MsgBox ("IntAL = " & IntAL)
'Then transform the values to frame Kprime and compute the power in Kprime.
For index = 0 To N - 1
tp(index) = gamma * (t(index) - v * x(index) / c ^ 2)
uxp = (ux(index) - v) / (1 - v * ux(index) / c ^ 2)
axp = ax(index) / gamma ^ 3 / (1 - v * ux(index) / c ^ 2) ^ 3
gammap = 1 / Sqr(1 - uxp ^ 2 / c ^ 2)
daxdtp = 1 / gamma ^ 4 / (1 - v * ux(index) / c ^ 2) ^ 4 * (daxdt(index) + 3 * v * ax(index) ^ 2 / c ^ 2 / (1 - v * ux(index) / c ^ 2))
Fxp = -K * gammap ^ 4 * (daxdtp + 3 * gammap ^ 2 * uxp * axp ^ 2 / c ^ 2)
PALp(index) = Fxp * uxp
Next index
'Integrate to find the energy radiated per cycle in Kprime.
IntALp = 0
For index = 0 To N - 1
If index < (N - 1) Then dtp = tp(index + 1) - tp(index)
IntALp = IntALp + PALp(index) * dtp
Next index
MsgBox ("IntALp = " & IntALp & ", gamma*IntAL/IntAlp = " & gamma * IntAL / IntALp)
'Output the powers for plotting.
Open "c:\WINMCAD\Physics\ALLL.PRN" For Output As #1
For index = 0 To N - 1
Write #1, t(index), PAL(index), tp(index), PALp(index)
Next index
Close
MsgBox ("Ready for plotting")
End Sub