Equation that integrates previous y-value.

  • Context: Undergrad 
  • Thread starter Thread starter Pharrahnox
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around formulating an equation to determine the maximum velocity of a ship in a game, incorporating physics concepts such as thrust, friction, and acceleration. Participants explore how to express the velocity as a function of time, particularly focusing on the relationship between the current and previous velocity values.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant presents a thrust equation based on power and a constant, and a friction equation that depends on velocity and other constants.
  • Another participant suggests that the change in velocity can be modeled using a differential equation, specifically stating that the rate of change of y with respect to time is proportional to y.
  • A participant expresses confusion about applying the differential equation to their specific scenario and seeks clarification on its usage.
  • It is proposed that for computational purposes, the differential equation can be approximated using discrete time steps, leading to an equation for velocity that incorporates previous velocity values.
  • There is a discussion about whether the friction term should be added or subtracted in the equation, indicating a potential misunderstanding or differing interpretations of the model.
  • One participant corrects a previous statement about the sign of the friction term and provides a clearer formulation of the differential equation, including a solution that approaches a maximum velocity over time.
  • Another participant inquires about how to graph the resulting equation and whether the initial velocity should be set to zero.
  • A later reply suggests that the equation should account for conditions under which acceleration ceases, linking it back to the model's assumptions.
  • One participant expresses gratitude for the assistance received and acknowledges their ongoing learning process in understanding the mathematical concepts involved.

Areas of Agreement / Disagreement

The discussion contains multiple competing views regarding the formulation of the equations and the interpretation of terms like friction. Participants express uncertainty about specific mathematical details and how to apply the concepts, indicating that the discussion remains unresolved in certain aspects.

Contextual Notes

Participants highlight the need for clarity in the mathematical formulation, particularly regarding the signs of terms in the equations. There is also mention of the dependency on initial conditions and the assumptions made about the motion of the ship.

Who May Find This Useful

Individuals interested in game development, physics simulations, or mathematical modeling of dynamic systems may find this discussion relevant.

Pharrahnox
Messages
106
Reaction score
0
I am making a game that has some sort of physics equations, although heavily modified to make it work better. I am trying to find the maximum velocity of a ship according to these rules/steps:

thrust = ((p*r)^0.5)*10

-where r is a constant (0.04) and p is the power (3.33x10^5 in this case)

friction = f*v*a

-where f is another constant (500), v is the velocity, and a is yet another constant (1.5 in this case)

force = t-friction
acceleration = force/mass (mass = 1403.14)
velocity += acceleration

Ok, so there are several steps involved to find the velocity, but I am trying to make an equation that can show the velocity at any point in time, assuming you are accelerating the whole time. This equation would also give me the maximum velocity.

The problem I am having is that the equation would involve the previous y value, and I don't know how to put that into an equation.

Somthing like y = y_previous + (107.457 - (750 * y_previous) / mass)

Thanks for any help.
 
Mathematics news on Phys.org
Where the change in y depends on the previous value of y, the equivalent continuous equations is:
$$\frac{dy}{dt}=ky$$ ... where k is a constant.

The solution is an exponential.
 
I have done a bit of research, and this appears to be a differential equation, of which I have no understanding of, and staring at the weird equations doesn't seem to help...

The dy/dt bit that you have there, how can I apply to my equation? I get what it means, that the change in y with respect to the change in time is equal to the y value multiplied by a constant, yet I don't know how to use that.
 
For a computer $$\frac{dy}{dt}\approx \frac{\Delta y}{\Delta t}$$ where ##\Delta t## is your time-step.

Your acceleration number is your ##\Delta v##

##v_{n+1}=v_n+\Delta v##

Putting your equations together: $$\Delta v = \frac{1}{m}\left( t-fav_n \right) = c+kv$$... where c=t/m and k=fa/m are constants.

http://mathinsight.org/from_discrete_to_continuous_dynamical_systems
 
Is it c + kv or c - kv? Because c + kv would mean the friction adds to the acceleration.

As for the link, I can't view the videos at the moment, my internet is really slow right now.

So with the equation you have there, where do you go from there? How do you put that into a graph, because it is still pretty much in the form of v = vn-1+Δv?
 
from what I put - yeah. cut and paste error :)
off the first line, k=-fa/m but it is probably clearer to make k positive for fa positive.
Thus c-kv.

Trying to find a tutorial page that does not use video:
http://mathinsight.org/thread/elementary_dynamical_systems

I'd write $$\frac{dv}{dt} = c-kv$$ ... and solve the differential equation.

$$v(t) = \frac{c}{k}+v_0e^{-kt}$$ ... ##v_0=v(t=0)##.

Plot that and you see it tends towards the value c/k as time gets very big. So that is your top speed.

You need to learn how to do this - getting other people to do it usually costs money.
 
Ok thanks for your help. When you plot that, do you mean that that is the equation I can use for the graph, or that I have to find each individual value by plugging it into the formula? In this case, would v0 = 0, because it starts from rest? Then that would make the equation just v(t) = c/k.
 
There's something missing isn't there?
... as long as t>fav, which is the case for v=0, there should be motion
... I think I put the brackets in the wrong place.
Good thing I'm not charging you :)

[edit:]Checked the math...

The actual equation should have been:

$$v(t)=\frac{c}{k}\big(1-e^{-kt}\big)$$

The discrete form gives $$v_n = \frac{c}{k}\big(1-e^{-nk\Delta t}\big):n=0,1,2,\cdots$$ ... for constant time interval Δt.

By "plot that" I just mean make a graph of the equation.

Aside:
since you only have acceleration as long as (t-fav)>0, that means that when v=t/fa, the acceleration stops.
therefore v=t/fa is the final speed.

from the continuous equation:
c=t/m, and k=fa/m so c/k = t/fa is the final speed ... in agreement with your model.
 
Last edited:
  • Like
Likes   Reactions: 1 person
Thankyou so much, this is just what I wanted. It might be a while before I get to the stage of understanding how to get to that point, but I'll learn eventually. I'll continue to research and I'll ask my teachers, but unfortunately they don't offer Specialist Maths at my school... Anyway, this is great. Thanks again.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 97 ·
4
Replies
97
Views
6K
  • · Replies 37 ·
2
Replies
37
Views
2K
Replies
3
Views
1K
  • · Replies 42 ·
2
Replies
42
Views
6K
Replies
29
Views
3K