Applying forces on objects

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Applying forces on objects

Postby misho » Fri Jan 15, 2016 10:32 pm

Is it possible to apply a force on an object at a point other than a geometric centre (or centre of mass), as it seems to be the case? (I'm using version 2.24)

I'd like to apply a thruster force on a spacecraft (actually, 2 thruster forces at opposite ends of the spacecraft) which would result in an attitude change. This would require me to apply it at some distance from it's centre of mass so I can get a torque on one of it's axis and cause it to spin.

I know I can use a force and torque combination (or just a torque) to get the same effect, but I'd like to do this on the simplest level possible.

Thanks,
Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Applying forces on objects

Postby Stucuk » Sat Jan 16, 2016 8:36 am

NewtonBodyAddImpulse will do what you want. You supply it the position as well as the velocity of the force.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: Applying forces on objects

Postby misho » Sat Jan 16, 2016 1:55 pm

Thanks!

unfortunately, not quite what I was hoping for... first, the point has to be in global space, which means that I have to convert from local to global coordinates. Second, same thing for the velocity vector, I have to convert orientation to global space. Finally, it is an impulse, not force. I have to calculate how much velocity I will get given an amount of force applied at a certain point on a certain object with certain weight (moment of inertia).

I would need something similar to NewtonBodyAddTorque. I suppose I could write a function that takes in a force and position and calculates torque on each of the axis...

Thanks,
Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 675
Joined: Tue May 04, 2010 10:13 am

Re: Applying forces on objects

Postby JoeJ » Sat Jan 16, 2016 2:38 pm

Code: Select all
AddGlobalForce (Force, Point)
{
   R = Point - BodyMatrix.Position;
   Torque = CrossProduct (R, Force);
   NewtonAddForce (Force)
   NewtonAddTorque (Torque)
}


AddLocalForce (LocalForce, localPoint)
{
   GlobaForce = BodyMatrixRotate (LocalForce)
   GlobalPoint = BodyMatrixTranform (localPoint)
   AddGlobalForce (GlobaForce, GlobalPoint);
}


misho wrote:I know I can use a force and torque combination (or just a torque) to get the same effect, but I'd like to do this on the simplest level possible.


You talk about that code above and answer your own question.
That's laws of physics and you can't simplify them further :wink:
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron