Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, EternallyCurious, howardR, 1 invisible), 623 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Math trouble #249661
02/03/09 17:12
02/03/09 17:12
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
ooooookaaayyy..... I'm not good at math, and I need to know how to do this equation.

The speed of an object is 10
The deceleration of the object is 10% (0.1*10)
The exact point the object should stop at is 1024

at what point should the object stop and what is the actual equation to get that value?


- aka Manslayer101
Re: Math trouble [Re: mpdeveloper_B] #249668
02/03/09 17:39
02/03/09 17:39
Joined: Nov 2003
Posts: 698
England, UK
A
Aaron_H Offline
User
Aaron_H  Offline
User
A

Joined: Nov 2003
Posts: 698
England, UK
By "at what point does the object stop" do you mean point in time or distance?

You should be careful when describing physics problems because if you don't use the correct terminology you could come out with the wrong answer..
Do you have any units too? There would be no meaning to any of the values you've given if you do not have a units system in place.. Neither would any answer make sense.

If you could help describe your problem a little more I would be happy to help (I'm doing a physics degree so it's always good practice. :))

Re: Math trouble [Re: Aaron_H] #249671
02/03/09 17:47
02/03/09 17:47
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
ok smile

at what point means distance:

at what distance should an object start to slow down if it starts going 10 and slows down at a rate of 10% and needs to stop at the exact point 1024.

This is an equation i'm trying to put in c-script, but I have to know the equation to put in first :P (if that makes any sense). I'm not sure about units, because that's all the info I have for the equation.


- aka Manslayer101
Re: Math trouble [Re: Aaron_H] #249674
02/03/09 17:57
02/03/09 17:57
Joined: Jul 2002
Posts: 3,208
Germany
Error014 Offline
Expert
Error014  Offline
Expert

Joined: Jul 2002
Posts: 3,208
Germany
It really helps to put units everywhere, since thats an easy way to check the math. Aaron actually nailed it: Without units, all your values don't make any sense. Note please that since "quant" is defined as some kind of distance (in Acknex), you could actually say "the speed is 10 quants per second".


I'm not sure I totally understood your question. When you say "The deceleration of the object is 10% (0.1*10)", do you mean the deceleration has a constant value - say 0.1 m/s²? which would mean the deceleration is constant, or is it always one tenth of the current speed (which kind of messes up the units, but hey!)

I hate not using units, but whatever, we'll roll with it.

I'll just pretend the speed at the beginning is "v0 = 10", the decelaration is a=0.1 (see? I took the constant value, since thats so much easier).

If the objects starts decelerating, it will stop when the speed is zero, right? Makes sense. For a constant acceleration, you can get the speed at the time "t" with:

v(t) = v0 + a*t

obviously, since we're decelerating, "a" actually has a negative value. In order to continue with "a=0.1", we'll put the minus right there. From now on, always remember the directions! (velocity, accerlation, etc. are actually all vectors!). For our time t, the object needs to stop:

v0 - a*t = 0 <-> t = v0/a

The distance your object moved in a time t when it starts at 0, has the speed of v0 and decelerates with a (a>0) (and a is a constant value=, you can use this equation:

s = v0*t - 1/2 * a * t²

Since we already know our "t", and since we - in this case - got a simple expression for it, we can place it in there

s = v0²/a - 1/2 * v0²/a = 1/2 * v0²/a

thats "500" ( = 1/2 * 100/0.1 = 1/2*1000) in your "units".
Since we actually want to get to the point "1024", we need to start decelerating at

1024-500=524

At what time did it originally reach that place? Well, before decelerating, it was moving with the constant velocity "10", and there was no accerlation or deceleration. Therefore, we can say that it travelled the distance "s" in a time "T" (I'm now using a capital letter in order to avoid you being confused with the "t" we had before. Please note that you don't usually use a capital letter here (even though it really doesn't matter all that much ;)))

s = v0*T
<-> T = s/v0

since we want to travel 524 metres, we get

T = 524/10 = 52.4

So it needs to start decelerating at "52.4" (your units).

Also note that if we had palced units here, we would always get the correct unit (i.e. for the last one, we'd have calculated T = 524m/(10 m/s) = 52.4s)

Of course - this complete thing was mainly assumption on my part. I really don't know if I got your questions right, so don't hesitate to ask or elaborate.


Extra note: I'm tired as per usual, so there are likely dozens of mistakes in here. Whoops.


Perhaps this post will get me points for originality at least.

Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
Re: Math trouble [Re: mpdeveloper_B] #249676
02/03/09 17:58
02/03/09 17:58
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
that's weird, because it's no steady acceleration (by decelerating by 10% you mean 10% of the actual speed? then it will never stop).

i assume you mean by 10% of the initial speed. let v0 be the initial speed. since it's a steadily accelerated motion we can use the formula

s = s0 + v0*t + 1/2*a0*t^2

a0 is -v0/10 (i drop the units for now, even though it's not wise to do so in a solution. it would make sense if the factor /10 would have the unit of a time, e.g. s). the sign means antiparallel to the velocity). now we derive the above equation and get

v = v0 + a0*t

which should be zero at the point given, so

0 = v0 + a0*t or t = -v0/a0 = v0/(v0/10) = 10 (note the sign here!)

which we use in our first equation:

s = s0 + 10v0 + 50a0 = s0 + 10v0 - 50*(v0/10) = s0 + 10v0 - 5v0 = s0 + 5v0

now we set s = 1024 (the point it should stop) and we get:

1024 = s0 + 5v0 or s0 = 1024 - 5v0

which is the point we have to start decelerating.

joey.

Re: Math trouble [Re: Joey] #249680
02/03/09 18:05
02/03/09 18:05
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
well our solutions are likely to be correct since they're similar...

Re: Math trouble [Re: mpdeveloper_B] #249682
02/03/09 18:07
02/03/09 18:07
Joined: Nov 2003
Posts: 698
England, UK
A
Aaron_H Offline
User
Aaron_H  Offline
User
A

Joined: Nov 2003
Posts: 698
England, UK
You could use the equation:

x = x0 + ut + (1/2)at^2

To find the answer.
Where x = the final point (1024)
x0 = the point at which the body starts slowing
u = the initial velocity (10)
t = time taken for the deceleration (more on this in a second)
a = acceleration (since this is a deceleration it's negative, -0.1)

To find the time taken for the deceleration you can use:
a = (v-u)/t
Where v = the final velocity (0 when stationary)
and rearrange to t = (v-u)/a, which gives 100, when the values are substituted. (100 = -10/-0.1)

Rearranging the first equation gives:
x0 = x - ut - (1/2)at^2

=> x0 = 1024 - 1000 + 500 = 524

I hope this helps (and that I got it right.. I still didn't quite understand the question).

Re: Math trouble [Re: Joey] #249685
02/03/09 18:09
02/03/09 18:09
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
Ok, ok I see what you're saying Error014. I don't understand even one of those equations ^^ but here's what I have based on what you've said here:

Initial speed is 10 q/s (quants per second)
Deceleration is 10% of the initial speed

the code decelerates like this:

move_speed -= (Initial speed* deceleration percent)*time_step;

So in other words:

move_speed would initially be 10 being decreased by initial speed* deceleration percentage

so the equation there would be:

move_speed -= (10 * 0.1) *time_step;

all I need is to find out at what point it should start decelerating.


- aka Manslayer101
Re: Math trouble [Re: Aaron_H] #249686
02/03/09 18:10
02/03/09 18:10
Joined: Nov 2003
Posts: 698
England, UK
A
Aaron_H Offline
User
Aaron_H  Offline
User
A

Joined: Nov 2003
Posts: 698
England, UK
I see everyone wanted to use subscripts but had to try making the font size smaller.. It took me ages to type because I couldn't get it to look right.. so I gave up. However I hope the answer is correct.

Re: Math trouble [Re: Aaron_H] #249687
02/03/09 18:13
02/03/09 18:13
Joined: Feb 2006
Posts: 2,185
mpdeveloper_B Offline OP
Expert
mpdeveloper_B  Offline OP
Expert

Joined: Feb 2006
Posts: 2,185
sorry, i forgot to mention that time_step is a variable in the equation as well...


- aka Manslayer101
Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1