Skip to content
TwoInertiasWithDrivingTorque.md

TwoInertiasWithDrivingTorque

A mechanical system of two rotational inertias coupled by a spring and damper, driven by a sinusoidal torque.

This model represents a dynamic system where a primary rotational inertia (inertia1) is subjected to an external torque generated by a sinusoidal source. This first inertia is mechanically coupled to a second rotational inertia (inertia2) through a torsional spring and a torsional damper, which are arranged in parallel. The torque source is referenced to a fixed ground. Initial conditions for angular positions, and implicitly angular velocities through the initial acceleration constraint, define the starting state of the system.

Usage

RotationalComponents.TwoInertiasWithDrivingTorque()

Behavior

[connect(sine+y(t),torque+tau(t))connect(torque+support,fixed+spline)connect(torque+spline,inertia1+splinea)connect(inertia1+splineb,spring+splinea,damper+splinea)connect(spring+splineb,damper+splineb,inertia2+splinea)fixed.spline.phi(t)=fixed.phi0torque.support.phi(t)=torque.phi_support(t)torque.support.tau(t)=torque.spline.tau(t)torque.phi(t)=torque.spline.phi(t)torque.phi_support(t)torque.spline.tau(t)=torque.tau(t)inertia1.phi(t)=inertia1.spline_a.phi(t)inertia1.phi(t)=inertia1.spline_b.phi(t)dinertia1.phi(t)dt=inertia1.w(t)dinertia1.w(t)dt=inertia1.a(t)inertia1.Jinertia1.a(t)=inertia1.spline_b.tau(t)+inertia1.spline_a.tau(t)inertia2.phi(t)=inertia2.spline_a.phi(t)inertia2.phi(t)=inertia2.spline_b.phi(t)dinertia2.phi(t)dt=inertia2.w(t)dinertia2.w(t)dt=inertia2.a(t)inertia2.Jinertia2.a(t)=inertia2.spline_b.tau(t)+inertia2.spline_a.tau(t)spring.phi_rel(t)=spring.spline_b.phi(t)spring.spline_a.phi(t)spring.spline_b.tau(t)=spring.tau(t)spring.spline_a.tau(t)=spring.tau(t)spring.tau(t)=spring.c(spring.phi_rel0+spring.phi_rel(t))damper.phi_rel(t)=damper.spline_a.phi(t)+damper.spline_b.phi(t)damper.spline_b.tau(t)=damper.tau(t)damper.spline_a.tau(t)=damper.tau(t)ddamper.phi_rel(t)dt=damper.w_rel(t)ddamper.w_rel(t)dt=damper.a_rel(t)damper.tau(t)=damper.ddamper.w_rel(t)sine.y(t)=sine.offset+sine.amplitudeifelse(tsine.start_time,sin(sine.phase+6.2832sine.frequency(sine.start_time+t)),sin(sine.phase))]

Source

dyad
"""
A mechanical system of two rotational inertias coupled by a spring and damper, driven by a sinusoidal torque.

This model represents a dynamic system where a primary rotational inertia
(inertia1) is subjected to an external torque generated by a sinusoidal source.
This first inertia is mechanically coupled to a second rotational inertia
(inertia2) through a torsional spring and a torsional damper, which are arranged
in parallel. The torque source is referenced to a fixed ground.
Initial conditions for angular positions, and implicitly angular velocities
through the initial acceleration constraint, define the starting state of the system.
"""
test component TwoInertiasWithDrivingTorque
  "Represents a fixed mechanical ground or reference frame."
  fixed = Fixed() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 190, "y1": 650, "x2": 290, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  "Source that applies a torque to the system, driven by an external signal."
  torque = TorqueSource() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 190, "y1": 450, "x2": 290, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "First rotational inertia with moment of inertia J=2 kg.m^2."
  inertia1 = Inertia(J = 2) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 340, "y1": 450, "x2": 440, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Second rotational inertia with moment of inertia J=4 kg.m^2."
  inertia2 = Inertia(J = 4) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 680, "y1": 450, "x2": 780, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Torsional spring connecting the two inertias, with spring constant c=1e4 N.m/rad."
  spring = Spring(c = 1e4) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 500, "y1": 450, "x2": 600, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Torsional damper in parallel with the spring, with damping coefficient d=10 N.m.s/rad."
  damper = Damper(d = 10) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 500, "y1": 300, "x2": 600, "y2": 400, "rot": 0}
      },
      "tags": []
    }
  }
  "Generates a sinusoidal signal for the driving torque, with amplitude=10 and frequency=5 Hz."
  sine = BlockComponents.Sine(amplitude = 10, frequency = 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 0, "y1": 450, "x2": 100, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
relations
  initial inertia1.phi = 1
  initial inertia2.phi = 0.5
  initial inertia2.a = 0
  initial inertia2.w = 0
  connect(sine.y, torque.tau) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque.support, fixed.spline) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque.spline, inertia1.spline_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(inertia1.spline_b, spring.spline_a, damper.spline_a) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 470, "y": 350}], "E": 3}
      ],
      "junctions": [{"x": 470, "y": 500}],
      "renderStyle": "standard"
    }
  }
  connect(spring.spline_b, damper.spline_b, inertia2.spline_a) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [{"x": 630, "y": 350}], "E": 2},
        {"S": -1, "M": [], "E": 3}
      ],
      "junctions": [{"x": 630, "y": 500}],
      "renderStyle": "standard"
    }
  }
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/Example.svg"},
    "tests": {
      "case1": {
        "stop": 1,
        "expect": {
          "initial": {"inertia1.phi": 1, "inertia2.phi": 0.5, "inertia1.w": -500, "inertia2.w ": 0}
        }
      }
    }
  }
}
end
Flattened Source
dyad
"""
A mechanical system of two rotational inertias coupled by a spring and damper, driven by a sinusoidal torque.

This model represents a dynamic system where a primary rotational inertia
(inertia1) is subjected to an external torque generated by a sinusoidal source.
This first inertia is mechanically coupled to a second rotational inertia
(inertia2) through a torsional spring and a torsional damper, which are arranged
in parallel. The torque source is referenced to a fixed ground.
Initial conditions for angular positions, and implicitly angular velocities
through the initial acceleration constraint, define the starting state of the system.
"""
test component TwoInertiasWithDrivingTorque
  "Represents a fixed mechanical ground or reference frame."
  fixed = Fixed() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 190, "y1": 650, "x2": 290, "y2": 750, "rot": 0}
      },
      "tags": []
    }
  }
  "Source that applies a torque to the system, driven by an external signal."
  torque = TorqueSource() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 190, "y1": 450, "x2": 290, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "First rotational inertia with moment of inertia J=2 kg.m^2."
  inertia1 = Inertia(J = 2) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 340, "y1": 450, "x2": 440, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Second rotational inertia with moment of inertia J=4 kg.m^2."
  inertia2 = Inertia(J = 4) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 680, "y1": 450, "x2": 780, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Torsional spring connecting the two inertias, with spring constant c=1e4 N.m/rad."
  spring = Spring(c = 1e4) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 500, "y1": 450, "x2": 600, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Torsional damper in parallel with the spring, with damping coefficient d=10 N.m.s/rad."
  damper = Damper(d = 10) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 500, "y1": 300, "x2": 600, "y2": 400, "rot": 0}
      },
      "tags": []
    }
  }
  "Generates a sinusoidal signal for the driving torque, with amplitude=10 and frequency=5 Hz."
  sine = BlockComponents.Sine(amplitude = 10, frequency = 5) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 0, "y1": 450, "x2": 100, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
relations
  initial inertia1.phi = 1
  initial inertia2.phi = 0.5
  initial inertia2.a = 0
  initial inertia2.w = 0
  connect(sine.y, torque.tau) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque.support, fixed.spline) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque.spline, inertia1.spline_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(inertia1.spline_b, spring.spline_a, damper.spline_a) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [], "E": 2},
        {"S": -1, "M": [{"x": 470, "y": 350}], "E": 3}
      ],
      "junctions": [{"x": 470, "y": 500}],
      "renderStyle": "standard"
    }
  }
  connect(spring.spline_b, damper.spline_b, inertia2.spline_a) {
    "Dyad": {
      "edges": [
        {"S": 1, "M": [], "E": -1},
        {"S": -1, "M": [{"x": 630, "y": 350}], "E": 2},
        {"S": -1, "M": [], "E": 3}
      ],
      "junctions": [{"x": 630, "y": 500}],
      "renderStyle": "standard"
    }
  }
metadata {
  "Dyad": {
    "icons": {"default": "dyad://RotationalComponents/Example.svg"},
    "tests": {
      "case1": {
        "stop": 1,
        "expect": {
          "initial": {"inertia1.phi": 1, "inertia2.phi": 0.5, "inertia1.w": -500, "inertia2.w ": 0}
        }
      }
    }
  }
}
end


Test Cases

Test Case case1