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.

I'm solving a system of stiff ODEs, at first I wanted to implement BDF, but it seem to be a quite complicated method, so I decided to start with Backward Euler method. Basically it says that you can solve an ODE:

$y'=f(t,y)$, with initial guess $y(t_0)=y_0$

Using the following approximation:

$y_{k+1}=y_k+hf(t_{k+1},y_{k+1})$, where $h$ is a step size on parameter $t$

Wikipedia article says that you can solve this equation using Newton-Raphson method, which is basically a following iteration:

$x_{n+1}=x_n-\frac{g(x_n)}{g'(x_n)}$

So, the question is how to correctly mix them together? What initial guess $x_0$ and function $g$ should be?
Also $f$ is quite complex in my case and I'm not sure if it possible to find another derivative of it analytically. I want to write an implementation of it by myself, so predefined Mathematica functions wouldn't work.

share|improve this question
2  
If computing the derivative of $f$ is not possible, you can try the secant method instead of Newton's method. –  Rahul May 31 '12 at 21:33

1 Answer 1

up vote 3 down vote accepted

Your aim is to solve the following equation for $y_{k+1}$: $$ g(y_{k+1}):=y_{k+1}-y_k-hf(t_{k+1},y_{k+1})=0,$$ where $f$ is a known function and $y_k, t_{k+1}$ and $h$ are known values. This gives you the $g$ for a Newton-Raphson method. As an initial guess, I'd suggest that you use a 1-step forward Euler method to explicitly calculate $$ \hat{y}_{k+1} := y_k+hf(t_{k+1},y_k),$$ and use $\hat{y}_{k+1}$ as your initial guess for $y_{k+1}$.

share|improve this answer
    
Thank you, this help a lot. But how can I find $g'$? Function $f$ is quite complex and I can't analytically differentiate it. –  Andrew May 31 '12 at 21:31
    
Use a secant approximation. –  copper.hat May 31 '12 at 22:26

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.