Keep It Simple, Stupid | |
PerlMonks |
Re^10: [OT] Forces.by bitingduck (Chaplain) |
on Feb 16, 2016 at 05:40 UTC ( [id://1155326]=note: print w/replies, xml ) | Need Help?? |
Unless it's already in motion, which it will be if the F_perp is non-zero at some prior time and you haven't by luck gotten to a spot where v=0 and a=0 at the same time.
You need to clarify exactly what you're trying to solve for At first it sounded like you were looking for the static solution where the forces all add up to zero. If that's the goal, then you can calculate F vs. theta at small intervals all the way around the circle and then pick (or interpolate) the solution where F_perp=0. You can ignore F_parallel-- it will always be balanced by the stiffness of the material (until you break it). If you pick small enough intervals, you shouldn't have to worry about pathological cases of interpolating magnetic fields. They can do goofy things on you, but that will show up as big variations over a small angle in the area you're interpolating. If it's smooth around that region, it's fair to assume it's smooth in the interpolated region. If you're trying to solve for the dynamic motion of the system by running a static force solver in a loop and integrating (what I described above), then you can write the loop, have it call the magnetic force solver at the prescribed place, decompose it into F_perp and F_parallel, and integrate. If the linkage is already in motion at the point where F_perp=0, then it will drift through that point and start experiencing forces again at some other location. The only time you'll get zero motion is if you get to a time & position where v=0 and F=0. The loop I gave you won't give you a random adjustment at a place where F_perp=0. It will adjust it by the velocity at that time. As I write this, the heart of the matter seems to be initial conditions-- if you're going to integrate force over time to get position (a perfectly valid thing to do that I do on a regular basis), you have to have some initial position and velocity (zero is a valid choice for both). If you do one time integral of acceleration you get a constant left over, which is the initial velocity. If you do a second time integral, you get another constant, which is the intial position. You haven't been given them, but you have to pick something or you can't do the dynamic solution. The problem itself is pretty straighforward: you're trying to solve the motion of a rotating system with one degree of freedom (the angle theta), and a variable force (F_perp(theta)), and you're using an external system to calculate the force F(x,y) that you have to convert into F_perp(theta), which I did in my first post. You can ignore everything else, as long as there are no torques on the disk. EDIT: Here's a revised version of the code that explicitly includes the time interval
I also swapped the order of the position and time calculation, so that it's using the current velocity v(t_now) to get theta(t_now+dt)=t_now+dt instead of using the velocity(t_now+dt), which shouldn't make much difference if things aren't changing much with position
In Section
Seekers of Perl Wisdom
|
|