---
url: /dyad/stable/stdlib/MultibodyComponents/components/JointSSP.md
description: >-
  Dyad JointSSP docs.  Spherical - spherical - prismatic joint aggregation.
  Analytically closes a kinematic loop (no constraints, no potential states): a
  Spherical...
---

# `JointSSP` {#JointSSP}

Spherical - spherical - prismatic joint aggregation. Analytically closes a kinematic loop (no constraints, no potential states): a `SphericalSpherical` rod of fixed length `rod1_length` (optionally carrying a point mass `rod1_mass`) between `frame_a` and the middle spherical joint, a rigid rod `rRod2_ib`, and a `PrismaticWithLengthConstraint` at `frame_b`. Interior frames `frame_ib` and `frame_im` (rod2 ends) are exposed. `axis`/`bearing` drive the prismatic joint.

This component extends from [`PartialTwoFrames`](../types/PartialTwoFrames.md)

## Usage {#Usage}

`MultibodyComponents.JointSSP(rod1_length=1, rod1_mass=0, n_b=[0, 0, 1], rRod2_ib=[1, 0, 0], s_offset=0, s_guess=0, rod_radius=0.05, rod_color=[0.5, 0, 0.5, 1])`

## Parameters: {#Parameters:}

|              Name |                                                                                                     Description | Units |    Default value |
| -----------------:| ---------------------------------------------------------------------------------------------------------------:| -----:| ----------------:|
| `positive_branch` | Force a branch of the analytic loop-closure solution instead of selecting it automatically from the guess value |     – |          missing |
|        `has_mass` |                                                                                                                 |     – |            false |
|     `rod1_length` |                                          Distance between the origins of the two spherical joints (rod1 length) |     – |                1 |
|       `rod1_mass` |                                                         Mass of rod1 (point mass located in the middle of rod1) |    kg |                0 |
|             `n_b` |                                                                Axis of the prismatic joint, resolved in frame_b |     – |        \[0, 0, 1] |
|        `rRod2_ib` |                                 Vector from frame_ib origin to the middle spherical joint, resolved in frame_ib |     – |        \[1, 0, 0] |
|        `s_offset` |                                                                 Relative distance offset of the prismatic joint |     – |                0 |
|         `s_guess` |                                                      Guess value for the prismatic distance at the initial time |     – |                0 |
|      `rod_radius` |                                                                                    Rendering radius of the rods |     – |             0.05 |
|       `rod_color` |                                                                                          RGBA color of the rods |     – | \[0.5, 0, 0.5, 1] |

## Connectors {#Connectors}

* `frame_a` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `frame_b` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `frame_ib` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `frame_im` - Frame3D is the fundamental 3D connector used for 6DOF motion. Most components have one or several `Frame`

connectors that can be connected together ([`Frame3D`](/stdlib/Dyad/connectors/Frame3D#Frame3D))

* `axis` - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. ([`Flange`](/stdlib/Dyad/connectors/Flange#Flange))

* `bearing` - This connector represents a mechanical flange with position and force as the potential and flow variables, respectively. ([`Flange`](/stdlib/Dyad/connectors/Flange#Flange))

## Variables {#Variables}

|    Name |                                                                Description | Units |
| -------:| --------------------------------------------------------------------------:| -----:|
|   `aux` |                                  Denominator used to compute the rod force |     – |
| `f_rod` | Constraint force in the direction of rod1 (positive if the rod is pressed) |     – |

## Behavior {#Behavior}

## Source {#Source}

```dyad
"""
Spherical - spherical - prismatic joint aggregation. Analytically closes a
kinematic loop (no constraints, no potential states): a `SphericalSpherical` rod
of fixed length `rod1_length` (optionally carrying a point mass `rod1_mass`)
between `frame_a` and the middle spherical joint, a rigid rod `rRod2_ib`, and a
`PrismaticWithLengthConstraint` at `frame_b`. Interior frames `frame_ib` and
`frame_im` (rod2 ends) are exposed. `axis`/`bearing` drive the prismatic joint.
"""
component JointSSP
  extends PartialTwoFrames()
  "Frame fixed in rod2 at the prismatic side (= rod2.frame_a)"
  frame_ib = Frame3D() {}
  "Frame fixed in rod2 at the middle spherical joint (= rod2.frame_b)"
  frame_im = Frame3D() {}
  "Translational flange driving the prismatic joint"
  axis = Flange() {}
  "Translational flange of the prismatic joint bearing"
  bearing = Flange() {}
  rod1 = SphericalSpherical(r_0 = [rod1_length, 0, 0], kinematic_constraint = false, constraint_residue_external = true, has_mass = has_mass, m = rod1_mass, radius = rod_radius, color = rod_color) {}
  rod2 = FixedTranslation(r = rRod2_ib, radius = rod_radius, color = rod_color) {}
  prismatic = PrismaticWithLengthConstraint(n = n_b, length_constraint = rod1_length, s_offset = s_offset, s_guess = s_guess, positive_branch = positive_branch) {}
  "Force a branch of the analytic loop-closure solution instead of selecting it automatically from the guess value"
  structural parameter positive_branch::Boolean = missing
  structural parameter has_mass::Boolean = false
  "Distance between the origins of the two spherical joints (rod1 length)"
  parameter rod1_length::Real = 1
  "Mass of rod1 (point mass located in the middle of rod1)"
  parameter rod1_mass::Mass = 0 if has_mass
  "Axis of the prismatic joint, resolved in frame_b"
  parameter n_b::Real[3] = [0, 0, 1]
  "Vector from frame_ib origin to the middle spherical joint, resolved in frame_ib"
  parameter rRod2_ib::Real[3] = [1, 0, 0]
  "Relative distance offset of the prismatic joint"
  parameter s_offset::Real = 0
  "Guess value for the prismatic distance at the initial time"
  parameter s_guess::Real = 0
  "Rendering radius of the rods"
  parameter rod_radius::Real = 0.05
  "RGBA color of the rods"
  parameter rod_color::Real[4] = [0.5, 0, 0.5, 1]
  "Denominator used to compute the rod force"
  variable aux::Real
  "Constraint force in the direction of rod1 (positive if the rod is pressed)"
  variable f_rod::Real
relations
  aux = dot(prismatic.e, resolve_relative(rod1.eRod_a, rod1.frame_a.R, rod1.frame_b.R))
  f_rod = (-prismatic.f - dot(prismatic.e, frame_ib.f + frame_im.f)) / ifelse(abs(aux) < 1e-10, 1e-10, aux)
  rod1.constraint_residue = rod1.f_rod - f_rod
  prismatic.r_a = resolve2(frame_b.R, frame_a.r_0 - frame_b.r_0)
  prismatic.r_b = rRod2_ib
  connect(prismatic.frame_b, rod2.frame_a)
  connect(rod2.frame_b, rod1.frame_b)
  connect(prismatic.frame_a, frame_b)
  connect(rod2.frame_a, frame_ib)
  connect(rod1.frame_a, frame_a)
  connect(rod2.frame_b, frame_im)
  connect(prismatic.axis, axis)
  connect(prismatic.bearing, bearing)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/JointSSP.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 200,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

```dyad
"""
Spherical - spherical - prismatic joint aggregation. Analytically closes a
kinematic loop (no constraints, no potential states): a `SphericalSpherical` rod
of fixed length `rod1_length` (optionally carrying a point mass `rod1_mass`)
between `frame_a` and the middle spherical joint, a rigid rod `rRod2_ib`, and a
`PrismaticWithLengthConstraint` at `frame_b`. Interior frames `frame_ib` and
`frame_im` (rod2 ends) are exposed. `axis`/`bearing` drive the prismatic joint.
"""
component JointSSP
  frame_a = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": -50, "y1": 450, "x2": 50, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  frame_b = Frame3D() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 950, "y1": 450, "x2": 1050, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Frame fixed in rod2 at the prismatic side (= rod2.frame_a)"
  frame_ib = Frame3D() {}
  "Frame fixed in rod2 at the middle spherical joint (= rod2.frame_b)"
  frame_im = Frame3D() {}
  "Translational flange driving the prismatic joint"
  axis = Flange() {}
  "Translational flange of the prismatic joint bearing"
  bearing = Flange() {}
  rod1 = SphericalSpherical(r_0 = [rod1_length, 0, 0], kinematic_constraint = false, constraint_residue_external = true, has_mass = has_mass, m = rod1_mass, radius = rod_radius, color = rod_color) {}
  rod2 = FixedTranslation(r = rRod2_ib, radius = rod_radius, color = rod_color) {}
  prismatic = PrismaticWithLengthConstraint(n = n_b, length_constraint = rod1_length, s_offset = s_offset, s_guess = s_guess, positive_branch = positive_branch) {}
  "Force a branch of the analytic loop-closure solution instead of selecting it automatically from the guess value"
  structural parameter positive_branch::Boolean = missing
  structural parameter has_mass::Boolean = false
  "Distance between the origins of the two spherical joints (rod1 length)"
  parameter rod1_length::Real = 1
  "Mass of rod1 (point mass located in the middle of rod1)"
  parameter rod1_mass::Mass = 0 if has_mass
  "Axis of the prismatic joint, resolved in frame_b"
  parameter n_b::Real[3] = [0, 0, 1]
  "Vector from frame_ib origin to the middle spherical joint, resolved in frame_ib"
  parameter rRod2_ib::Real[3] = [1, 0, 0]
  "Relative distance offset of the prismatic joint"
  parameter s_offset::Real = 0
  "Guess value for the prismatic distance at the initial time"
  parameter s_guess::Real = 0
  "Rendering radius of the rods"
  parameter rod_radius::Real = 0.05
  "RGBA color of the rods"
  parameter rod_color::Real[4] = [0.5, 0, 0.5, 1]
  "Denominator used to compute the rod force"
  variable aux::Real
  "Constraint force in the direction of rod1 (positive if the rod is pressed)"
  variable f_rod::Real
relations
  aux = dot(prismatic.e, resolve_relative(rod1.eRod_a, rod1.frame_a.R, rod1.frame_b.R))
  f_rod = (-prismatic.f - dot(prismatic.e, frame_ib.f + frame_im.f)) / ifelse(abs(aux) < 1e-10, 1e-10, aux)
  rod1.constraint_residue = rod1.f_rod - f_rod
  prismatic.r_a = resolve2(frame_b.R, frame_a.r_0 - frame_b.r_0)
  prismatic.r_b = rRod2_ib
  connect(prismatic.frame_b, rod2.frame_a)
  connect(rod2.frame_b, rod1.frame_b)
  connect(prismatic.frame_a, frame_b)
  connect(rod2.frame_a, frame_ib)
  connect(rod1.frame_a, frame_a)
  connect(rod2.frame_b, frame_im)
  connect(prismatic.axis, axis)
  connect(prismatic.bearing, bearing)
metadata {
  "Dyad": {
    "icons": {"default": "dyad://MultibodyComponents/JointSSP.svg"},
    "labels": [
      {
        "label": "$(instance)",
        "x": 500,
        "y": 200,
        "rot": 0,
        "attrs": {"font-size": "160"}
      }
    ]
  }
}
end
```

## Test Cases {#Test-Cases}

No test cases defined.

## Related {#Related}

* Examples

* Experiments

* Analyses
