Skip to content
LIBRARY
Sources.Position.md

Sources.Position

Forced movement of a flange according to a reference position.

The input signal s_ref defines the reference position in [m]. The flange 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 position is treated exactly. This is only possible if the input signal is defined by an analytical function which can be differentiated at least twice.

  2. Filtered (default): The reference position is filtered and the second derivative of the filtered curve is used to compute the reference acceleration of the flange. For filtering, a second order Bessel filter is used. The critical frequency f_crit in [Hz] should be selected higher than the essential low frequencies in the signal. math \\frac{bf}{w_{crit}^2} \\frac{d^2s}{dt^2} + \\frac{af}{w_{crit}} \\frac{ds}{dt} + s = s_{ref}

This component extends from TranslationalComponents.Interfaces.PartialElementaryOneFlangeAndSupport2

Usage

TranslationalComponents.Sources.Position(a_f=1.3617, b_f=0.6180)

Parameters:

NameDescriptionUnitsDefault value
ref_typeType of reference signal handlingTranslation....Filtered()

Connectors

  • flange - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)

  • support - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. (Flange)

  • s_ref - This connector represents a real signal as an input to a component (RealInput)

Variables

NameDescriptionUnits
sDistance between flange and support (= flange.s - support.s)m
vVelocity of flange with respect to supportm/s
aAcceleration of flange with respect to supportm/s2

Behavior

julia
using TranslationalComponents #hide
using ModelingToolkit #hide
@named sys = TranslationalComponents.Sources.Position() #hide
full_equations(sys) #hide
<< @example-block not executed in draft mode >>

Source

dyad
"""
Forced movement of a flange according to a reference position.

The input signal `s_ref` defines the reference position in [m]. The flange 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 position is treated exactly. This is only possible if
   the input signal is defined by an analytical function which can be differentiated at
   least twice.
2. **Filtered** (default): The reference position is filtered and the second derivative of the
   filtered curve is used to compute the reference acceleration of the flange. For filtering,
   a second order Bessel filter is used. The critical frequency `f_crit` in [Hz] should be
   selected higher than the essential low frequencies in the signal.

   ```math
   \\frac{bf}{w_{crit}^2} \\frac{d^2s}{dt^2} + \\frac{af}{w_{crit}} \\frac{ds}{dt} + s = s_{ref}

""" component Position extends TranslationalComponents.Interfaces.PartialElementaryOneFlangeAndSupport2(s(statePriority = 50) = missing) "Reference position of flange as input signal" s_ref = RealInput(units = "m") {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}} "Type of reference signal handling" structural parameter ref_type::TranslationalComponents.Sources.ReferenceType = TranslationalComponents.Sources.ReferenceType.Filtered() "s-coefficient of the Bessel filter" final parameter a_f::Real = 1.3617 "s²-coefficient of the Bessel filter" final parameter b_f::Real = 0.6180 "Velocity of flange with respect to support" variable v::Velocity(statePriority = 50) "Acceleration of flange with respect to support" variable a::Acceleration relations switch ref_type case Exact s = s_ref v = 0 a = 0 case Filtered initial s = s_ref v = der(s) a = der(v) a = ((s_ref - s) * 2 * π * getproperty(ref_type, Symbol("f_crit")) - a_f * v) * (2 * π * getproperty(ref_type, Symbol("f_crit")) / b_f) end metadata {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Position.svg"}}} end



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



```dyad
"""
Forced movement of a flange according to a reference position.

The input signal `s_ref` defines the reference position in [m]. The flange 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 position is treated exactly. This is only possible if
   the input signal is defined by an analytical function which can be differentiated at
   least twice.
2. **Filtered** (default): The reference position is filtered and the second derivative of the
   filtered curve is used to compute the reference acceleration of the flange. For filtering,
   a second order Bessel filter is used. The critical frequency `f_crit` in [Hz] should be
   selected higher than the essential low frequencies in the signal.

   ```math
   \\frac{bf}{w_{crit}^2} \\frac{d^2s}{dt^2} + \\frac{af}{w_{crit}} \\frac{ds}{dt} + s = s_{ref}

""" component Position "Flange of component" flange = Flange() {"Dyad": {"placement": {"icon": {"x1": 950, "y1": 450, "x2": 1050, "y2": 550}}}} "Support/housing of component" support = Flange() {"Dyad": {"placement": {"icon": {"x1": 450, "y1": 950, "x2": 550, "y2": 1050}}}} "Distance between flange and support (= flange.s - support.s)" variable s::Length "Reference position of flange as input signal" s_ref = RealInput(units = "m") {"Dyad": {"placement": {"icon": {"x1": -50, "y1": 450, "x2": 50, "y2": 550}}}} "Type of reference signal handling" structural parameter ref_type::TranslationalComponents.Sources.ReferenceType = TranslationalComponents.Sources.ReferenceType.Filtered() "s-coefficient of the Bessel filter" final parameter a_f::Real = 1.3617 "s²-coefficient of the Bessel filter" final parameter b_f::Real = 0.6180 "Velocity of flange with respect to support" variable v::Velocity(statePriority = 50) "Acceleration of flange with respect to support" variable a::Acceleration relations s = flange.s - support.s support.f = -flange.f switch ref_type case Exact s = s_ref v = 0 a = 0 case Filtered initial s = s_ref v = der(s) a = der(v) a = ((s_ref - s) * 2 * π * getproperty(ref_type, Symbol("f_crit")) - a_f * v) * (2 * π * getproperty(ref_type, Symbol("f_crit")) / b_f) end metadata {"Dyad": {"icons": {"default": "dyad://TranslationalComponents/Position.svg"}}} end


</details>


<br></br>



## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}
- Examples
  
- Experiments
  
- Analyses
  
- Tests
  - [`AllComponents`](Sources.Position.md)
    
  - [`Fixed`](Sources.Position.md)
    
  - [`Mass`](Sources.Position.md)
    
  - [`Position`](Sources.Position.md)
    
  - [`Position`](Sources.Position.md)
    
  - [`Sine`](Sources.Position.md)