# Newton's law...

###
#1
Members - Reputation: **180**

Posted 04 October 2001 - 06:43 PM

###
#2
Members - Reputation: **122**

Posted 05 October 2001 - 12:32 AM

---\

---o===

---|

---|

downwards you have gravity time weight of the object. left you have the direction created by the slope and the 3rd line in the opposing force to the other to items which include friction and air resistance. most people don't include air resistance. hope this help . my diagram isn't appearing as it should .

Edited by - R3sistance on October 5, 2001 7:41:32 AM

###
#3
Members - Reputation: **102**

Posted 05 October 2001 - 06:14 AM

###
#4
Members - Reputation: **122**

Posted 05 October 2001 - 06:35 AM

You know that the box will either remain stationary or accelerate down the slope. This is because the normal reaction will always equal whatever force the box applies perpendicular to the slope.

So it will not acceleration to, or from the slope, as there is no net force. It may accelerate down the slope however, if there is a net force down the slope.

Let''s define some things we will need:

m = mass of box (kg)

g = gravitational field strength (9.81 N/kg)

a = angle of the slope

u = coefficient of friction

F = the frictional force (acts in the opposite direction to motion)

N = the normal reaction (equal and oppsite to the force applied by the box perpendicular to the slope)

Ok, you know that ''net force = mass * acceleration.'' (for a constant mass).

We know the force, we know the mass, we want the acceleration.

Let''s first compute the net force. We will resolve down the slope so we will get an acceleration to apply down the slope (signs will therefore not become a problem).

Ok, you should know that the frictional force is given by the coefficient of friction multiplied by the normal reaction, in the direction opposing motion.

F = uN, where 0 <= u <= 1.

The force down the slope due to the weight of the box is m*g*sin(a). The normal reaction is given by m*g*cos(a). However, it has no effect when resolving perpendicular to it, which we are. What it does affect is the frictional force, which is uN. Hence the frictional force is u*(m*g*cos(a)).

So, net force down the slope = m*g*sin(a)-u*m*g*cos(a).

i.e. net force down the sope = m*g(sin(a) - u*cos(a)).

We know to produce acceleration we divide by mass, m.

So acceleration *down* the *slope* = g(sin(a) - u*cos(a)).

This may or may not be immediately applicable to your box and slope world. This is the magnitude of an acceleration vector, the direction of which will be equivalent to the slope. I''ll assume you know how to split up the magnitude into its i and j components given its direction. You can then move the box in its 2d plane. But I''ve no idea how your simulation works.

There''s the physics though. If you need more help, ask again.

r.

"The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."

###
#7
Members - Reputation: **180**

Posted 05 October 2001 - 10:31 AM

PS: I am doing this without friction;

#define PI 3.141516

int controlador;

int modo;

float i = 0.0f;

int angle = 90 - 45;

float mass = 2000.0f;

float gravity = 9.8f;

float velx = 0.0f;

float vely = 0.0f;

float accelx = 0.0f;

float accely = 0.0f;

float xpos = 10.0f;

float ypos = 110.0f;

float Fx = 0.0f;

float Fy = 0.0f;

float weight = 0.0f;

void main()

{

controlador = DETECT;

modo = DETECT;

initgraph(&controlador, &modo, "");

setfillstyle(1,BLACK);

bar(0,0,640,480);

// Draw terrain

setcolor(2);

line(10, 110, 310, 410);

//

// Draw ball

setcolor(1);

circle((int)(xpos), (int)(ypos), 10);

//

// wait a key to begin sim

getch();

//

// Compute Forces

weight = mass * gravity;

Fx = weight * sin((float)(angle)*PI/180.0f);

Fy = weight * cos((float)(angle)*PI/180.0f);

for (; i < 30; i+=0.1f)

{

//

// Compute ball accel

accelx = Fx / mass;

accely = Fy / mass;

//

// Compute velocity

velx = velx + accelx * i;

vely = vely + accely * i;

//

// Update ball''s pos

xpos = xpos + velx * i;

ypos = ypos + vely * i;

//

// Draw objects

setcolor(2);

line(10, 110, 310, 410);

setcolor(1);

circle((int)(xpos), (int)(ypos), 10);

delay(50);

if (kbhit())

break;

}

getch();

closegraph();

}

PS: I am using Turbo C++.

Thanks!

###
#8
Members - Reputation: **122**

Posted 07 October 2001 - 09:07 AM

#include

float t, Fg, F, a, v, s, x, y, m; // time, gravity force, force, acceleration, speed, position, coordinates and mass

float dt, dv, ds, dx, dy; // the d should be a greek delta here, but these variables represent delta-time, delta-velocity, delta-space, delta-x and and delta-y

const float angle = 50.0 * M_PI / 180.0; // horizontal = 0°, convert degrees to radians

const float m = 20.0; // mass in kgs

t = 0.0;

a = 0.0;

v = 0.0;

s = 0.0;

x = 0.0;

y = 10.0; // start at 10 meters

dt = 0.1; // you could change dt in 1 / 30 at a 30 fps framerate for example. Smaller numbers make it more accurate

while(1)

{

// increment the time.

t = t + dt;

// calculate the forces on the box. I am using a somewhat different approach then Fresh (this one''s easier), but I think it''s a valid way to solve this problem... correct me if it is not or if I''m forgetting anything

Fz = 9.81 * m;

// calculate the force down the slope, by splitting up Fz in components of which one heads in the same direction as the slope does

F = cos(angle) * Fz;

// here you could subtract are resistance, but in most cases this is not really important. It becomes important at speeds above approximately 40 m/s.

F = F - 0.0;

// calculate the acceleration, F = m . a

a = F / m;

// now the acceleration has been calculated calculate speed and position

dv = dt * a;

v = v + dv;

ds = dt * v;

s = s + ds;

// split up the delta-distance vector (direction angle), and calculate the real (onscreen) position

dx = cos(angle) * ds;

dy = sin(angle) * ds;

x = x + dx;

y = y + dy;

// use the variables, draw something, etc.

}

Here you go. As you can see, it´s an infinite slope, but changing that shouldn´t be difficult. Probably there are some syntax errors, but I think this code is useable. Good luck!

Nick

###
#13
Members - Reputation: **122**

Posted 08 October 2001 - 09:45 PM

The gravity constant(on earth) is not 9.81 m/s^2

It should be g = 9.82 m/s^2

=)

EDIT: Though one Newton is allway one newton, not depending on planet/gravity. It is a measure of force. Thus the force i.g. may vary depending on the gravity of the location.

Edited by - E-we on October 9, 2001 4:47:58 AM

###
#14
Members - Reputation: **1377**

Posted 09 October 2001 - 03:17 AM

quote:Original post by E-we

I just can''t let this slip by unnoticed

The gravity constant(on earth) is not 9.81 m/s^2

It should be g = 9.82 m/s^2

=)

If you want to get

**picky**about things, , then you should consider that gravitational acceleration is

**NOT**9.81 or 9.82 m/s

^{2}! It depends on where you are and both of those values are valid somewhere. At the equator, it is roughly 9.78 m/s

^{2}, while at the poles it is roughly 9.83 m/s

^{2}. Check out this reference page on the web site for NASA''s Goddard Space Flight Center:

http://helios.gsfc.nasa.gov/qa_earth.html#earth

But I admire your mind for perfection, which reminds me of myself, .

Graham Rhodes

Senior Scientist

Applied Research Associates, Inc.

###
#15
Members - Reputation: **122**

Posted 09 October 2001 - 07:47 AM

quote:Original post by grhodes_at_work

If you want to getpickyabout things, , then you should consider that gravitational acceleration isNOT9.81 or 9.82 m/s^{2}! It depends on where you are and both of those values are valid somewhere. At the equator, it is roughly 9.78 m/s^{2}, while at the poles it is roughly 9.83 m/s^{2}. Check out this reference page on the web site for NASA''s Goddard Space Flight Center:

http://helios.gsfc.nasa.gov/qa_earth.html#earth

But I admire your mind for perfection, which reminds me of myself, .

Yeah if you want your box to be sliding realistically you should use Fz = G * (m*M)/r

^{2}where G = 6.6726*10

^{-11}Nm

^{2}kg

^{-2}, m is your box''s mass in kg, M is the mass of the Earth (5.976*10

^{24}kg), and r is the distance from your cube to the Earth''s center of mass in m.

Also, you should model box-air and box-slope frictional forces for total accuracy. And of course all the forces that I forgot to mention.

LOL

###
#16
Anonymous Poster_Anonymous Poster_*
Guests - Reputation:

Posted 09 October 2001 - 07:51 AM

quote:Original post by Scarab0

[quote]Original post by grhodes_at_work

If you want to getpickyabout things, , then you should consider that gravitational acceleration isNOT9.81 or 9.82 m/s^{2}! It depends on where you are and both of those values are valid somewhere. At the equator, it is roughly 9.78 m/s^{2}, while at the poles it is roughly 9.83 m/s^{2}. Check out this reference page on the web site for NASA''s Goddard Space Flight Center:

http://helios.gsfc.nasa.gov/qa_earth.html#earth

But I admire your mind for perfection, which reminds me of myself, .

Yeah if you want your box to be sliding realistically you should use Fz = G * (m*M)/r

^{2}where G = 6.6726*10

^{-11}Nm

^{2}kg

^{-2}, m is your box''s mass in kg, M is the mass of the Earth (5.976*10

^{24}kg), and r is the distance from your cube to the Earth''s center of mass in m.

Also, you should model box-air and box-slope frictional forces for total accuracy. And of course all the forces that I forgot to mention.

LOL

And you''d have to include some trig there, since the center of mass of the earth is not necessarily aligned with your Z axis.

###
#17
Anonymous Poster_Anonymous Poster_*
Guests - Reputation:

Posted 09 October 2001 - 07:51 AM

quote:Original post by Scarab0

[quote]Original post by grhodes_at_work

If you want to getpickyabout things, , then you should consider that gravitational acceleration isNOT9.81 or 9.82 m/s^{2}! It depends on where you are and both of those values are valid somewhere. At the equator, it is roughly 9.78 m/s^{2}, while at the poles it is roughly 9.83 m/s^{2}. Check out this reference page on the web site for NASA''s Goddard Space Flight Center:

http://helios.gsfc.nasa.gov/qa_earth.html#earth

But I admire your mind for perfection, which reminds me of myself, .

Yeah if you want your box to be sliding realistically you should use Fz = G * (m*M)/r

^{2}where G = 6.6726*10

^{-11}Nm

^{2}kg

^{-2}, m is your box''s mass in kg, M is the mass of the Earth (5.976*10

^{24}kg), and r is the distance from your cube to the Earth''s center of mass in m.

Also, you should model box-air and box-slope frictional forces for total accuracy. And of course all the forces that I forgot to mention.

LOL

And you''d have to include some trig there, since the vector to the center of mass of the earth is not necessarily aligned with your Z axis.

###
#19
Moderators - Reputation: **1640**

Posted 09 October 2001 - 07:20 PM

quote:

quote:

--------------------------------------------------------------------------------

Original post by Anonymous Poster

And you''d have to include some trig there, since the vector to the center of mass of the earth is not necessarily aligned with your Z axis.

--------------------------------------------------------------------------------

It''s not???

Though close, the Earth is not a perfect sphere - particularily if you''re hanging side-ways off a mountain.

9.81-9.83, I never knew g varied that much across the globle...

Magmai Kai Holmlor

- Not For Rent