[Math] Differential equation to Difference equation

linear algebraordinary differential equationsrecurrence-relations

I have the following equation :

$$\frac{dx}{dt} = -5(x-2)$$

$$\frac{dy}{dt} = 0$$

How do I change this differential equation to a difference equation ? Do I use Euler forward method ? I remember taking this before but I have totally forgotten about it. I tried reading online to refresh my memory but I did not really grasp the idea. I would really appreciate if someone can solve this particular equation step by step so that I can fully understand the solution, along with supporting key concept points to grasp the idea.
Thanks.

Best Answer

You seem to be interested in the general techniques for solving differential equations numerically.

Given $x'(t), y'(t)$ there are many ways you can come up with a differencing equation to approximate the solution on a discretized domain. Most of these are derived from Taylor series expansions.

$$x(t+\Delta t) = x(t) + x'(t) \Delta t + \ldots$$

Truncating the expansion here gives you forward differencing. As this is a problem rooted in time integration, this is most likely the kind of thing you would want to do.

However, as often as not one prefers more sophisticated approaches. Euler's method is simple but also not very good. 4th order Runge-Kutta is often used, as it strikes a balance between simplicity and accuracy that is usually pretty good. This too can, in principle, be derived from Taylor series expansions, but that's a bit more involved.

Related Question