In [ ]:
include("../src/GinzburgLandau.jl")
GL = GinzburgLandau
using PyPlot
In [ ]:
σ = 1.91e-2
c₃ = 1.66
c₁ = 0.64
γc = 1.99e-2
gle = GL.GLECoeffs(σ, γc, c₁, c₃)
In [ ]:
N = 128
L = 1.0
Δt = 0.001
slv = GL.GLESolver1(L, N, Δt, gle);
In [ ]:
z = GL.nodes(slv)
a0 = 1.0 + 0.0im+ 0.05*cos(π*z/L) -0.05*cos(2π*z/L) + 0.02*cos(3π*z/L) ;
In [ ]:
In [ ]:
In [ ]:
m = 1000
â = zeros(Complex{Float64}, N, m);
t = Δt*(0:(m-1))
In [ ]:
â[:,1] = dct(a0);
In [ ]:
for i = 2:m
GL.gle_step!(slv, gle, sub(â, :, i-1), sub(â, :, i))
end
In [ ]:
In [ ]:
#plot(t, vec(real(a[1,:])))
a = idct(â, 1)
plot(z, real(a0), "b-")
plot(z, real(a[:,m]), "r-")
In [ ]:
nd = 4
m2 = m * nd
dt2 = Δt/nd
â₂ = zeros(Complex{Float64}, N, m2);
t2 = dt2*(0:(m2-1))
â₂[:,1] = dct(a0);
In [ ]:
slv2 = GL.GLESolver1(L, N, dt2, gle);
In [ ]:
for i = 2:m2
GL.gle_step!(slv2, gle, sub(â₂, :, i-1), sub(â₂, :, i))
end
In [ ]:
a2 = idct(â₂, 1)
plot(z, imag(a0), "b-")
plot(z, imag(a[:,m]), "r-")
plot(z, imag(a2[:,m2-nd+1]), "g--")
In [ ]:
err = maxabs(a[:,m] - a2[:,m2-nd+1])
In [ ]:
nd
In [ ]:
In [ ]: