Thread: Can anybody help me with this?

1. Can anybody help me with this?

I am currently calculating the numerical solution to a vehicle in motion stopping.
I have used an Euler method where the initial kinetic energy T is calculated with 1/2mv^2.
The Euler method then reduces the kinetic energy in terms of friction and wind resistance. Tn+1 = Tn + h*f(x)

where f(x) = B + Cv^2 and B, C are the constants for friction and wind.

After each iteration I have used the new kinetic energy to calculate the velocity for the next value. i.e Tn+1 = 1/2mv^2

Therefore

v = sqrt((2*Tn+1)/m)

The Euler loop then continues until the Kinetic energy is zero and nh is the distance.

The problem;

When plotting the results Kinetic energy against Distance I have a line. This should be a curve should it not?

Am I calculating the velocity correctly? Are there any problems with my calculations etc. Any help would be greatly appreciated

2. Hi

This is effectively strange

Are you sure that you are taking into account the current speed in the expression of f ?

I mean that you should have $T_{n+1} = T_n + h(B+C {v_n}^2)$

3. Yes, I am pretty sure. I have worked out the first three steps by hand and it matches the first three steps in the program. I'm not sure if I'm working out the velocity in the correct way for each step though.

After I reduce the Kinetic energy I then calculate the velocity based on the new kinetic energy. v = sqrt((2*T)/m) Is this correct? or is there another way to find the new velocity.

I have the results of the program if you want me to post them

4. OK
Could you post the results you got for the first steps
And also the values of the constants (T0, B, C, h, m, ...)

5. Originally Posted by revolution2000
I am currently calculating the numerical solution to a vehicle in motion stopping.
I have used an Euler method where the initial kinetic energy T is calculated with 1/2mv^2.
The Euler method then reduces the kinetic energy in terms of friction and wind resistance. Tn+1 = Tn + h*f(x)

where f(x) = B + Cv^2 and B, C are the constants for friction and wind.

After each iteration I have used the new kinetic energy to calculate the velocity for the next value. i.e Tn+1 = 1/2mv^2

Therefore

v = sqrt((2*Tn+1)/m)

The Euler loop then continues until the Kinetic energy is zero and nh is the distance.

The problem;

When plotting the results Kinetic energy against Distance I have a line. This should be a curve should it not?

Am I calculating the velocity correctly? Are there any problems with my calculations etc. Any help would be greatly appreciated
You have:

$\frac{dT}{dt}=f(v)=B+Cv^2=B+\frac{2C}{m}T$

which is the ODE you are integrating.

CB

6. For an increment of h = 1
where B and C are always set to -3454.5 and -0.2514175 respectively.

B = umg
u is the coefficient of friction.
C =

T0 is 10ms^-1

Results

T:
46520.4
43042.5
39566.3
36091.9
32619.3
29148.4
25679.2
22211.8
18746.1
15282.2
11820
8359.58
4900.88
1443.92
-2011.31

S:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

V:
9.64576
9.2782
8.89565
8.49611
8.07704
7.63523
7.16648
6.6651
6.12309
5.52851
4.8621
4.08891
3.13078
1.69936
-1.#IND

F = h*(B+Cv^2) where v= sqrt((2*T)/m) not actually to sure which T it is calculating Tn I assume. I think this is where the problem lies I just don't know how to go about solving it.
-3477.89
-3476.14
-3474.4
-3472.65
-3470.9
-3469.16
-3467.41
-3465.67
-3463.93
-3462.18
-3460.44
-3458.7
-3456.96
-3455.23
-1.#IND

If you calculate the speed you can find the formula with exponential

$v_n^2 = \left(v_0^2+\frac{B}{C}\right)\left(1+\frac{2hC}{m }\right)^n-\frac{b}{C}$

But due to the fact that $\frac{2hC}{m}=-5 \cdot10^{-4} << 1$
we can use the approximation $\left(1+\frac{2hC}{m}\right)^n=1+\frac{2hC}{m}\:n$ which leads to the linear approximation of the square of the speed

$v_n^2 = \left(v_0^2+\frac{B}{C}\right)\frac{2hC}{m}\:n+v_0 ^2$

Or $T_n = \left(v_0^2+\frac{B}{C}\right)hCn+T_0$

This gives a linear trend but this is only an approximation

Speed :

Zoom

Kinetic energy

Zoom

8. Originally Posted by revolution2000
I am currently calculating the numerical solution to a vehicle in motion stopping.
I have used an Euler method where the initial kinetic energy T is calculated with 1/2mv^2.
The Euler method then reduces the kinetic energy in terms of friction and wind resistance. Tn+1 = Tn + h*f(x)

where f(x) = B + Cv^2 and B, C are the constants for friction and wind.

After each iteration I have used the new kinetic energy to calculate the velocity for the next value. i.e Tn+1 = 1/2mv^2

Therefore

v = sqrt((2*Tn+1)/m)

The Euler loop then continues until the Kinetic energy is zero and nh is the distance.

The problem;

When plotting the results Kinetic energy against Distance I have a line. This should be a curve should it not?

Am I calculating the velocity correctly? Are there any problems with my calculations etc. Any help would be greatly appreciated
Hmmmm wait though...if you're plotting Kinetic Energy vs. Distance you should obtain a line because Tn+1 = Tn + hf(x) is a linear relationship and ultimately your velocity plays the role of a constant in each new iteration...I might be following your logic incorrectly but I seem to see a straight line relationship :S

9. Oh wow the response above is a lot better. Disregard mine completely I was taking a blind shot there (lol)