Uniform Acceleration and Deceleration for Smooth Movement to (0,0,0)?

In summary: But realistically it will have some jaggedness/error because the calculations take time. The goal is to get it as close to 0 as possible, but realistically it will never quite reach it. Ideally the velocity-time graph would be...smooth. But realistically it will have some jaggedness/error because the calculations take time. The goal is to get it as close to 0 as possible, but realistically it will never quite reach it.
  • #1
Morcam
4
0
Hey there! I'm working on a bit of a game modification, and I'm looking for a little help with some physics-related math. I'm only in my second year of high-school physics, so I'm not completely sure where to go with this question. And sorry if this is in the wrong forum.

Essentially, I'm trying to rotate an object to how the player is looking. To achieve this, I was originally doing a little bit of math to find the angular difference, and just using a damped spring equation to rotate the object back to how I want it fairly smoothly. Quite simple. The only problem with this is that it steadily slows down as it approaches the angle (0,0,0), never quite stopping or reaching the angle, which makes sense for this equation.

Unfortunately, I'd like the object to uniformly accelerate and uniformly decelerate back to (0,0,0). Differing acceleration and deceleration speeds are necessary, as well as a top speed. Since this is a computer, I can only run so many calculations per second, and I can ignore drag and gravity if I so choose. The player may also choose to change the direction in the middle of the trip back to zero, which would, of course, be necessary to take into account. I realize this may seem a bit demanding, but it's really what's necessary to solve this.

The actual game-use of this is to turn an aircraft to where the player is looking. The turning of their view in conjunction with this is already compensated for. However, I'm sure I'll find some other uses for this in the future, so it's quite beneficial.

A real-world analogy of this would be having a car, say, 50 meters away from a line, which can accelerate and decelerate at certain speeds, and having the car evenly accelerate to a point, then decelerate from that point to a full stop. The line may move mid-trip, which would have to be taken into account, and only so many calculations (say 10) can be done per second.

Logically, this should seem easier, but I'm honestly at a bit of a loss as to what equations I should use for this. If this is an impossibility for me/out of my scope, I can always go back to my simpler equations, but I would very much prefer a better solution. I've been looking for a solution to this for a couple weeks now, and I haven't been able to find anything. It's really been quite a learning experience, that's for sure, but I'd like to finally put this problem away. Any help would be very much appreciated.
 
Physics news on Phys.org
  • #2
Morcam said:
A real-world analogy of this would be having a car, say, 50 meters away from a line, which can accelerate and decelerate at certain speeds, and having the car evenly accelerate to a point, then decelerate from that point to a full stop.
I don't really understand your question, especially the use of vector notation to describe an angle. However, the equation for uniform acceleration is:
[tex]x(t) = \frac{1}{2}a t^2 + v_0 t + x_0[/tex]
where [itex]x_0[/itex] is the initial position, [itex]v_0[/itex] is the initial velocity, and [itex]a[/itex] is the acceleration. Since you want uniform acceleration followed by uniform deceleration you will have to use this equation twice, once for the acceleration stage and once for the deceleration stage. You will need to make sure that the position and velocity of the two stages are equal at the time that you switch between them.
 
  • #3
DaleSpam said:
I don't really understand your question, especially the use of vector notation to describe an angle. However, the equation for uniform acceleration is:
[tex]x(t) = \frac{1}{2}a t^2 + v_0 t + x_0[/tex]
where [itex]x_0[/itex] is the initial position, [itex]v_0[/itex] is the initial velocity, and [itex]a[/itex] is the acceleration. Since you want uniform acceleration followed by uniform deceleration you will have to use this equation twice, once for the acceleration stage and once for the deceleration stage. You will need to make sure that the position and velocity of the two stages are equal at the time that you switch between them.

Feel free to completely ignore that it is an angle and treat it completely like a vector. That's why I put in the real-world comparison. There isn't a difference in this scenario. And I was originally going to do that solution, but would that not require me to do a pair of square roots? I was trying to avoid square roots, if possible. I'm also not sure if the delta time is going to be completely stable, which could mess that up when it reaches zero. Because of the wait time in calculations, you would overshoot, then overshoot back, and would just jitter there, trying to reach zero. I'm probably not explaining this very well.

Ideally the velocity-time graph would be a simple upside-down V. This would mean locating the peak of the graph would be easy. However, even if I know where it is, if it doesn't line up with the calculation times (picture a bunch of vertical lines on the graph), then I would not be able to apply the correct deceleration force at the correct time. I could theoretically get past this by predicting the acceleration/deceleration in that time period and adding them, but once I reach zero, I think this method would break down. If the deltatime (time between calculations) is inconsistent, then I believe it is impossible. Ideally, there would be a simple method to bypass this (such as the damped spring equation), but I'm not entirely sure that there is. And if there is, I'm not sure if it lies entirely in the realm of physics.
 
Last edited:

Related to Uniform Acceleration and Deceleration for Smooth Movement to (0,0,0)?

1) What is "Smooth Movement to (0,0,0)?"

"Smooth Movement to (0,0,0)" refers to a process in which an object or entity is moved from its current position to the point (0,0,0) on a coordinate system in a fluid and seamless manner.

2) Why is it important to achieve smooth movement to (0,0,0)?

Achieving smooth movement to (0,0,0) is important in many scientific fields, such as robotics and computer graphics, as it allows for precise control and positioning of objects. It also helps to improve the overall efficiency and accuracy of tasks.

3) What factors affect smooth movement to (0,0,0)?

There are several factors that can affect smooth movement to (0,0,0), such as the type of movement (linear or rotational), the weight and shape of the object, the surface it is moving on, and the force or energy being applied.

4) How can smooth movement to (0,0,0) be achieved?

To achieve smooth movement to (0,0,0), precise calculations and control of forces and energy are necessary. This can be achieved through advanced algorithms and technologies, such as servo motors and sensors, that allow for precise and continuous adjustments during movement.

5) What are some real-world applications of smooth movement to (0,0,0)?

Smooth movement to (0,0,0) has various real-world applications, such as in the robotics industry for precise positioning and control of robotic arms, in animation and virtual reality for realistic movements of characters and objects, and in navigation systems for accurate tracking and positioning of vehicles and devices.

Similar threads

Replies
23
Views
2K
Replies
2
Views
10K
Replies
6
Views
2K
Replies
1
Views
1K
  • Other Physics Topics
Replies
5
Views
1K
  • Introductory Physics Homework Help
2
Replies
55
Views
836
  • Special and General Relativity
Replies
13
Views
2K
Replies
35
Views
2K
  • Other Physics Topics
Replies
6
Views
943
  • Introductory Physics Homework Help
Replies
8
Views
2K
Back
Top