Python project to compute bifurcation diagrams of travelling waves
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

SpectraVVave: Compute traveling waves

Build Status Coverage Status ![Python version](, 3.4, 3.5-blue.svg?style=flat-square)

Getting started

Here is a simple example to get started with SpectraVVave:

We first import the relevant bits in SpectraVVave:

from travwave.diagram import BifurcationDiagram
import travwave.equations as teq
import travwave.boundary as tbc

Define the half length of the travelling wave:

length = 30

Which equation are we solving. Look in the travwave/equations folder, or implement your own equation. Here we choose the KDV equation.

equation = teq.kdv.KDV(length)

Which boundary condition are we using? You will find some possible boundary conditions in travwave/bounday, or you can implement your own. Here we use the Minimum boundary condition, which enforces the minimum to be at zero.

boundary_cond = tbc.Minimum()

Setup the diagram object, initialize and run it:

bd = BifurcationDiagram(equation, boundary_cond)
# initialize it with default parameters
# run for fifty steps

Let us see what the amplitude reached is:

print('Amplitude = ', bd.navigation[-1]['parameter'][bd.navigation.amplitude_])

We plot the current computed solution, at coarse resolution:


Refined solution

We refine to get a higher resolution travelling wave:

new_size = 500
refined, v, parameter = bd.navigation.refine_at(new_size)

and we plot that refined solution:


Refined solution

We plot the bifurcation diagram, as well as the last refined parameter:

plt.plot(parameter[0], parameter[1], 'or')

Bifurcation Diagram