Program for Larmor-Lienard, Oscillation Along the y-axis

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), y(N) As Double

Dim ux(N), uxp, uy(N), uyp As Double

Dim ax(N), axp, ay(N), ayp As Double

Dim PLL(N), PLLp(N) As Double

Dim index As Long

Dim gamma, gammap As Double

Dim IntLL, IntLLp As Double

Dim dtp 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) = 0

y(index) = Amp * Sin(omega * t(index))

ux(index) = 0

uy(index) = omega * Amp * Cos(omega * t(index))

ax(index) = 0

ay(index) = -omega ^ 2 * Amp * Sin(omega * t(index))

gammap = 1 / Sqr(1 - uy(index) ^ 2 / c ^ 2)

PLL(index) = K * gammap ^ 6 * ay(index) ^ 2

Next index

'Integrate P(t) to find the energy radiated per cycle.

IntLL = 0

For index = 0 To N - 1

IntLL = IntLL + PLL(index) * dt

Next index

MsgBox ("IntLL = " & IntLL)

'Then transform the values to frame Kprime and compute the power in Kprime.

For index = 0 To N - 1

tp(index) = gamma * t(index)

uxp = -v

uyp = uy(index) / gamma

axp = 0

ayp = ay(index) / gamma ^ 2

gammap = 1 / Sqr(1 - (uxp ^ 2 + uyp ^ 2) / c ^ 2)

PLLp(index) = K * gammap ^ 6 * (ayp ^ 2 - (uxp * ayp / c) ^ 2)

Next index

'Integrate to find the energy radiated per cycle in Kprime.

IntLLp = 0

For index = 0 To N - 1

If index < (N - 1) Then dtp = tp(index + 1) - tp(index)

IntLLp = IntLLp + PLLp(index) * dtp

Next index

MsgBox ("IntLLp = " & IntLLp & ", gamma*IntLL/Intllp = " & gamma * IntLL / IntLLp)

'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), PLL(index), tp(index), PLLp(index)

Next index

Close

MsgBox ("Ready for plotting")