# Box sliding down multiple ramps

• clamport
In summary: This term is then added to the equations of motion for the next ramp. In summary, the problem relates to a box sliding down multiple ramps and the difficulty in transitioning between them due to the initial velocity.
clamport
Hey all,
I was wondering about a box that is sliding down what is basically a half pipe. There are 3 ramps, and I can get the correct sliding on the first ramp, but I can't figure out how to make it move to the next ramp. I am posting my physics code if anyone is interested...
Code:
        public override void Update(GameTime gameTime)
{
Console.WriteLine("-- In Physics.Update() Theta is " + theta);
double Fnet_Magnitude = Net_Force();
Vector3 Fnet = new Vector3();

if (theta > 0)
{// Downhill left side
Console.WriteLine("Theta is greater than zero");
Fnet.X = (float)(-Fnet_Magnitude * Math.Cos(           theta   ) );
Fnet.Y = (float)(-Fnet_Magnitude * Math.Sin( Math.Abs( theta ) ) );
}
else if (theta < 0)
{// Uphill right
Console.WriteLine("Theta is less than zero");
Fnet.X = (float)( Fnet_Magnitude * Math.Cos(           theta   ) );
Fnet.Y = (float)(-Fnet_Magnitude * Math.Sin( Math.Abs( theta ) ) );
}
else
{
Console.WriteLine("-In else statement");
}
Euler_Update(Fnet);

// So... notes
// Next X
// X(i+1) = X(i) + delta(t)*Vx
//
// Next Y
// Y(i+1) = Y(i) + delta(t)*Vy
//
// Vx(i+1) = Vx(i+1) + delta(t)(Fx/m)
//
// Vy(i+1) = Vy(i+1) + delta(t)(Fy/m)

base.Update(gameTime);
}

private void Euler_Update( Vector3 Fnet_Force )
{
//previous_position = position;
//previous_velocity = velocity;

position = position + timestep * velocity;
velocity = velocity + timestep * ( Fnet_Force / (float)mass );
}

private bool Sliding()
{
//return (__mu_static > __mu_dynamic);
return true;
}

// Ft is tangential force
// Fn is normal force
// Fg is gravitational force
private double Net_Force()
{
double Fn = mass * gravity * Math.Cos(           theta   );
double Ft = mass * gravity * Math.Sin( Math.Abs( theta ) );

//double mu = (Sliding()) ? mu_dynamic : mu_static;
double mu = mu_dynamic;

return Ft - mu * Fn;
}

Now, for some reason when I update theta the box continues to slide down the previous ramp. So my question is, how do I take that previous velocity and apply it to the new ramp?

Sorry about my confusing topic, I am not a very good math guy...
Thanks!
Chris

You simply have to set up the equations of motion with a starting velocity, which is a constant additive term.

## 1. How does the angle of the ramps affect the speed of the box?

The angle of the ramps affects the speed of the box by determining the amount of gravitational force acting on the box. The steeper the angle, the greater the force and therefore the faster the box will slide down the ramps.

## 2. Is friction a factor in the box sliding down multiple ramps?

Yes, friction is a factor in the box sliding down multiple ramps. Friction is a force that opposes motion and it will act on the box as it slides down the ramps, slowing its speed.

## 3. What is the relationship between the height of the ramps and the distance the box will travel?

The height of the ramps and the distance the box will travel are directly proportional. This means that as the height of the ramps increases, the distance the box will travel also increases.

## 4. Can the weight of the box affect its speed on different ramps?

Yes, the weight of the box can affect its speed on different ramps. The heavier the box, the more gravitational force it will have and therefore it will slide down the ramps faster.

## 5. How does the surface of the ramps affect the movement of the box?

The surface of the ramps can affect the movement of the box in several ways. A smooth surface will result in less friction and therefore the box will slide faster, while a rough surface will increase friction and slow down the box. Additionally, if the surface is uneven or bumpy, it can cause the box to veer off course or even stop altogether.

Replies
3
Views
2K
Replies
5
Views
2K
Replies
3
Views
2K
Replies
8
Views
2K
Replies
3
Views
2K
Replies
4
Views
7K
Replies
4
Views
7K
Replies
2
Views
1K
Replies
5
Views
41K
Replies
4
Views
2K