talk

Web Presentation with Remark

Remark by Ole Petter Bang, version 0.14.0 (https://github.com/gnab/remark/releases/tag/v0.14.0).

Style by liminal.

Printing: Somehow liminal made Remark printing non-functional, you may consider decktape or backslide, as suggested by Remark README file.

Starting Remark

Static HTTP servers.

Python HTTP servers:

# old
python2 -m SimpleHTTPServer 8000
# new
python3 -m http.server 8000

Node.js HTTP servers:

# http-server (Recommended)
npm install -g http-server
http-server -p 8000
# Or static-file serving: No directory listings.
npm install -g node-static   # install dependency
static -p 8000

Install MathJax locally:

npm install mathjax

Markdown Syntax

For more, see Remark and Liminal style files. Do not modify the Remark script file.

Slide properties:

Root Finding Algorithms for Nonlinear Algebraic Equations


Bisection

bisect(f, xmin, xmax, 
       tolerance, x_tolerance, iter) {
  a = xmin;
  b = xmax;
  assert( f(a) * f(b) < 0 );
  for (i = 0; i < iter; i++){
    x[i] = (a + b) / 2;
    y[i] = f(x[i]);
    if (abs(y[i]) < tolerance ||
        (b - a) / 2 < x_tolerance)
      return make_tuple(false, x, y);
    if (y[i] * f(a) > 0) a = x[i];
    else if (y[i] * f(b) > 0) b = x[i];
  }
  return make_tuple(true, x, y);
}

Iteration: Fixed Point

fixed_point(f, g, x0, 
            tolerance, x_tolerance, iter) {
  x[0] = x0;
  y[0] = f(x[0]);
  for (i = 0; i < iter; i++){
    x[i] = g(x[i-1]);
    y[i] = f(x[i]);
    if (abs(y[i]) < tolerance ||
        abs(x[i] - x[i-1]) < x_tolerance)
      return make_tuple(false, x, y);
  }
  return make_tuple(true, x, y);
}

Newton-Raphson

fixed_point(f, Df, x0, 
            tolerance, x_tolerance, iter) {
  x[0] = x0;
  y[0] = f(x[0]);
  for (i = 0; i < iter; i++){
    x[i] = x[i-1] - y[i-1] / Df(x[i-1]);
    y[i] = f(x[i]);
    if (abs(y[i]) < tolerance ||
        abs(x[i] - x[i-1]) < x_tolerance)
      return make_tuple(false, x, y);
  }
  return make_tuple(true, x, y);
}

background-image: url(nonlinear.svg)

` if present in the template;

Content CSS classes: footnote; left, center, right for text block alignment;

Key Binding