- #1
Shintao
- 3
- 0
I need some help with time dependent equations. I have two electrically charged particles in space that are at large distances. How would I write a time dependent equation to simulate there positions at give times. I know there initial positions and there initial velocities. And for simplicity one object is unmovable. This is what I have:
[tex]f = \frac{kq_{1}q_{2}}{r^2}[/tex]
[tex]a = \frac{f}{m}[/tex]
[tex]x = x_{0} + v_{0}t + \frac{at^2}{2}[/tex]
But, the force between the two objects is non-constant because as they get closer to each other force increases rapidly. So do I use the yank instead of force. But, that creates the problem of making the equation distance dependent. I don't need the force at given distances. I need the force a given times based on distances.
for those that know C++:
f = cos(atan2(particle2.y - particle1.y, particle2.x - particle1.x)) * COULOMB_CONSTANT * -particle2.charge * particle1.charge / (_hypot(particle2.y - particle1.y, particle2.x - particle1.x));
a = f / particle1.mass;
x = particle1.initial_x + particle1.initial_velocity.x * time + a * pow(time, 2) / 2;
It seems to me that the force should be time dependent because the distance between the two particles is time dependent. I need some calculus help. I think?
[tex]f = \frac{kq_{1}q_{2}}{r^2}[/tex]
[tex]a = \frac{f}{m}[/tex]
[tex]x = x_{0} + v_{0}t + \frac{at^2}{2}[/tex]
But, the force between the two objects is non-constant because as they get closer to each other force increases rapidly. So do I use the yank instead of force. But, that creates the problem of making the equation distance dependent. I don't need the force at given distances. I need the force a given times based on distances.
for those that know C++:
f = cos(atan2(particle2.y - particle1.y, particle2.x - particle1.x)) * COULOMB_CONSTANT * -particle2.charge * particle1.charge / (_hypot(particle2.y - particle1.y, particle2.x - particle1.x));
a = f / particle1.mass;
x = particle1.initial_x + particle1.initial_velocity.x * time + a * pow(time, 2) / 2;
It seems to me that the force should be time dependent because the distance between the two particles is time dependent. I need some calculus help. I think?