$(instance)ActiveSuspension Icon

ActiveSuspension

Usage

ActiveSuspension(wheel_mass=25, wheel_stiffness=1e2, wheel_damping=1e4, car_mass=1000, suspension_stiffness=1e4, suspension_damping=10, human_and_seat_mass=100, seat_stiffness=1000, seat_damping=1, wheel_initial_position=0.5, suspension_initial_position=1, seat_initial_position=1.5, kd=20, ki=0.2, kp=1)

Parameters:

NameDescriptionUnitsDefault value
wheel_masskg25
wheel_stiffnessN/m100
wheel_dampings-110000
car_masskg1000
suspension_stiffnessN/m10000
suspension_dampings-110
human_and_seat_masskg100
seat_stiffnessN/m1000
seat_dampings-11
wheel_initial_positionm0.5
suspension_initial_positionm1
seat_initial_positionm1.5
kd20
ki0.2
kp1

Behavior

\[ \begin{equation} \left[ \begin{array}{c} \mathrm{connect}\left( road_{data_{+}y(t)}, road_{+}s(t) \right) \\ \mathrm{connect}\left( road_{+}flange, wheel_{+}flange_{sd} \right) \\ \mathrm{connect}\left( wheel_{+}flange_{m}, car_{and\_suspension_{+}flange\_sd} \right) \\ \mathrm{connect}\left( car_{and\_suspension_{+}flange\_m}, seat_{+}flange_{sd}, force_{+}flange_{a} \right) \\ \mathrm{connect}\left( seat_{+}flange_{m}, force_{+}flange_{b}, seat_{pos_{+}flange} \right) \\ \mathrm{connect}\left( seat_{pos_{+}s(t)}, err_{+}u1(t) \right) \\ \mathrm{connect}\left( set_{point_{+}y(t)}, err_{+}u2(t) \right) \\ \mathrm{connect}\left( err_{+}y(t), pid_{+}err_{input(t)} \right) \\ \mathrm{connect}\left( pid_{+}ctr_{output(t)}, flip_{+}u(t) \right) \\ \mathrm{connect}\left( flip_{+}y(t), force_{+}f(t) \right) \\ \mathrm{connect}\left( flange_{m}, mass_{+}flange_{b}, spring_{damper_{+}flange\_a} \right) \\ \mathrm{connect}\left( spring_{damper_{+}flange\_b}, flange_{sd} \right) \\ \mathtt{wheel.mass.flange\_a.s}\left( t \right) = - \frac{1}{2} \mathtt{wheel.mass.L} + \mathtt{wheel.mass.s}\left( t \right) \\ \mathtt{wheel.mass.flange\_b.s}\left( t \right) = \frac{1}{2} \mathtt{wheel.mass.L} + \mathtt{wheel.mass.s}\left( t \right) \\ \mathtt{wheel.mass.v}\left( t \right) = \frac{\mathrm{d} \mathtt{wheel.mass.s}\left( t \right)}{\mathrm{d}t} \\ \mathtt{wheel.mass.a}\left( t \right) = \frac{\mathrm{d} \mathtt{wheel.mass.v}\left( t \right)}{\mathrm{d}t} \\ \left( \mathtt{wheel.mass.a}\left( t \right) + \mathtt{wheel.mass.g} \sin\left( \mathtt{wheel.mass.theta} \right) \right) \mathtt{wheel.mass.m} = \mathtt{wheel.mass.flange\_b.f}\left( t \right) + \mathtt{wheel.mass.flange\_a.f}\left( t \right) \\ \mathtt{wheel.spring\_damper.s\_rel}\left( t \right) = \mathtt{wheel.spring\_damper.flange\_b.s}\left( t \right) - \mathtt{wheel.spring\_damper.flange\_a.s}\left( t \right) \\ \mathtt{wheel.spring\_damper.v\_rel}\left( t \right) = \frac{\mathrm{d} \mathtt{wheel.spring\_damper.s\_rel}\left( t \right)}{\mathrm{d}t} \\ \mathtt{wheel.spring\_damper.flange\_b.f}\left( t \right) = \mathtt{wheel.spring\_damper.f}\left( t \right) \\ \mathtt{wheel.spring\_damper.flange\_a.f}\left( t \right) = - \mathtt{wheel.spring\_damper.f}\left( t \right) \\ \mathtt{wheel.spring\_damper.f\_c}\left( t \right) = \mathtt{wheel.spring\_damper.c} \left( \mathtt{wheel.spring\_damper.s\_rel}\left( t \right) - \mathtt{wheel.spring\_damper.initial\_stretch}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{wheel.spring\_damper.initial\_stretch}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{wheel.spring\_damper.f\_d}\left( t \right) = \mathtt{wheel.spring\_damper.d} \mathtt{wheel.spring\_damper.v\_rel}\left( t \right) \\ \mathtt{wheel.spring\_damper.f}\left( t \right) = \mathtt{wheel.spring\_damper.f\_c}\left( t \right) + \mathtt{wheel.spring\_damper.f\_d}\left( t \right) \\ \mathtt{wheel.spring\_damper.lossPower}\left( t \right) = \mathtt{wheel.spring\_damper.f\_d}\left( t \right) \mathtt{wheel.spring\_damper.v\_rel}\left( t \right) \\ \mathrm{connect}\left( flange_{m}, mass_{+}flange_{b}, spring_{damper_{+}flange\_a} \right) \\ \mathrm{connect}\left( spring_{damper_{+}flange\_b}, flange_{sd} \right) \\ \mathtt{car\_and\_suspension.mass.flange\_a.s}\left( t \right) = - \frac{1}{2} \mathtt{car\_and\_suspension.mass.L} + \mathtt{car\_and\_suspension.mass.s}\left( t \right) \\ \mathtt{car\_and\_suspension.mass.flange\_b.s}\left( t \right) = \frac{1}{2} \mathtt{car\_and\_suspension.mass.L} + \mathtt{car\_and\_suspension.mass.s}\left( t \right) \\ \mathtt{car\_and\_suspension.mass.v}\left( t \right) = \frac{\mathrm{d} \mathtt{car\_and\_suspension.mass.s}\left( t \right)}{\mathrm{d}t} \\ \mathtt{car\_and\_suspension.mass.a}\left( t \right) = \frac{\mathrm{d} \mathtt{car\_and\_suspension.mass.v}\left( t \right)}{\mathrm{d}t} \\ \left( \mathtt{car\_and\_suspension.mass.a}\left( t \right) + \mathtt{car\_and\_suspension.mass.g} \sin\left( \mathtt{car\_and\_suspension.mass.theta} \right) \right) \mathtt{car\_and\_suspension.mass.m} = \mathtt{car\_and\_suspension.mass.flange\_a.f}\left( t \right) + \mathtt{car\_and\_suspension.mass.flange\_b.f}\left( t \right) \\ \mathtt{car\_and\_suspension.spring\_damper.s\_rel}\left( t \right) = \mathtt{car\_and\_suspension.spring\_damper.flange\_b.s}\left( t \right) - \mathtt{car\_and\_suspension.spring\_damper.flange\_a.s}\left( t \right) \\ \mathtt{car\_and\_suspension.spring\_damper.v\_rel}\left( t \right) = \frac{\mathrm{d} \mathtt{car\_and\_suspension.spring\_damper.s\_rel}\left( t \right)}{\mathrm{d}t} \\ \mathtt{car\_and\_suspension.spring\_damper.flange\_b.f}\left( t \right) = \mathtt{car\_and\_suspension.spring\_damper.f}\left( t \right) \\ \mathtt{car\_and\_suspension.spring\_damper.flange\_a.f}\left( t \right) = - \mathtt{car\_and\_suspension.spring\_damper.f}\left( t \right) \\ \mathtt{car\_and\_suspension.spring\_damper.f\_c}\left( t \right) = \mathtt{car\_and\_suspension.spring\_damper.c} \left( \mathtt{car\_and\_suspension.spring\_damper.s\_rel}\left( t \right) - \mathtt{car\_and\_suspension.spring\_damper.initial\_stretch}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{car\_and\_suspension.spring\_damper.initial\_stretch}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{car\_and\_suspension.spring\_damper.f\_d}\left( t \right) = \mathtt{car\_and\_suspension.spring\_damper.d} \mathtt{car\_and\_suspension.spring\_damper.v\_rel}\left( t \right) \\ \mathtt{car\_and\_suspension.spring\_damper.f}\left( t \right) = \mathtt{car\_and\_suspension.spring\_damper.f\_d}\left( t \right) + \mathtt{car\_and\_suspension.spring\_damper.f\_c}\left( t \right) \\ \mathtt{car\_and\_suspension.spring\_damper.lossPower}\left( t \right) = \mathtt{car\_and\_suspension.spring\_damper.v\_rel}\left( t \right) \mathtt{car\_and\_suspension.spring\_damper.f\_d}\left( t \right) \\ \mathrm{connect}\left( flange_{m}, mass_{+}flange_{b}, spring_{damper_{+}flange\_a} \right) \\ \mathrm{connect}\left( spring_{damper_{+}flange\_b}, flange_{sd} \right) \\ \mathtt{seat.mass.flange\_a.s}\left( t \right) = - \frac{1}{2} \mathtt{seat.mass.L} + \mathtt{seat.mass.s}\left( t \right) \\ \mathtt{seat.mass.flange\_b.s}\left( t \right) = \frac{1}{2} \mathtt{seat.mass.L} + \mathtt{seat.mass.s}\left( t \right) \\ \mathtt{seat.mass.v}\left( t \right) = \frac{\mathrm{d} \mathtt{seat.mass.s}\left( t \right)}{\mathrm{d}t} \\ \mathtt{seat.mass.a}\left( t \right) = \frac{\mathrm{d} \mathtt{seat.mass.v}\left( t \right)}{\mathrm{d}t} \\ \left( \mathtt{seat.mass.a}\left( t \right) + \mathtt{seat.mass.g} \sin\left( \mathtt{seat.mass.theta} \right) \right) \mathtt{seat.mass.m} = \mathtt{seat.mass.flange\_b.f}\left( t \right) + \mathtt{seat.mass.flange\_a.f}\left( t \right) \\ \mathtt{seat.spring\_damper.s\_rel}\left( t \right) = \mathtt{seat.spring\_damper.flange\_b.s}\left( t \right) - \mathtt{seat.spring\_damper.flange\_a.s}\left( t \right) \\ \mathtt{seat.spring\_damper.v\_rel}\left( t \right) = \frac{\mathrm{d} \mathtt{seat.spring\_damper.s\_rel}\left( t \right)}{\mathrm{d}t} \\ \mathtt{seat.spring\_damper.flange\_b.f}\left( t \right) = \mathtt{seat.spring\_damper.f}\left( t \right) \\ \mathtt{seat.spring\_damper.flange\_a.f}\left( t \right) = - \mathtt{seat.spring\_damper.f}\left( t \right) \\ \mathtt{seat.spring\_damper.f\_c}\left( t \right) = \mathtt{seat.spring\_damper.c} \left( \mathtt{seat.spring\_damper.s\_rel}\left( t \right) - \mathtt{seat.spring\_damper.initial\_stretch}\left( t \right) \right) \\ \frac{\mathrm{d} \mathtt{seat.spring\_damper.initial\_stretch}\left( t \right)}{\mathrm{d}t} = 0 \\ \mathtt{seat.spring\_damper.f\_d}\left( t \right) = \mathtt{seat.spring\_damper.d} \mathtt{seat.spring\_damper.v\_rel}\left( t \right) \\ \mathtt{seat.spring\_damper.f}\left( t \right) = \mathtt{seat.spring\_damper.f\_d}\left( t \right) + \mathtt{seat.spring\_damper.f\_c}\left( t \right) \\ \mathtt{seat.spring\_damper.lossPower}\left( t \right) = \mathtt{seat.spring\_damper.f\_d}\left( t \right) \mathtt{seat.spring\_damper.v\_rel}\left( t \right) \\ \mathtt{road\_data.y}\left( t \right) = ifelse\left( rem\left( t, \mathtt{road\_data.loop} \right) < \mathtt{road\_data.offset}, 0, ifelse\left( - \mathtt{road\_data.offset} + rem\left( t, \mathtt{road\_data.loop} \right) > \mathtt{road\_data.freq}, 0, \mathtt{road\_data.bump} \left( 1 - \cos\left( \frac{6.2832 \left( - \mathtt{road\_data.offset} + t \right)}{\mathtt{road\_data.freq}} \right) \right) \right) \right) \\ \mathtt{road.v}\left( t \right) = \frac{\mathrm{d} \mathtt{road.s}\left( t \right)}{\mathrm{d}t} \\ \mathtt{road.a}\left( t \right) = \frac{\mathrm{d} \mathtt{road.v}\left( t \right)}{\mathrm{d}t} \\ \mathtt{road.flange.s}\left( t \right) = \mathtt{road.s}\left( t \right) \\ \mathtt{force.flange\_a.f}\left( t \right) = \mathtt{force.f}\left( t \right) \\ \mathtt{force.flange\_b.f}\left( t \right) = - \mathtt{force.f}\left( t \right) \\ \frac{\mathrm{d} \mathtt{pid.x}\left( t \right)}{\mathrm{d}t} = \mathtt{pid.dx}\left( t \right) \\ \frac{\mathrm{d} \mathtt{pid.dx}\left( t \right)}{\mathrm{d}t} = \mathtt{pid.ddx}\left( t \right) \\ \frac{\mathrm{d} \mathtt{pid.y}\left( t \right)}{\mathrm{d}t} = \mathtt{pid.dy}\left( t \right) \\ \mathtt{pid.err\_input}\left( t \right) = \mathtt{pid.x}\left( t \right) \\ \mathtt{pid.ctr\_output}\left( t \right) = \mathtt{pid.y}\left( t \right) \\ \mathtt{pid.dy}\left( t \right) = \left( \mathtt{pid.dx}\left( t \right) + \mathtt{pid.kd} \mathtt{pid.ddx}\left( t \right) + \mathtt{pid.ki} \mathtt{pid.x}\left( t \right) \right) \mathtt{pid.kp} \\ \mathtt{err.y}\left( t \right) = \mathtt{err.k1} \mathtt{err.u1}\left( t \right) + \mathtt{err.k2} \mathtt{err.u2}\left( t \right) \\ \mathtt{set\_point.y}\left( t \right) = \mathtt{set\_point.k} \\ 0 = \mathtt{seat\_pos.flange.f}\left( t \right) \\ \mathtt{seat\_pos.flange.s}\left( t \right) = \mathtt{seat\_pos.s}\left( t \right) \\ \mathtt{flip.y}\left( t \right) = \mathtt{flip.k} \mathtt{flip.u}\left( t \right) \\ \end{array} \right] \end{equation} \]

Source

component ActiveSuspension
  wheel = MassSpringDamper(m=wheel_mass, d=wheel_damping, c=wheel_stiffness, g=-10, theta=pi/2, s0=wheel_initial_position) [{
    "JuliaSim": {"placement": {"icon": {"x1": 825, "y1": 675, "x2": 925, "y2": 775, "rot": 90}}}
  }]
  car_and_suspension = MassSpringDamper(m=car_mass, d=suspension_damping, c=suspension_stiffness, g=-10, theta=pi/2, s0=suspension_initial_position) [{
    "JuliaSim": {"placement": {"icon": {"x1": 825, "y1": 500, "x2": 925, "y2": 600, "rot": 90}}}
  }]
  seat = MassSpringDamper(m=human_and_seat_mass, d=seat_damping, c=seat_stiffness, g=-10, theta=pi/2, s0=seat_initial_position) [{
    "JuliaSim": {"placement": {"icon": {"x1": 825, "y1": 325, "x2": 925, "y2": 425, "rot": 90}}}
  }]
  road_data = RoadData() [{
    "JuliaSim": {"placement": {"icon": {"x1": 500, "y1": 730, "x2": 600, "y2": 830}}}
  }]
  road = SimplePosition() [{
    "JuliaSim": {"placement": {"icon": {"x1": 650, "y1": 730, "x2": 750, "y2": 830}}}
  }]
  force = TranslationalComponents.Force() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 650, "y1": 325, "x2": 750, "y2": 425, "rot": 270}}
    }
  }]
  pid = Controller(kp=kp, ki=ki, kd=kd, y0=0) [{
    "JuliaSim": {"placement": {"icon": {"x1": 350, "y1": 325, "x2": 450, "y2": 425}}}
  }]
  err = BlockComponents.Add(k1=1, k2=-1) [{
    "JuliaSim": {"placement": {"icon": {"x1": 200, "y1": 325, "x2": 300, "y2": 425}}}
  }]
  set_point = BlockComponents.Constant(k=1.5) [{
    "JuliaSim": {"placement": {"icon": {"x1": 50, "y1": 355, "x2": 150, "y2": 455}}}
  }]
  seat_pos = TranslationalComponents.PositionSensor() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 700, "y1": 150, "x2": 800, "y2": 250, "rot": 180}}
    }
  }]
  flip = BlockComponents.Gain(k=-1) [{
    "JuliaSim": {"placement": {"icon": {"x1": 500, "y1": 325, "x2": 600, "y2": 425}}}
  }]
  parameter wheel_mass::JSML.Mass = 25
  parameter wheel_stiffness::TranslationalSpringConstant = 1e2
  parameter wheel_damping::DampingCoefficient = 1e4
  parameter car_mass::JSML.Mass = 1000
  parameter suspension_stiffness::TranslationalSpringConstant = 1e4
  parameter suspension_damping::DampingCoefficient = 10
  parameter human_and_seat_mass::JSML.Mass = 100
  parameter seat_stiffness::TranslationalSpringConstant = 1000
  parameter seat_damping::DampingCoefficient = 1
  parameter wheel_initial_position::JSML.Position = 0.5
  parameter suspension_initial_position::JSML.Position = 1
  parameter seat_initial_position::JSML.Position = 1.5
  parameter kd::Real = 20
  parameter ki::Real = 0.2
  parameter kp::Real = 1
relations
  connect(road.s, road_data.y) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(road.flange, wheel.flange_sd) [{"JuliaSim": {"edges": [{"S": 2, "M": [{"x": 875, "y": 780}], "E": 1}]}}]
  connect(wheel.flange_m, car_and_suspension.flange_sd) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(car_and_suspension.flange_m, seat.flange_sd, force.flange_a) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "E": 2},
        {"S": -1, "M": [{"x": 700, "y": 440}], "E": 3}
      ],
      "junctions": [{"x": 875, "y": 440}]
    }
  }]
  connect(seat.flange_m, force.flange_b, seat_pos.flange) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "M": [{"x": 700, "y": 310}], "E": 2},
        {"S": -1, "M": [{"x": 875, "y": 200}], "E": 3}
      ],
      "junctions": [{"x": 875, "y": 310}]
    }
  }]
  connect(err.u1, seat_pos.s) [{
    "JuliaSim": {"edges": [{"S": 2, "M": [{"x": 182, "y": 200}, {"x": 182, "y": 345}], "E": 1}]}
  }]
  connect(err.u2, set_point.y) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(err.y, pid.err_input) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(pid.ctr_output, flip.u) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(flip.y, force.f) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
metadata {
  "JuliaSim": {
    "tests": {
      "case1": {
        "stop": 10,
        "expect": {
          "initial": {
            "wheel.spring_damper.initial_stretch": 112,
            "car_and_suspension.spring_damper.initial_stretch": 0.6,
            "seat.spring_damper.initial_stretch": 0.5
          },
          "final": {
            "wheel.spring_damper.initial_stretch": 112,
            "car_and_suspension.spring_damper.initial_stretch": 0.6,
            "seat.spring_damper.initial_stretch": 0.5
          },
          "signals": [
            "wheel.mass.s",
            "seat.mass.s",
            "car_and_suspension.mass.s",
            "wheel.mass.v",
            "car_and_suspension.mass.v",
            "seat.mass.v",
            "pid.y"
          ]
        }
      }
    }
  }
}
end
Flattened Source
component ActiveSuspension
  wheel = MassSpringDamper(m=wheel_mass, d=wheel_damping, c=wheel_stiffness, g=-10, theta=pi/2, s0=wheel_initial_position) [{
    "JuliaSim": {"placement": {"icon": {"x1": 825, "y1": 675, "x2": 925, "y2": 775, "rot": 90}}}
  }]
  car_and_suspension = MassSpringDamper(m=car_mass, d=suspension_damping, c=suspension_stiffness, g=-10, theta=pi/2, s0=suspension_initial_position) [{
    "JuliaSim": {"placement": {"icon": {"x1": 825, "y1": 500, "x2": 925, "y2": 600, "rot": 90}}}
  }]
  seat = MassSpringDamper(m=human_and_seat_mass, d=seat_damping, c=seat_stiffness, g=-10, theta=pi/2, s0=seat_initial_position) [{
    "JuliaSim": {"placement": {"icon": {"x1": 825, "y1": 325, "x2": 925, "y2": 425, "rot": 90}}}
  }]
  road_data = RoadData() [{
    "JuliaSim": {"placement": {"icon": {"x1": 500, "y1": 730, "x2": 600, "y2": 830}}}
  }]
  road = SimplePosition() [{
    "JuliaSim": {"placement": {"icon": {"x1": 650, "y1": 730, "x2": 750, "y2": 830}}}
  }]
  force = TranslationalComponents.Force() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 650, "y1": 325, "x2": 750, "y2": 425, "rot": 270}}
    }
  }]
  pid = Controller(kp=kp, ki=ki, kd=kd, y0=0) [{
    "JuliaSim": {"placement": {"icon": {"x1": 350, "y1": 325, "x2": 450, "y2": 425}}}
  }]
  err = BlockComponents.Add(k1=1, k2=-1) [{
    "JuliaSim": {"placement": {"icon": {"x1": 200, "y1": 325, "x2": 300, "y2": 425}}}
  }]
  set_point = BlockComponents.Constant(k=1.5) [{
    "JuliaSim": {"placement": {"icon": {"x1": 50, "y1": 355, "x2": 150, "y2": 455}}}
  }]
  seat_pos = TranslationalComponents.PositionSensor() [{
    "JuliaSim": {
      "placement": {"icon": {"x1": 700, "y1": 150, "x2": 800, "y2": 250, "rot": 180}}
    }
  }]
  flip = BlockComponents.Gain(k=-1) [{
    "JuliaSim": {"placement": {"icon": {"x1": 500, "y1": 325, "x2": 600, "y2": 425}}}
  }]
  parameter wheel_mass::JSML.Mass = 25
  parameter wheel_stiffness::TranslationalSpringConstant = 1e2
  parameter wheel_damping::DampingCoefficient = 1e4
  parameter car_mass::JSML.Mass = 1000
  parameter suspension_stiffness::TranslationalSpringConstant = 1e4
  parameter suspension_damping::DampingCoefficient = 10
  parameter human_and_seat_mass::JSML.Mass = 100
  parameter seat_stiffness::TranslationalSpringConstant = 1000
  parameter seat_damping::DampingCoefficient = 1
  parameter wheel_initial_position::JSML.Position = 0.5
  parameter suspension_initial_position::JSML.Position = 1
  parameter seat_initial_position::JSML.Position = 1.5
  parameter kd::Real = 20
  parameter ki::Real = 0.2
  parameter kp::Real = 1
relations
  connect(road.s, road_data.y) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(road.flange, wheel.flange_sd) [{"JuliaSim": {"edges": [{"S": 2, "M": [{"x": 875, "y": 780}], "E": 1}]}}]
  connect(wheel.flange_m, car_and_suspension.flange_sd) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(car_and_suspension.flange_m, seat.flange_sd, force.flange_a) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "E": 2},
        {"S": -1, "M": [{"x": 700, "y": 440}], "E": 3}
      ],
      "junctions": [{"x": 875, "y": 440}]
    }
  }]
  connect(seat.flange_m, force.flange_b, seat_pos.flange) [{
    "JuliaSim": {
      "edges": [
        {"S": -1, "E": 1},
        {"S": -1, "M": [{"x": 700, "y": 310}], "E": 2},
        {"S": -1, "M": [{"x": 875, "y": 200}], "E": 3}
      ],
      "junctions": [{"x": 875, "y": 310}]
    }
  }]
  connect(err.u1, seat_pos.s) [{
    "JuliaSim": {"edges": [{"S": 2, "M": [{"x": 182, "y": 200}, {"x": 182, "y": 345}], "E": 1}]}
  }]
  connect(err.u2, set_point.y) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(err.y, pid.err_input) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(pid.ctr_output, flip.u) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
  connect(flip.y, force.f) [{"JuliaSim": {"edges": [{"S": 2, "E": 1}]}}]
metadata {
  "JuliaSim": {
    "tests": {
      "case1": {
        "stop": 10,
        "expect": {
          "initial": {
            "wheel.spring_damper.initial_stretch": 112,
            "car_and_suspension.spring_damper.initial_stretch": 0.6,
            "seat.spring_damper.initial_stretch": 0.5
          },
          "final": {
            "wheel.spring_damper.initial_stretch": 112,
            "car_and_suspension.spring_damper.initial_stretch": 0.6,
            "seat.spring_damper.initial_stretch": 0.5
          },
          "signals": [
            "wheel.mass.s",
            "seat.mass.s",
            "car_and_suspension.mass.s",
            "wheel.mass.v",
            "car_and_suspension.mass.v",
            "seat.mass.v",
            "pid.y"
          ]
        }
      }
    }
  }
}
end

Test Cases

Test Case case1

Signal `wheel.mass.s` for test `case1` of `ActiveSuspension`

Signal `seat.mass.s` for test `case1` of `ActiveSuspension`

Signal `car_and_suspension.mass.s` for test `case1` of `ActiveSuspension`

Signal `wheel.mass.v` for test `case1` of `ActiveSuspension`

Signal `car_and_suspension.mass.v` for test `case1` of `ActiveSuspension`

Signal `seat.mass.v` for test `case1` of `ActiveSuspension`

Signal `pid.y` for test `case1` of `ActiveSuspension`

  • Examples
  • Experiments
  • Analyses