Skip to content

Instantly share code, notes, and snippets.

@garyballantyne
garyballantyne / blab.md
Last active October 31, 2015 04:29
FOURTH-ORDER TIME-STEPPING FOR STIFF PDEs [http://blabr.io?329d5b436cf4351ab618]

FOURTH-ORDER TIME-STEPPING FOR STIFF PDEs

pos: 1

Code to implement Kassam et al's algorithm is given below.

As an example, the

Solitons

pos: 1

A soliton is a pulse that experiences both nonlinearity and [dispersion](http://en.wikipedia.org/wiki/Dispersion_(water_waves). Nonlinearity sharpens the pulse---taller parts travel faster than shorter parts (like a wave breaking on a beach). Dispersion spreads it out---different frequencies travel at different speeds. With a soliton the sharpening and spreading balance exactly (and the balance is stable!).

@garyballantyne
garyballantyne / blab.md
Last active November 9, 2015 08:03
A toy problem for compressive sensing [http://blabr.io?e8a066234715f21c21fd]

A toy problem for compressive sensing

pos:1

Three samples are required to reconstruct a quadratic signal $f(t)=a_0+a_1t+a_2t^2$ (i.e., to find coefficients $a_0$, $a_1$ and $a_2$). Unless, that is, $f$ is sparse (has only one nonzero coefficient) and we apply Compressive Sensing.

Say we know $f$ at two points, (-1,1) and (2,4), as shown by the red squares in

Plot Widget

To do:

  • escape backslash in mathjax
  • mathjax in legends

Demo: importing definitions

Functions defined in one blab can be used (imported) by another. Function in the "defs" structure (as "soliton" is, at the end of this blab) are available to be imported. This demo shows how to import and use the soliton function.

Demo: basic math

Math on the left is evaluated on the right. Click the play button to run the demo or, to learn more, see this blab.

Demo: basic plot

The demo shows how to create a simple plot. See "Doc & Examples" below for more complex examples.

Demo: layout

A blab's elements (text, tables, etc.) are located within rows of "boxes". Boxes are numbered sequentially (with a "position"), left-to-right across a row, and then down the page.

This text is in the first row, which always has exactly one box, with position zero (pos: 0). Subsequent rows have a specified number of boxes (up to three). This demo shows how to lay out content using the box system.

Demo: text

Apart from code comments, a blab's text is authored in a single file, using GitHub Flavored Markdown and MathJax ($e^{i\pi} = -1$). Click on this text to see that file.

By default, text appears at the top of the page, but can be positioned anywhere (layout demo).