Solving for the Direction of a Force

  • Thread starter Thread starter Nightshade8
  • Start date Start date
  • Tags Tags
    Direction Force
AI Thread Summary
The discussion focuses on solving a physics problem related to programming a game with telekinesis mechanics in a 2D environment. The main challenge is determining the angle at which an object should accelerate to pass directly through a cursor, considering initial velocity and other forces like gravity. The user has attempted to formulate equations but is struggling with a fourth-degree polynomial that complicates finding a solution. Suggestions include using numerical solvers or math software like Mathematica to handle the complexity of the equations. Overall, the conversation emphasizes the difficulty of solving for the force direction in a dynamic system influenced by multiple variables.
Nightshade8
Messages
2
Reaction score
0
Hello, everyone. I've been working with this physics problem for about a week without much success, and this looked like a good place to get some help.

Here's the issue. I'm programming a game where the main character has the ability to move objects with telekinesis (by applying a constant force). It uses an entirely 2-dimensional physics engine.

However, it would be very difficult to control the objects if they accelerated directly towards the cursor. If the object had an initial velocity before the force was applied, or if there was some other force acting on the object (namely gravity), it would end up arcing around the cursor. I want to develop a system where the object accelerates at a specific angle so that it passes directly through the cursor.

I need a method to solve for the angle the object should accelerate at when under the control of the telekinesis. The magnitude of this force, the angle and magnitude of the object's current velocity, the angle and magnitude of the sum of all other forces, and the horizontal and vertical distances that must be covered are all known constants that would need to be entered into the equation.

You can see my work here (hopefully you can read it):
http://img178.imageshack.us/img178/8269/tempyr6.png
The three circled equations near the bottom are as far as I could go before I got stuck. Even my graphing calculator wasn't able to solve for theta.

Hopefully you understood all that. If you have any suggestions for how to solve this, please tell me. I'm running out of ideas.
 
Last edited by a moderator:
Physics news on Phys.org
This is the approach I would take:

x = 1/2 (Fxo/m + Fx/m) t^2 + vxo t + xo
y = 1/2 (Fyo/m + Fy/m) t^2 + vyo t + yo
Fx^2 + Fy^2 = F^2

where m is the object mass, (x,y) is the cursor location, (Fxo,Fyo) is the sum of all of the other forces, (Fx,Fy) is the telekenisis force, F is the magnitude of the telekenesis force, (vxo,vyo) is the initial velocity, (xo,yo) is the initial position, and t is the time at which the object reaches the cursor. You have three unknowns, Fxo, Fyo, and t, and three equations.
 
That's easier said then done. I've tried using another route to solve this problem, but still ended up getting stuck.

You can see my work here:
http://img2.freeimagehosting.net/uploads/1823d86e2d.png
 
Last edited by a moderator:
I have an idea, but it involves bisection or some other way of solving a 4-th degree polynomial equation (of a single variable).

1. Write the distance between object and goal s(t) as a function of time, if you chose to
apply no force (except natural forces).

2. The area your object can reach is the circle with radious a*t*t/2 around the point where object would be without artificial force. This means that the shortest time t when your object can reach it's aim is the time when that circle touches aimed point. The equation for t is:

s(t)=a*t*t/2

This equation is polynomial, 4-th degree. I read formula exists, but it is ugly. But you can
use bisection, since
s(t)>a*t*t/2 for too large t
s(t)<a*t*t/2 for too small t

After you find the right t, direction of force is simply the direction between point where object would be (at time t) without force and the aimed point.
 
Yes, this is much easier said than done. As Lojzek mentioned the system that you are trying to solve is 4-th order. I would not even attempt its solution by hand. You should either use a math package like Mathematica or you should use a numerical solver.

Just for grins I plugged the system into Mathematica, it came up with 4 roots, each of which was hundreds of pages long.
 
Hello! Let's say I have a cavity resonant at 10 GHz with a Q factor of 1000. Given the Lorentzian shape of the cavity, I can also drive the cavity at, say 100 MHz. Of course the response will be very very weak, but non-zero given that the Loretzian shape never really reaches zero. I am trying to understand how are the magnetic and electric field distributions of the field at 100 MHz relative to the ones at 10 GHz? In particular, if inside the cavity I have some structure, such as 2 plates...
Back
Top