# Dynamics #105

Merged
merged 25 commits into from Feb 15, 2014

Projects
None yet
3 participants
Member

## Implementation of ValueNode_Dynamic

This is the implementation of a new Convert type that allows to link two vectors with a dynamic link. The value node (vector type) that is converted to Dynamic will be linked to another vector value using a linear/rotational spring system with damping and friction.

Once you convert the Value to Dynamic it offers the following subparameters:

• Tip Static (Vector) This is the equilibrium position of the system without external forces relative to the Origin. See Origin. Since it is a vector its length is used for the linear spring equilibrium length and its angle form the x axis is used for the torsion spring equilibrium angle. The initial value of this subparameter is the current value of the Value that is being converted to Dynamic.
• Origin (Vector) This is the basement of the dynamic system. Defaults to (0.0, 0.0). If the user changes this value the final equilibrium calculated position of the value is modified too. Accelerations of the Origin are used to move the Tip due to the fictitious forces needed to apply under non inertial reference systems.
• Force (Vector) External force applied on the Tip of the dynamic system. Defaults to (0.0, 0.0).
• Torque (Real) External momentum applied tot he dynamic system at the Origin. Defaults to 0.0.
• Damping (Real) Damper coefficient of the linear link. Defaults to 0.4
• Friction (Real) Friction coefficient of the rotational link. Defaults to 0.4
• Spring (Real) Spring coefficient of the linear link. Defaults to 30.0
• Torsion (Real) Torsion coefficient of the rotational link. Defaults to 30.0
• Mass (Real) Mass of the dynamic system. Defaults to 0.3
• Inertia (Real) Moment of inertia of the dynamic system. Defaults to 0.3

• The movement of the Origin produces two effects. It drags the resulting vector the same amount of the Origin along the time (that is the resulting vector is the sum of the Origin(t) + dynamic tip(t)) and its acceleration produces an inertial force contrary to the acceleration direction and magnitude.
• The Torque only affects the angle of the resulting vector respect to the Origin. This means that the mass center of gravity is located at the origin (where the torque is applied) and so there is not centrifugal effects.
• Since the Origin only can be translated, there is not Coriolis forces.
• The Force is applied on the tip position so it would produce effects on the angle and on the length of the tip. Force (F) is decomposed into two vectors one aligned with the Tip vector (Fr) and other perpendicular (Fa). The one aligned (Fr) is used on the linear damper spring equations. The one perpendicular (Fa) is used as additional torque by this expression Fr*R (where R is the size of the Tip vector)
• If Mass (Inertia) is animated and reaches near to zero, then the movement for linear (rotational) link is disabled.
• If Mass (inertia) is constant and equal to zero, then the movement for linear (rotational) link is disabled. It is useful when user wants to create a rigid link on linear (rotational) link.
• Except mass and inertia = 0.0, user is responsible of the meaning of the values of the parameters (i.e. negative mass, or negative friction or spring constant)

### Further development

• Implement reverse manipulation. The Tip Static subparameter should be the one modified when the user tweaks the Dynamic value node handle. This way the user can alter the equilibrium position of the spring (which is other type of animation of this model)
• Add one more subparameter to don't allow Origin to drag the result. Origin would only be used as an input of the movement of the basement but not to calculate the final position of the tip. This is useful when the vector that represent the tip is not a free vector but it is already a vector that depends on other. I. e. Bones.
• Study how to implement this on a chain of bones taking in consideration the reactive internal forces.

### genete added some commits Jan 16, 2014

``` Increase fedora cross compiling release version from 18 to 19. ```
`It allows to have Boost/Odeint libraries only available since Boost 1.53.0`
``` 9eaf213 ```
``` Remove unneded isnan definition macros what conflicts with usage of s… ```
`…td::isnan`
``` 60c36ae ```
``` Empty structure for Dynamic convert type ```
``` 5a7c8f5 ```
``` Initial draft for equations ```
``` e38e3b9 ```
``` Fix compiling errors ```
``` 53e0e48 ```
``` Correct header macro ```
``` 3b4a0e3 ```
``` oNew Value Node Derivative ```
``` 21ff97b ```
``` Add value node for the derivative of the origin of the dynamic system. ```
``` b7a7826 ```
``` Implement integration of equations. ```
``` f09dde2 ```
``` Typo in formula. Remember last time called. ```
``` 3b4157f ```
``` Disable torsion spring. Equations aren't correct yet. ```
`Move state variable inside class.`
``` 32e445b ```
``` Re-enable torsion equations. Fix rest position calculation. Not worki… ```
`…ng yet`
``` b0aee19 ```
``` When playing backwards, calculate the dynamic from the start. ```
```New member to reset state.
Disable torsion spring again, needs fixes.```
``` 3653627 ```
``` Properly calculate the step ```
``` 33d7e53 ```
``` Trial with new equations for rotation ```
``` 956fc6b ```
``` Add code for derivative of order two ```
``` 9752a36 ```
``` Fix equations of movement ```
``` c8b92d3 ```
``` Fix wrong coeficients ```
``` 03f2a01 ```
``` Do not discount the origin when resetting state ```
``` 8cbf836 ```
``` Suit mor "springy" intial values ```
``` b19f7b8 ```
``` Consider spring constant to be infinite when it is set to zero. ```
`Avoid zero division when mass or inertia are zero.`
``` 4eb4498 ```
``` Typo ```
``` b49717f ```
``` Do not use spring constant to disable movement. Use mass and inertia. ```
`Avoid zero division when mass or inertia are small enough.`
``` 41addf6 ```
``` Remove information messages ```
``` 7506394 ```
``` Add torque as subparameter ```
``` d7b7bc4 ```

### morevnaproject added a commit that referenced this pull request Feb 15, 2014

``` Merge pull request #105 from genete/dynamics ```
`Dynamics convert type`
``` 7a4931a ```

Member

### morevnaproject commented Feb 15, 2014

 It would be nice to put such description onto wiki page! ^__^
Contributor

### d-j-a-y commented Mar 5, 2014

 It would be nice to put such description onto wiki page! ^__^ done