Beispiel #1
0
def antikink_v0_95():
	dx = 0.025

	xLim = [-60,0]

	M  = int((xLim[1] - xLim[0])/dx) + 1
	x = np.linspace(xLim[0],xLim[1],M)

	v0 = .95
	x0 = -20

	state = SG.kink(x,0,v0,x0,epsilon=-1)
	field = SG.SineGordon(timeStepFunc='eulerRobin', state=state)
	return field
xLim = [-40, 0]  # x range

v0 = 0.875  # Antikink's initial velocity
x0 = -20  # Antikink's initial position
k = np.linspace(0, 0.2, 2001)  # Values for the Robin boundary parameter

dk = k[1] - k[0]
print('dk', dk)

### Setup x grid
M = int((xLim[1] - xLim[0]) / dx) + 1
x = np.linspace(xLim[0], xLim[1], M)

### Run the time evolution for each value of k and save the resulting field
state = SG.kink(x, 0, v0, x0, -1)
field = SG.SineGordon(state)
for t in [1000]:
    field.time_evolve('euler_robin',
                      t + abs(x0) / v0,
                      dt=dt,
                      k=k,
                      dirichletValue=2 * pi,
                      dynamicRange=True)
    field.save(
        f'v875Kinematics_k{len(k)}_t{t}_dx{str(dx)[2:]}_dt{str(dt)[2:]}_field.nc'
    )  # save field to disk

### Find the bound state eigenvalues associated with the solitons produced in the antikink/boundary collision
### Ignore any breathers with frequency > 0.999
fieldFileName = f'v875Kinematics_k{len(k)}_t1000_dx{str(dx)[2:]}_dt{str(dt)[2:]}_field.nc'
eigenFileName = f'v875Kinematics_k{len(k)}_t1000_dx{str(dx)[2:]}_dt{str(dt)[2:]}_eigenvalues.nc'
Beispiel #3
0
dt = 0.2

xLim = [-20, 0]

M = int((xLim[1] - xLim[0]) / dx) + 1
x = np.linspace(xLim[0], xLim[1], M)

v0 = np.array([0.4, 0.6, 0.8])
# v0 = 0.6
k = np.array([0, 0.2, 0.4, 0.6])
# k = 0.2
# v0, k = 0.6, 0.9
x0 = -10

state = SG.kink(x, 0, v0, x0, -1)
field = SG.SineGordon(timeStepFunc='eulerRobin', state=state)

### XXX: What if tFin could be a function of the paramters?
### so tFin = lambda v0, x0: x0/v0 + 200
field.time_evolve(tFin=150,
                  dt=dt,
                  k=k,
                  dirichletValue=2 * pi,
                  dynamicRange=True)

vRange = [-0.95, 0]
eigenvalues = field.boundStateEigenvalues(vRange,
                                          selection={
                                              'v': 1,
                                              'k': 1
                                          },
Beispiel #4
0
dt = 0.002

xLim = [-40, 0]  # x range

v0 = 0.95  # Antikink's initial velocity
x0 = -20  # Antikink's initial position
k = np.linspace(0.06, 0.075, 7501)  # Values for the Robin boundary parameter
print('dk', k[1] - k[0])

### Setup spatial grid
M = int((xLim[1] - xLim[0]) / dx) + 1
x = np.linspace(xLim[0], xLim[1], M)

### Run the time evolution and save the result ###
state = SG.kink(x, 0, v0, x0, -1)
field = SG.SineGordon(state)
tList = [
    100
]  # t=100 -> ~104 hours compute time!  Hope to get this down in the future.
for t in tList:
    field.time_evolve('euler_robin',
                      t + abs(x0) / v0,
                      dt=dt,
                      k=k,
                      dirichletValue=2 * pi,
                      asymptoticBoundary={'L': 2 * pi})
    field.save(
        f'v95Kinematics_k{len(k)}_t{t}_dx{str(dx)[2:]}_dt{str(dt)[2:]}_field.nc'
    )  # save field to disk

### Find the bound state eigenvalues associated with the solitons produced in the antikink/boundary collision
def tevolve(v, k):
	state = SG.kink(x,0,v,x0,-1)
	field = SG.SineGordon(state)
	field.time_evolve('euler_robin', 100+abs(x0)/v, dt=dt, k=k, dirichletValue=2*pi, asymptoticBoundary={'L':2*pi},
		progressBar=False)
	return float(field.state['u'][{'x':-1}].data)