---
url: /dyad/stable/stdlib/RotationalComponents/components/Sources.VelocitySource.md
description: >-
  Dyad Sources.VelocitySource docs.  Forced movement of a spline according to a
  reference angular velocity signal.
---

# `Sources.VelocitySource` {#Sources.VelocitySource}

Forced movement of a spline according to a reference angular velocity signal.

The input signal `w_ref` defines the reference angular velocity in \[rad/s]. The spline is forced to move relative to the support connector according to this reference motion. The parameter `ref_type` selects between two modes:

1. **Exact**: The reference speed is treated exactly. This is only possible if the input signal is defined by an analytical function which can be differentiated at least once.

2. **Filtered** (default): The reference speed is filtered and the first derivative of the filtered curve is used to compute the reference acceleration of the spline. For filtering, a first order filter is used:
   `math  a = (w_{ref} - w) \\cdot w_{crit}`
   where `w_crit = 2π f_crit` is the critical angular frequency. The critical frequency `f_crit` should be selected higher than the essential low frequencies in the input signal.

This component extends from [`RotationalComponents.Interfaces.PartialElementaryOneSplineAndSupport`](../types/Interfaces.PartialElementaryOneSplineAndSupport.md)

## Usage {#Usage}

`RotationalComponents.Sources.VelocitySource()`

## Parameters: {#Parameters:}

|       Name |                       Description | Units |             Default value |
| ----------:| ---------------------------------:| -----:| -------------------------:|
| `ref_type` | Type of reference signal handling |     – | RotationalC....Filtered() |

## Connectors {#Connectors}

* `spline` - This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. ([`Spline`](/stdlib/Dyad/connectors/Spline#Spline))

* `support` - This connector represents a rotational spline with angle and torque as the potential and flow variables, respectively. ([`Spline`](/stdlib/Dyad/connectors/Spline#Spline))

* `w_ref` - This connector represents a real signal as an input to a component ([`RealInput`](/stdlib/Dyad/connectors/RealInput#RealInput))

## Variables {#Variables}

|          Name |                                            Description |  Units |
| -------------:| ------------------------------------------------------:| ------:|
| `phi_support` |                   Absolute angle of the support spline |    rad |
|         `phi` |       Rotation angle of spline with respect to support |    rad |
|           `w` |     Angular velocity of spline with respect to support |  rad/s |
|           `a` | Angular acceleration of spline with respect to support | rad/s2 |

## Behavior {#Behavior}

$$ \begin{align}
\mathtt{support.phi}\left( t \right) &= \mathtt{phi_support}\left( t \right) \\
\mathtt{support.tau}\left( t \right) &=  - \mathtt{spline.tau}\left( t \right) \\
\mathtt{phi}\left( t \right) &=  - \mathtt{phi_support}\left( t \right) + \mathtt{spline.phi}\left( t \right) \\
w\left( t \right) &= \frac{\mathrm{d}\mathtt{phi}\left( t \right)}{\mathrm{d}t} \\
a\left( t \right) &= \frac{\mathrm{d}w\left( t \right)}{\mathrm{d}t} \\
a\left( t \right) &= 100 ~ \pi ~ \left(  - w\left( t \right) + \mathtt{w_ref}\left( t \right) \right)
\end{align}
$$

## Source {#Source}

````dyad
"""
Forced movement of a spline according to a reference angular velocity signal.

The input signal `w_ref` defines the reference angular velocity in [rad/s]. The spline is
forced to move relative to the support connector according to this reference motion. The
parameter `ref_type` selects between two modes:

1. **Exact**: The reference speed is treated exactly. This is only possible if
   the input signal is defined by an analytical function which can be differentiated at
   least once.
2. **Filtered** (default): The reference speed is filtered and the first derivative of the
   filtered curve is used to compute the reference acceleration of the spline. For filtering,
   a first order filter is used:
   ```math
   a = (w_{ref} - w) \\cdot w_{crit}
````

where `w_crit = 2π f_crit` is the critical angular frequency. The critical frequency
`f_crit` should be selected higher than the essential low frequencies in the input signal.
"""
component VelocitySource
extends RotationalComponents.Interfaces.PartialElementaryOneSplineAndSupport
"Reference angular velocity of spline with respect to support as input signal"
w_ref = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
"Type of reference signal handling"
structural parameter ref_type::RotationalComponents.Sources.ReferenceType = RotationalComponents.Sources.ReferenceType.Filtered()
"Rotation angle of spline with respect to support"
variable phi::Angle(statePriority = 10)
"Angular velocity of spline with respect to support"
variable w::AngularVelocity(statePriority = 10)
"Angular acceleration of spline with respect to support"
variable a::AngularAcceleration
relations
phi = spline.phi - phi_support
w = der(phi)
switch ref_type
case Exact
w = w_ref
a = 0
case Filtered
initial w = w_ref
a = der(w)
a = (w_ref - w) \* 2 \* π \* getproperty(ref_type, Symbol("f_crit"))
end
metadata {
"Dyad": {
"icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.svg"},
"labels": \[{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1203, "rot": 0}]
}
}
end

````


<details>
<summary>Flattened Source</summary>



```dyad
"""
Forced movement of a spline according to a reference angular velocity signal.

The input signal `w_ref` defines the reference angular velocity in [rad/s]. The spline is
forced to move relative to the support connector according to this reference motion. The
parameter `ref_type` selects between two modes:

1. **Exact**: The reference speed is treated exactly. This is only possible if
   the input signal is defined by an analytical function which can be differentiated at
   least once.
2. **Filtered** (default): The reference speed is filtered and the first derivative of the
   filtered curve is used to compute the reference acceleration of the spline. For filtering,
   a first order filter is used:
   ```math
   a = (w_{ref} - w) \\cdot w_{crit}
````

where `w_crit = 2π f_crit` is the critical angular frequency. The critical frequency
`f_crit` should be selected higher than the essential low frequencies in the input signal.
"""
component VelocitySource
"Primary rotational shaft spline connector"
spline = Spline() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}}
"Support spline connector"
support = Spline() {
"Dyad": {
"placement": {"icon": {"iconName": "support", "x1": 450, "y1": 950, "x2": 550, "y2": 1050}}
}
}
"Absolute angle of the support spline"
variable phi_support::Angle
"Reference angular velocity of spline with respect to support as input signal"
w_ref = RealInput() {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}}
"Type of reference signal handling"
structural parameter ref_type::RotationalComponents.Sources.ReferenceType = RotationalComponents.Sources.ReferenceType.Filtered()
"Rotation angle of spline with respect to support"
variable phi::Angle(statePriority = 10)
"Angular velocity of spline with respect to support"
variable w::AngularVelocity(statePriority = 10)
"Angular acceleration of spline with respect to support"
variable a::AngularAcceleration
relations
support.phi = phi_support
support.tau = -spline.tau
phi = spline.phi - phi_support
w = der(phi)
switch ref_type
case Exact
w = w_ref
a = 0
case Filtered
initial w = w_ref
a = der(w)
a = (w_ref - w) \* 2 \* π \* getproperty(ref_type, Symbol("f_crit"))
end
metadata {
"Dyad": {
"icons": {"default": "dyad://RotationalComponents/Pos-Speed-Acc-Move.svg"},
"labels": \[{"label": "$(instance)", "layer": "icon", "x": 500, "y": 1203, "rot": 0}]
}
}
end

```

</details>


<br></br>



## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}
- Examples
    
- Experiments
    
- Analyses
    
- Tests
    - [`AllComponents`](Sources.VelocitySource.md)
        
    - [`Fixed`](Sources.VelocitySource.md)
        
    - [`Inertia`](Sources.VelocitySource.md)
        
    - [`Sine`](Sources.VelocitySource.md)
        
    - [`Step`](Sources.VelocitySource.md)
        
    - [`Torque2`](Sources.VelocitySource.md)
        
    - [`VelocitySource`](Sources.VelocitySource.md)
        
    - [`VelocitySource`](Sources.VelocitySource.md)
        
    
```
