Q:

Gravity trajectory with already known destination

I have been spending several days trying to solve this problem and I am about to go mad.  Your help would be very much appreciated. 
I am using a 2D stage in libgdx.  I want to move actors (or sprite) to this stage with a "gravity" display effect: for example for actor1, his initial coordinates are (0, 0), destination coordinates would be (100, 50), and I want to move this actor to this destination with a gravity trajectory effect.  Then I want to use the same gravity for actor2 moving from (0, 0) to (25, 75), then actor3 from (0, 0) to (200, 75) etc. 
I managed to apply a gravity trajectory to any actor based on this well known loop:
setX(getX() + velocity.x);
setY(getY() + velocity.y);
velocity.y += getGravity().y * delta;

So tweaking the gravity value would modify the trajectory.  It works fine. 
Now, as I said earlier I want to give every actors a unique trajectory given their predetermined destination. 
So I have tried to find a formula to determine the x and y for each actor at every frame of their trajectory
I am using the following static parameters:
gravity.y : same for all actors
delay : the amount of frames during which each actor moves between his initial coordinates and his destination coordinates.  Same value for all actors too
First I calculate the velocity with this SUPER UGLY formula that I am absolutely not proud of:
velocity = new Vector2 ( (destinationx - b.getX() )/time,  initdisty/time + ( Math.sqrt(delta*1000)*time / ( 500/Math.abs(gravity) ) ));

where delta = Gdx.graphics.getDeltaTime();
Then I apply this velocity each frame to calculate the x and y of each actor:
public void act(float delta){
for (int i=0; i<delay; i++) {
setX(getX() + velocity.x);
setY(getY() + velocity.y);
velocity.y += gravity.y * delta;
}
}

It KIND OF work, but of course, this can not be a long term solid solution.  Calculating the x and y for each frame for each actor (there can be 5-6 actors moving at the same time) doesn't look good at all. 
The main problem is that the trajectories are good on computer with consistent 60FPS, they are okay on a tablet, but on a phone with limited memory and 30 < fps < 60, the trajectories become terribly wrong. 
After reading several blog posts, it seems like I could avoid the multi device memory fps problems by removing the delta parameter from my formulas, but I haven't found how.  And it still doesn't give me a strong long term solution to calculate the trajectory with predetermined destination coordinates. 
Thanks for reading and for your time, please let me know if this is unclear I'll do my best to explain better. 

A:

Cause of the problem
Maintaining both position and velocity leads to discretization of the system resulting in quantization error.  So you will experience inconsistent behavior by your current method when fps fluctuates. 

Solution
All you need is to reduce your number of state variables to only two i.e. don't store current velocity.  It is causing the errors in final position. 
In stead use parametric form of the trajectory. 

v = u + at

and

s = ut + ½at²

Implementation
Suppose you want to go from (sourceX, sourceY) to (targetX, targetY) in time 'totalTime'. 

Calculate initial velocity. 
Vector2 initialVelocity = new Vector2((targetX - sourceX) / totalTime,
            (targetY - sourceY) / totalTime - gravity * totalTime / 2);
float currentTime = 0;

In each iteration, calculate position directly and keep track of currentTime. 
public void act(float delta){
    if (currentTime < totalTime) {
        currentTime += delta;

        setX((initialVelocity.x + gravity.x * currentTime / 2) * currentTime);
        setY((initialVelocity.y + gravity.y * currentTime / 2) * currentTime);
    } else {
        setX(targetX);
        setY(targetY);
    }
}

