- #1
Telemachus
- 835
- 30
Homework Statement
Given an initial value problem:
##x'(t)=f(t,x)\,,x(t_0)=x_0##
Use centered finite differences to approximate the derivative, and deduce a scheme that allows to solve the (ivp) problem.
Homework Equations
For centered finite differences ##\displaystyle\frac{dx}{dt} \approx \frac{x(t+h)-x(t-h)}{2h}##
The Attempt at a Solution
[/B]
First, I discretized the variable t: ##t_i=t_0+ih, \forall i=0,1,2,...,N##
So then, using the formula for finite differences, and calling ##x(t_i)=x_i##
I've obtained:
##x_{i+1}-x_{i-1}=2hf(t_i,x_i)##
The problem is that if I try some test function ##f(x,t)## I think that the ivp gives inssuficient data to solve the problem, I get more ##x_i's## than equations when trying to solve. So I think I'm doing something wrong.
Last edited: