Equation that integrates previous y-value.

  • Thread starter Pharrahnox
  • Start date
In summary, the conversation discussed the steps involved in finding the maximum velocity of a ship in a game that involves physics equations. These equations include thrust, friction, force, acceleration, and velocity. The goal is to create an equation that can show the velocity at any point in time while assuming continuous acceleration. The conversation also touched on the use of differential equations and how to graph the equation to find the final speed.
  • #1
Pharrahnox
106
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
  • #2
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.
 
  • #3
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.
 
  • #4
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
 
  • #5
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?
 
  • #6
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.
 
  • #7
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.
 
  • #8
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 1 person
  • #9
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.
 

FAQ: Equation that integrates previous y-value.

What is an equation that integrates previous y-value?

An equation that integrates previous y-value is a mathematical formula that takes into account the previous values of y and uses them to calculate the current value. It is often used in calculus and differential equations to model changing systems.

Why is an equation that integrates previous y-value important in science?

Equations that integrate previous y-values help scientists understand and predict how systems change over time. This is crucial in fields such as physics, chemistry, and biology where understanding the behavior of dynamic systems is essential.

How is an equation that integrates previous y-value different from a regular equation?

An equation that integrates previous y-value takes into account the previous values of y, while a regular equation only uses the current value. This allows for a more accurate representation of how a system changes over time.

Can an equation that integrates previous y-value be used for non-linear systems?

Yes, an equation that integrates previous y-value can be used for both linear and non-linear systems. However, the complexity of the equation may increase for non-linear systems.

Are there any limitations to using an equation that integrates previous y-value?

One limitation is that the accuracy of the equation depends on the accuracy of the previous y-values used. If there is an error in the previous values, it can affect the accuracy of the current value. Additionally, the equation may become more complex for non-linear systems, making it more difficult to solve or analyze.

Back
Top