# olivierverdier/SpecTraVVave

Python project to compute bifurcation diagrams of travelling waves
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
travwave
.coveragerc
.gitattributes
.gitignore
.travis.yml
coarse.png
diagram.png
requirements.txt
setup.py
wave.png

# SpectraVVave: Compute traveling waves

## 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
bd.initialize()
# 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:

`bd.plot_solution(bd.navigation[-1]['solution'])`

We refine to get a higher resolution travelling wave:

```new_size = 500
`bd.plot_solution(refined)`
```bd.nplot_diagram()