Skip to content
LIBRARY
tests.PlanarJointTest.md

tests.PlanarJointTest

Planar Joint Test

Ported from the Multibody.jl PlanarTest (basic_tests.jl). A body connected to the world via a Planar joint (xy-plane) with time-varying forces applied through a Force component.

Usage

MultibodyComponents.tests.PlanarJointTest()

Behavior

Source

dyad
"""
# Planar Joint Test

Ported from the Multibody.jl PlanarTest (basic_tests.jl).
A body connected to the world via a Planar joint (xy-plane) with
time-varying forces applied through a Force component.
"""
example component PlanarJointTest
  world = MultibodyComponents.World() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 225, "x2": 120, "y2": 325, "rot": 0}
      },
      "tags": []
    }
  }
  planar = MultibodyComponents.Planar(n = [0, 0, 1], n_x = [1, 0, 0], s_x(initial = 0), s_y(initial = 0), phi(initial = 0), v_x(initial = 0), v_y(initial = 0), w(initial = 0)) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 150, "y1": 225, "x2": 250, "y2": 325, "rot": 0}
      },
      "tags": []
    }
  }
  force = MultibodyComponents.Force() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 150, "y1": 130, "x2": 250, "y2": 230, "rot": 0}
      },
      "tags": []
    }
  }
  body = MultibodyComponents.Body(m = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 275, "y1": 225, "x2": 375, "y2": 325, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(world.frame_b, planar.frame_a, force.frame_a) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 135, "y": 180}], "E": 3}
      ],
      "junctions": [{"x": 135, "y": 275}],
      "renderStyle": "standard"
    }
  }
  connect(planar.frame_b, body.frame_a, force.frame_b) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 265, "y": 180}], "E": 3}
      ],
      "junctions": [{"x": 265, "y": 275}],
      "renderStyle": "standard"
    }
  }
  force.force_x = sin(time)
  force.force_y = time
  force.force_z = time ^ 2 / 2
end
Flattened Source
dyad
"""
# Planar Joint Test

Ported from the Multibody.jl PlanarTest (basic_tests.jl).
A body connected to the world via a Planar joint (xy-plane) with
time-varying forces applied through a Force component.
"""
example component PlanarJointTest
  world = MultibodyComponents.World() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 225, "x2": 120, "y2": 325, "rot": 0}
      },
      "tags": []
    }
  }
  planar = MultibodyComponents.Planar(n = [0, 0, 1], n_x = [1, 0, 0], s_x(initial = 0), s_y(initial = 0), phi(initial = 0), v_x(initial = 0), v_y(initial = 0), w(initial = 0)) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 150, "y1": 225, "x2": 250, "y2": 325, "rot": 0}
      },
      "tags": []
    }
  }
  force = MultibodyComponents.Force() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 150, "y1": 130, "x2": 250, "y2": 230, "rot": 0}
      },
      "tags": []
    }
  }
  body = MultibodyComponents.Body(m = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 275, "y1": 225, "x2": 375, "y2": 325, "rot": 0}
      },
      "tags": []
    }
  }
relations
  connect(world.frame_b, planar.frame_a, force.frame_a) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 135, "y": 180}], "E": 3}
      ],
      "junctions": [{"x": 135, "y": 275}],
      "renderStyle": "standard"
    }
  }
  connect(planar.frame_b, body.frame_a, force.frame_b) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 265, "y": 180}], "E": 3}
      ],
      "junctions": [{"x": 265, "y": 275}],
      "renderStyle": "standard"
    }
  }
  force.force_x = sin(time)
  force.force_y = time
  force.force_z = time ^ 2 / 2
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses