Skip to content
LIBRARY
Sources.InverseSpeedDependentForce.md

Sources.InverseSpeedDependentForce

Force reciprocal dependent on speed.

Model of inverse speed dependent force. Parameter ForceDirection chooses whether the direction of force is the same in both directions of movement or not. When ForceDirection = false, regularization near zero speed avoids numerical problems.

When ForceDirection = true:

f = \\begin{cases} -f_{nominal} \\cdot \\frac{v_{nominal}}{v_0} & \\text{if } |v| < v_0 \\\\ -f_{nominal} \\cdot \\frac{v_{nominal}}{|v|} & \\text{otherwise} \\end{cases}

When ForceDirection = false:

f = \\begin{cases} -f_{nominal} \\cdot \\frac{v}{v_0} & \\text{if } |v| < v_0 \\\\ -f_{nominal} \\cdot \\frac{v_{nominal}}{v} & \\text{otherwise} \\end{cases}

This component extends from TranslationalComponents.Interfaces.PartialForce

Usage

TranslationalComponents.Sources.InverseSpeedDependentForce(f_nominal, v_nominal, v0=0.1)

Parameters:

NameDescriptionUnitsDefault value
ForceDirectionSame direction of force in both directions of motiontrue
f_nominalNominal force (if negative, force is acting as load in positive direction of motion)N
v_nominalNominal speedm/s
v0Regularization below v0m/s0.1

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)

Variables

NameDescriptionUnits
sDistance between flange and support (= flange.s - support.s)m
fAccelerating force acting at flange (= flange.f)N
vVelocity of flange with respect to support (= der(s))m/s

Behavior

julia
using TranslationalComponents #hide
using ModelingToolkit #hide
@variables f_nominal #hide
@variables v_nominal #hide
@variables v0 #hide
@named sys = TranslationalComponents.Sources.InverseSpeedDependentForce(f_nominal=f_nominal, v_nominal=v_nominal, v0=v0) #hide
full_equations(sys) #hide
<< @example-block not executed in draft mode >>

Source

dyad
"""
Force reciprocal dependent on speed.

Model of inverse speed dependent force. Parameter `ForceDirection` chooses whether
the direction of force is the same in both directions of movement or not.
When `ForceDirection = false`, regularization near zero speed avoids numerical problems.

When `ForceDirection = true`:
```math
f = \\begin{cases} -f_{nominal} \\cdot \\frac{v_{nominal}}{v_0} & \\text{if } |v| < v_0 \\\\ -f_{nominal} \\cdot \\frac{v_{nominal}}{|v|} & \\text{otherwise} \\end{cases}
```
When `ForceDirection = false`:
```math
f = \\begin{cases} -f_{nominal} \\cdot \\frac{v}{v_0} & \\text{if } |v| < v_0 \\\\ -f_{nominal} \\cdot \\frac{v_{nominal}}{v} & \\text{otherwise} \\end{cases}
```
"""
component InverseSpeedDependentForce
  extends TranslationalComponents.Interfaces.PartialForce
  "Nominal force (if negative, force is acting as load in positive direction of motion)"
  parameter f_nominal::Dyad.Force
  "Same direction of force in both directions of motion"
  structural parameter ForceDirection::Boolean = true
  "Nominal speed"
  parameter v_nominal::Velocity(min = eps(Float64))
  "Regularization below v0"
  parameter v0::Velocity(min = eps(Float64)) = 0.1
  "Velocity of flange with respect to support (= der(s))"
  variable v::Velocity
relations
  v = der(s)
  if ForceDirection
    f = ifelse(abs(v) < v0, -f_nominal * v_nominal / v0, -f_nominal * v_nominal / abs(v))
  else
    f = ifelse(abs(v) < v0, -f_nominal * v / v0, -f_nominal * v_nominal / v)
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/InverseSpeedDependentForce.svg"}
  }
}
end
Flattened Source
dyad
"""
Force reciprocal dependent on speed.

Model of inverse speed dependent force. Parameter `ForceDirection` chooses whether
the direction of force is the same in both directions of movement or not.
When `ForceDirection = false`, regularization near zero speed avoids numerical problems.

When `ForceDirection = true`:
```math
f = \\begin{cases} -f_{nominal} \\cdot \\frac{v_{nominal}}{v_0} & \\text{if } |v| < v_0 \\\\ -f_{nominal} \\cdot \\frac{v_{nominal}}{|v|} & \\text{otherwise} \\end{cases}
```
When `ForceDirection = false`:
```math
f = \\begin{cases} -f_{nominal} \\cdot \\frac{v}{v_0} & \\text{if } |v| < v_0 \\\\ -f_{nominal} \\cdot \\frac{v_{nominal}}{v} & \\text{otherwise} \\end{cases}
```
"""
component InverseSpeedDependentForce
  "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
  "Accelerating force acting at flange (= flange.f)"
  variable f::Dyad.Force
  "Nominal force (if negative, force is acting as load in positive direction of motion)"
  parameter f_nominal::Dyad.Force
  "Same direction of force in both directions of motion"
  structural parameter ForceDirection::Boolean = true
  "Nominal speed"
  parameter v_nominal::Velocity(min = eps(Float64))
  "Regularization below v0"
  parameter v0::Velocity(min = eps(Float64)) = 0.1
  "Velocity of flange with respect to support (= der(s))"
  variable v::Velocity
relations
  s = flange.s - support.s
  support.f = -flange.f
  f = flange.f
  v = der(s)
  if ForceDirection
    f = ifelse(abs(v) < v0, -f_nominal * v_nominal / v0, -f_nominal * v_nominal / abs(v))
  else
    f = ifelse(abs(v) < v0, -f_nominal * v / v0, -f_nominal * v_nominal / v)
  end
metadata {
  "Dyad": {
    "icons": {"default": "dyad://TranslationalComponents/InverseSpeedDependentForce.svg"}
  }
}
end


Test Cases

No test cases defined.