in reply to Re^6: [OT] Forces.
in thread [OT] Forces.

All you're trying to do is numerically integrate the accelerations over time to get the new position at any given time.

Okay. Accept by setting mass = 1 (or any other constant), were effectively ignoring the mass; so any "position" derived is at the very best scaled incorrectly. Presumably, the undeclared, set or explained $scale in your pseudo-code is there to account for that.

So effectively, $v becomes a running accumulation of the consecutive instantaneous force vectors (minus their direction?) scaled by some arbitrary constant. The direction could be retrieved/retained by storing tan-1( Fy / Fx )

But, F(N) = m(kg) * a(ms-2). Set m = 1, and F(N) = a(ms-2). I'm given F, I want metres, so rearranging m = N * s-2. I have N, but no s. s is undefined and undefinable. If the mechanism is rotating slowly, the time taken to traverse an input step of 1 degree will be longer than if it is running quickly. Perhaps orders of magnitude: 1 rpm versus 1000 rpm.

And if we set the time to some arbitrary constant, then we are equating distance moved with force acting: m = N. If the mechanism was a simple rotation around a single axis, we might get away with that. (And I'm unconvinced of even that.)

But as the force we have is acting in a semi-radial direction on a compound (cam) linkage, the force will act for some unspecified time period to 'straighten' the link, at which point it reaches a form of equilibrium. But achieving that position will only require some subset of the force acting. At that point, the rest of the force will simply be expended trying to stretch the link. And as far as I can tell, there is no way to decide what proportion of the force did work, and what was expended in futility.

Since my steps are (can only be) (angular) distance traveled -- and that's what I'm trying to determine -- the next input position is defined as the position resulting from the last integration. The best I can do to achieve my desired "at least 1 simulation for every degree of rotation", is: if the result of a step is substantially greater than one degree, divide the angles I used to establish the position I fed into that step, by 2 or 3 or whatever is appropriate, and re-run the model to obtain the intermediate positions.

But that accumulation of intermediate steps will almost certainly result in a different final position, as the forces acting through a degree of movement are definitely non linear.

For example, let's assume that the general direction of the preponderance of forces acting is fixed. (They aren't, but bear with me.) And for simplicity, let's assume that direction is the opposite direction of the green force line shown in my diagram. And the X/Y force values I get are Fx = 200, Fy = 3.

In the first step, the vast majority of that X component will be expended in trying to compress the link A-B. And only the small Y component will cause A to rotate about B, some small amount.

In the next step, the small movement that resulted from the previous step means that the leverage has changed, and the same forces acting will have a bigger effect. Ditto the next step, and the step after that, until eventually, A has rotated far enough around B that A-B is aligned with the resultant force vector. At that point, if the forces acting don't vary, no further rotation would be possible.

My point is, I cannot see how directly equating distance with force can possibly result in anything useful?

Please, I'm an engineer who does a little math. If I missing the purity of the math you are suggesting, (and simply muddying it with all my talk of physical units and motions, I'm sorry :) but since any determination of work done derive from F = ma inevitably requires a known time delta, and there is simply no way to derive one from a static model.

Nor do I see it possible to assume one or allocate one arbitrarily.

Also, and perhaps more importantly, F = ma requires that all forces (and masses and accelerations) are taken into account; but, by Newton's 3rd, the reaction force from the solid, fixed and immovable B is unaccountable in the above.

Update:BTW, don't you just love the way a-holes downvote what they don't understand. Amuses me no end :)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^8: [OT] Forces.
by bitingduck (Deacon) on Feb 16, 2016 at 04:48 UTC

    Also, at worst you're only off by the mass scaling factor-- you can solve the whole problem as described and the only thing that changes with mass is the speed. Each loop iteration is a time interval, also with some unit that you can select later, where you can rescale the whole problem by the mass and time units. Dimensionally what I've shown is correct, and since you don't actually have a mass or specified time, you can rescale by both later.

    The only force component that matters to producing motion is the one that I've called F_perp. The loop is a numerical integration over time to get the position and velocity, where we're using arbitrary time units (which is perfectly acceptable as long as they're consistent). You could explicitly put in a "dt" each iteration, but you can scale by that at any time.

    There's nothing philosophical about it--I'm just leaving out the things that don't matter. If there are no torques on the disk/cylinder, then conservation of angular momentum means it will maintain its orientation as it goes round, so that's a distraction. As are forces that put tension or compression on the linkage, but don't produce motion unless you want to include the real properties of materials and then you're talking full up FEM and you might as well just have somebody draw it in SolidWorks and mesh it up to see the tiny deformations (unless you choose silly putty as the material, in which case they'll be huge).

    This problem is much closer to my day job than coding in Perl is.

    Edits to add more explanation:

    I'm not equating a force to a distance-- we're integrating up the acceleration over time. F= ma (units mass*length/time^2). If I divide out the mass (in arbitrary units, where the mass involved =1 unit, then I have a= magnitude(F) with units of (length/time^2). If I calculate the forces on the disk at some time t, then multiply by some small dt (which is buried in the mass scaling factor, so I cheated a little there), then I get a new velocity at time t+dt=v+a*dt, and a new position that's x=x+v*dt. I buried the dt by suggesting that you just keep shrinking the scale til the motions of the linkage on any iteration are small, but you could put it in explicitly for convenience.

    Another edit...

    since any determination of work done derive from F = ma inevitably requires a known time delta, and there is simply no way to derive one from a static model.

    You don't have to ask the static model for a time delta. You pick a time delta small enough that if you calculate the velocity and acceleration (from the net force produced by the static model) at any time t and multiply it by the interval you're choosing, you get a new position and velocity that aren't very different from the previous ones. That's how numerical integration works. As the time delta gets smaller and smaller, you get something closer to what you'd get from an analytical solution.

      You are modifying theta by your derived v, but if the force calculated directly opposes or aligns with the current position of link A-B, NO MOVEMENT WOULD RESULT, but your calculation would adjust theta by an effectively random amount.

      Simply stated, that cannot be correct; nor even an approximation to correct.

        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

        $m_inverse=1 /* this could be chosen as arbitrarily small, like 0.000 +01 to get effectively smaller time steps) */ $v=0 $theta=0 $dt=1 /* the time interval, you can also make this of arbitrary size +*/ while(!$done){ ($F_x,$F_y)=ForceCalculator($theta) /* call your magnetics librar +y */ $F_perp=$F_x*sin(theta)+$F_y*cos($theta) $theta=$theta+$v*$dt $v=$v+$F_perp*$scale*dt }

        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