ASCIIMath input, SVGMath output example
What is ASCIIMath?
This page is a demo of math written using ASCIIMath, which provides a very easy method for entering math, similar to a graphic calculator. It saves a lot of the hassle of LaTeX. For example, a fraction is as easy as `a = b/c`
.
You don't see any ASCIIMath in the page source because it has already been processed on the server before being delivered here.
What is SVGMath?
The math output on this page consists of SVGs embedded in image tags. It results in much faster rendering than either MathJax or KaTeX, while retaining the same attractive presentation and some of the accessibility.
See the SVGMath demo and SVGMath overview, which has comparison statistics between SVGMath, MathJax and KaTeX.
The content on this page is from my old IntMath site.
[ASCIIMath input, SVGMath output demo starts]
Runge-Kutta (RK4) numerical solution for Differential Equations
The Runge-Kutta Method produces a better result than Euler's Method in fewer steps.
Runge-Kutta Method Order 4 Formula
where
Runge-Kutta Method of Order 2
We begin with two function evaluations of the form:
The and are unknown quantities. The idea was to take a linear combination of the and terms to obtain an approximation for the y value at , and to find appropriate values of and .
By comparing the values obtains using Taylor's Series method and the above terms (I will spare you the details here), they obtained the following, which is Runge-Kutta Method of Order 2:
where
Runge-Kutta Method of Order 3
As usual in this work, the more terms we take, the better the solution. In practice, the Order 2 solution is rarely used because it is not very accurate.
A better result is given by the Order 3 method:
where
This was obtained in a similar way to the earlier formula, by comparing Taylor's Series results.
The most commonly used Runge-Kutta formula in use is the Order 4 formula (RK4), as it gives the best trade-off between computational requirements and accuracy.
Let's look at an example to see how it works.
Example
Use Runge-Kutta Method of Order 4 to solve the following, using a step size of for .
Step 1
Note: The following looks tedious, and it is. We'll use a computer (not calculator) to do most of the work for us. The following is here so you can see how the formula is applied.
We start with and . We'll find the F values first:
For , we need to know:
, and
We substitute these into the expression:
For , we need to know:
So
For , we need to know:
So
Step 2
Next, we take those 4 values and substitute them into the Runge-Kutta RK4 formula:
Using this new y-value, we would start again, finding the new , , and , and substitute into the Runge-Kutta formula.
[ASCIIMath input, SVGMath output demo ends]
See also
See the SVGMath demo which has comparisons with MathJax and KaTeX processing, and SVGMath overview, which has comparison statistics between SVGMath, MathJax and KaTeX.