1. ## Difference equations

Convert to Difference equations

y΄->dy/dx

3. ## Re: Difference equations

Originally Posted by jon19

Convert to Difference equations
Please provide more context, like what are you trying to do, what part of your course is this from.

One of the most common reasons for such a process is related to the numericali ntegration of ODEs, but there is no unique way of doing this.

The simplest method is to use that approximation:

$$f(x+h)=f(x)+hf'(x)$$

So defining $\Delta_h f(x)=f(x+h)-f(x)=hf'(x)$.

But these are approximations of a continuous process by discrete.

As I said before we need more context.

.

4. ## Re: Difference equations

Method Euler for the second equation by step h.

5. ## Re: Difference equations

For second equation
y[n + 2] - 2 y[n + 1] + y[n] == -h^2*y[n], y[0] == 1,
y'[0] == 0}
is correct?

6. ## Re: Difference equations

We want to convert the ODE $y''=-y$ into a difference equation. I will use repeated approximation by a difference quotient:

$$y''(x)=\frac{y'(x+h)-y'(x)}{h}=\frac{\frac{y(x+2h)-y(x+h)}{h}-\frac{y(x+h)-y(x)}{h}}{h}=\frac{y(x+2h)-2y(x+h)+y(x)}{h^2}=-y(x)$$

so:
$$y(x+2h)-2y(x+h)+y(x)=-h^2y(x)$$

with initial conditions $y(0)=0,\ y(h)=h+y(0)=h$

and the rest is algebra