 soliton = (A, x1) ->
     3*A.pow(2) * (sech(.5*A*(x+x1))).pow(2)
     
-# Soliton graph (LineChart imported from another blab - see "Ext" section)
 lineChart = new $blab.LineChart
     id: "solitons"
     xLabel: "x"


# Set up grid
N = 256
dt = 0.8/N.pow(2)  # 0.4 in Trefethen
x = 2*pi/N * linspace(-N/2, N/2-1, N)

# Integrating factor


# Animated soliton plot
animateSolitons = (u) ->
    v = fft u
    @kdv.snapshotFunction = ->
        {u, v} = computeUV(v)
        lineChart.plot(x, u)
    @kdv.animate()
    
# Run: two solitons
initSoliton(-1, 800)
initSoliton(0, 200)
