dzimmer / PlanarMechanics

A free Modelica library for planar mechanical multi-body systems
BSD 3-Clause "New" or "Revised" License
29 stars 23 forks source link

Damping force has incorrect dependency #183

Closed vengelson closed 1 year ago

vengelson commented 1 year ago

SpringDamper between frames A and B in Planar library is actually a combination of two springs AC(x direction) and CB(y direction). Two nonzero damping forces are created when |AB| remains constant but |AC| and |CB| change. Typically, this happens for a single pendulum. However, if C==A or C==B this SpringDamper works a normal spring-and-damper hanging freely anywhere in 2D. My proposal is that the derivative of distance |AB| is computed, the damping force is computed only once, and only after that it is split to x,y-components.

tobolar commented 1 year ago

However, if C==A or C==B this SpringDamper works a normal spring-and-damper hanging freely anywhere in 2D.

@vengelson Can you provide an example for this?

I suppose in that case either of the following happens:

Additionally, and this is what probably happens in your case,

Anyway, either f_x or f_y shall still be non-zero.

P.S We talk about PlanarMechanics.Parts.SpringDamper, right?

vengelson commented 1 year ago

Hello !

I was just concentrating on getting pendulums to work consistently between 3D Mechanical and Planar.

DualSpringProblem.zip body_x_position

Please unpack the zip and try to run these three pendulums.

DualPlanarPendulum.body2 uses my suggested formulation for new SpringDamper in Planar library.

DualPlanarPendulum.body1 is using PlanarMechanics.Parts.SpringDamper which I believe is somewhat incorrect or not applicable in this case.

PendulumWithSpringDamper.body1 is from 3D Mechanical library. It has the same motion as DualPlanarPendulum.body2.

tobolar commented 1 year ago

What you do in your model is a definition of a point-to-point spring/damper. And it is really not comparable to PlanarMechanics.Parts.SpringDamper, see my comment https://github.com/dzimmer/PlanarMechanics/issues/67#issuecomment-78449735.

I have extended your example DualSpringProblem.DualPlanarPendulum by a third pendulum model - see below. The behavior of body3and body2is very similar now. The only difference is due to a missing "rxf" ("r" cross "f") in your model (i.e. you define in SpringDamperWithLineForce that frame_a.t = frame_b.t = 0), which in fact makes also the difference between the two "oscillating" signals "DualPlanarPendulum 1: body2.r[1]" and "PendulumWithSpringDamper 1: body1.r[1]" in your plot. The same behavior with pendulum 3 can be reached, when setting body3.I very small. Then, "rxf" plays nearly no role.

DualSpringProblem.zip

Concluding, I see no need to change the model now.