Non-instantaneous model of applied force?

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
Aaorris
Messages
2
Reaction score
0
Hey everyone! I'm a recent high school graduate, and I've been trying to model some simple physics with computer code. What's on my mind right now is modeling applied force using keyboard input. The computer knows if a key is down, or not. Applying force based on that input would mean that your applied force is instantaneous! To remedy this, I imagine 2 solutions:
  1. Sin targeting of velocity
  2. Damping force
modeled below is an idea for sin targeting, but damping seems a more usual, less computer intensive method... I just have to think about modeling damping force more...

[thinking out loud]
for damping, F = -cV ?
delta_a = -cV
maybe I've just been thinking too hard. What do you guys think?
[PLAIN]http://popoa.webs.com/appliedForce.jpg
 
Last edited by a moderator:
Physics news on Phys.org
I can't see your picture from here at work, so I have to ask that you be a little more specific with what you are asking. Are you asking how to program a "ramp up" time where the force gradually increases in your program after you press the key? I'm not a programmer at all so I apologize if my terminology isn't correct.
 
Yes, imagine yourself pushing on a wall - you cannot instantly apply all of your force at once, and you also cannot pull away instantly. I just wanted insight into how to model that.

I believe I'll just half-skip this situation by having a linear force increase over a certain amount of time, until the force desired is reached to create smooth force transitions