Wikiup example

All the pages in this website were done with wikiup. The post-commit script in the CVS server executes parsewikiup on the modified files, using site templates to update the pages.

Here is an example of a short article with equations, figures and computer code:

 = Newton's method =

 Given a function _f_, we want to find its *roots*. Namely, the values of _x_
 such that:

 $f(x) = 0$

 We choose an arbitrary initial value $x_0$ and from it we calculate a new
 value $x_1$ which is the point where the tangent of _f_, at $x_0$, passes
 through the $x$ axis:


 $x_1 = x_0 - \frac{f(x_0)}{f'(x_0)}$

 We now repeat the process recursively:

 $x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} \qquad n = 0, 1, 2, \ldots$

 In an interval where the function is continuous and increasing, that sequence
 will approach the nearest root on the left of the starting value. If the
 function is continuous and decreasing, the sequence will approach the nearest
 root on the right.

 == Example ==

 _Compute the square root of 5, using Newton's method_.

 The number we want to compute is:

 $x = \sqrt{5}$

 let us rewrite that equation as

 $x^2-5 = 0$

 Thus, our problem is equivalent to finding the roots of the function

 $f(x) = x^2-5$

 The recurrence relation becomes:

 $x_{n+1} = x_n - \frac{x_n^2 - 5}{2x_n} = \frac{1}{2}\left(x_n + \frac{5}{x_n}\right)$

 Using `Maxima` (, and an initial value of 1,
 we can find the first terms in the sequence:

 x : 1;
 for i thru 10 do
   (x: float((x + 5/x)/2), print(x));

 The sequence seems to converge rather fast:

We can generate two different HTML versions, of different sizes, using

the following commands:

parsewikiup --style=example1.css --output=example1.html example1
parsewikiup -s example1.css -o example1-big.html -z 1.5 -e "bigeq-" example1

Notice how we had to change the equation prefix in the second case, to obtain the equations in two different sizes. The same figure was used in both cases. We could send the output into two different directories, where we would have the figures in different sizes; in that case we could use the same equation prefix for both.

The HTML pages obtained can be seen in: example1.html and example1-big.html. The style sheet used is here: example1.css.

Last update: 2005-09-02 15:47:25 +0000
Copyright 2004, 2005, Jaime E. Villate <villate AT>
Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.