Good evening,
I've been trying to wrap my head around this problem for some time and I just can't seem to get it straight.
What I am trying to achieve:
I want to program a recursive model that calculates the position of a moving body in a fluid after a certain time.
What i have done already
I got as far as to simulate the movement due to a force applied at the center of the object.
In pseudo-code
for the speed at t = n
//calculate the drag force due to vn-1 Wikipedia reference
Fd = 0.5*ρ*vn-12*Cd*A //
// add any external force that may have been applied when n-1<=t<n and the gravitational force
Ftot= Fd+Fext+Fg
// calculate the acceleration of the object at n
an=Ftot/m
// assume the acceleration constant for dt so the velocity becomes
v = vn-1 + an*dt
// calculate the new coordinates of the object based on vn
This works fine as long as the time step dt is small enough (0<dt<0.00001)
The amount of calculations is too high. So i decided to approximate some more by limiting the rate of change of the drag force Fd.est = MAX(const,Fd)
This leads to a decent approximation with about a factor 100 less calculations per second (0<dt<0.001), which i think is sufficient. I observed a 10% disparity between the original and the approximation after 10^7 iterations.
What i'm struggling with
1) I'm stumped on how to model the angular motion when a force is applied a distance d from the center of the object
2) Is there a way to make the approximate the whole model more precisely but with the same dt = 0.001
If anyone has tips on how I can improve I would greatly appreciate it.
MrsTMouse
I've been trying to wrap my head around this problem for some time and I just can't seem to get it straight.
What I am trying to achieve:
I want to program a recursive model that calculates the position of a moving body in a fluid after a certain time.
What i have done already
I got as far as to simulate the movement due to a force applied at the center of the object.
In pseudo-code
Spoiler
for the speed at t = n
//calculate the drag force due to vn-1 Wikipedia reference
Fd = 0.5*ρ*vn-12*Cd*A //
// add any external force that may have been applied when n-1<=t<n and the gravitational force
Ftot= Fd+Fext+Fg
// calculate the acceleration of the object at n
an=Ftot/m
// assume the acceleration constant for dt so the velocity becomes
v = vn-1 + an*dt
// calculate the new coordinates of the object based on vn
This works fine as long as the time step dt is small enough (0<dt<0.00001)
The amount of calculations is too high. So i decided to approximate some more by limiting the rate of change of the drag force Fd.est = MAX(const,Fd)
This leads to a decent approximation with about a factor 100 less calculations per second (0<dt<0.001), which i think is sufficient. I observed a 10% disparity between the original and the approximation after 10^7 iterations.
What i'm struggling with
1) I'm stumped on how to model the angular motion when a force is applied a distance d from the center of the object
2) Is there a way to make the approximate the whole model more precisely but with the same dt = 0.001
If anyone has tips on how I can improve I would greatly appreciate it.
MrsTMouse
via Physics Forums RSS Feed http://www.physicsforums.com/showthread.php?t=703727&goto=newpost
0 commentaires:
Enregistrer un commentaire