Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

The other day, I tried to answer someone's question, you can read the question and the answer here:

Numerical Solutions of ordinary differential equations

The problem is, I got stuck towards the end of the calculation. Now my question is: does anyone know how to get order 2?

Many thanks for your help!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You haven't used $b_2 c_2 = \frac{1}{2}$. Taking from where you left off, $e = b_2 h (f(x_n, y_n) - f(x_n + c_2 h, y_n + c_2 h k_1)) + \frac{h^2}{2}*f^\prime(x_n, y_n) +\ldots$ and using the Taylor expansion of $f$ around $(x_n, y_n)$:

$f(x, y) = f(x_0, y_0) + \frac{\partial}{\partial x}f(x_0, y_0)\frac{(x-x_0)}{1!} + \frac{\partial}{\partial y}f(x_0, y_0)\frac{(y-y_0)}{1!} + ... $

we get $f(x_n + c_2 h, y_n + c_2 h k_1) = f(x_n, y_n) + \frac{\partial}{\partial x}f(x_n, y_n)\frac{(c_2 h)}{1!} + \frac{\partial}{\partial y}f(x_n, y_n)\frac{(c_2 h k_1)}{1!} + O(h^2)$

Now make the substitution to eliminate $c_2$ from the RHS and move a term across:

$f(x_n + c_2 h, y_n + c_2 h k_1) - f(x_n, y_n) = \frac{\partial}{\partial x}f(x_n, y_n)\frac{h}{2 b_2} + \frac{\partial}{\partial y}f(x_n, y_n)\frac{h k_1}{2 b_2} + O(h^2)$

and we have

$e = \frac{h^2}{2} (-\frac{\partial}{\partial x}f(x_n, y_n) - \frac{\partial}{\partial y}f(x_n, y_n)k_1) + \frac{h^2}{2}*f^\prime(x_n, y_n) + O(h^3)$

NB I think that $f^\prime$ is $\frac{\partial}{\partial x}f$, so that could be tidied up a bit.

share|improve this answer
    
Thank you! You're right about the partial derivative, I corrected it. –  Matt N. Jan 20 '11 at 20:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.