Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The change in the belocity of a body falling at a relatively slow speed over a short distance is given by $\frac{\mathrm{d}v}{\mathrm{d}t}= g - kv$, where $g$ is the acceleration due to gravity and $k$ is a constant. Let $g = 9.8$m/sec$^2$, $k = 0.02$, $\Delta t = 2$, and $v_0 = 0$.

Write a formula for velocity using Euler's Method.

I know that Euler's method is: (new $y$ value) = (old $y$ value) + (slope of curve at old pt)*(change in x)

So for this it would be $v_1 = v_0 + \left(g-kv_0 \right)\Delta t$ ?????

I don't trust my slope of $y$.

share|cite|improve this question
up vote 2 down vote accepted

Let us rewrite your system. You have \begin{align} \dot v = g -kv = f(v) \end{align} Now Euler's (explicit) method reads \begin{align} v_{i+1} =v_i + h f(v_i) = v_i +\Delta tg -\Delta tkv_i = (1-\Delta tk)v_i +\Delta tg \end{align} And this is ecactly, what you wrote for $i=0$.

Some extra candy: Note, that there is also an implicit Euler method $v_{i+1} = v_{i}+hf(v_{i+1})$ which is implicit and therefore more stable. I wrote a quick Matlab code for your problem, combining explicit and implicit Euler and the analytical solution. I really encourage you, to take a different choice for $\Delta t$.

function newtonVelocity

close all

k = 0.02;
g = 9.81;

for i=1:100;
    y = [y,y(end)*(1-Dt*k)+Dt*g];
title('Euler method');
grid on

for i=1:100;
    y = [y,y(end)/(1+Dt*k)+Dt/(1+Dt*k)*g];
hold on
grid on

t = 0:100;
z= (1-exp(-k*t))*g/k; % this is the analytical solution
legend('Explicit','Implicit','Analytical Solution');


Here is a plot for $\Delta t = 2$. Newton Delta is 2

And here for $\Delta t=1$, which is still large. Newton Delta is 1

share|cite|improve this answer
Just because I haven't seen that notation before, does $\dot v$ mean $v^{\prime}$? – yiyi Feb 26 '13 at 8:37
@MaoYiyi yes. In phycis one often writes $\dot f$ instead of $f'$ to emphasize that it is a derivative with respect to time. – k1next Feb 26 '13 at 8:38
So am I correct? – yiyi Feb 26 '13 at 8:45
But only if it is a function of $t$. So for $f=f(x)$ you write $f'(x)$, but for $g=g(t)$ you could write $\dot g(t)$. – k1next Feb 26 '13 at 8:46
Yes you are correct! (In the comment above, I haven't read your reply to my first comment) – k1next Feb 26 '13 at 8:46

Your Answer


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.