|
|
|
|
within AIDAModelica;
|
|
|
|
|
|
|
|
|
|
model RigidBodyDynamicModel "Rigid body dynamic model"
|
|
|
|
|
// CP: 65001
|
|
|
|
|
// SimulationX Version: 3.8.2.45319 x64
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput Moments[3](quantity = "Mechanics.Rotation.Torque", displayUnit = "Nm") "Moments" annotation(
|
|
|
|
|
Placement(transformation(extent = {{-75, 55}, {-35, 95}}), iconTransformation(extent = {{-120, -70}, {-80, -30}})));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput TotalThrust(quantity = "Mechanics.Translation.Force", displayUnit = "N") "Total Thrust" annotation(
|
|
|
|
|
Placement(transformation(extent = {{-75, -15}, {-35, 25}}), iconTransformation(extent = {{-120, 30}, {-80, 70}})));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput Attitude[3](quantity = "Mechanics.Rotation.Angle", displayUnit = "rad") "Attitude input" annotation(
|
|
|
|
|
Placement(transformation(extent = {{-75, 25}, {-35, 65}}), iconTransformation(origin = {0, 100}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput DroneAngularVelocities[3](quantity = "Mechanics.Rotation.RotAccel", displayUnit = "rad/s²") "Drone angular velocities" annotation(
|
|
|
|
|
Placement(transformation(extent = {{0, 50}, {20, 70}}), iconTransformation(extent = {{90, 40}, {110, 60}})));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput DroneVelocity[3](quantity = "Mechanics.Translation.Accel", displayUnit = "m/s²") "Drone velocity" annotation(
|
|
|
|
|
Placement(transformation(extent = {{70, 20}, {90, 40}}), iconTransformation(extent = {{90, -10}, {110, 10}})));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput ExternalForce[3] annotation(
|
|
|
|
|
Placement(transformation(extent = {{-75, -50.7}, {-35, -10.7}}), iconTransformation(extent = {{-20, -120}, {20, -80}})));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput Accelerations[3] "'output Real' as connector" annotation(
|
|
|
|
|
Placement(transformation(extent = {{65, 5}, {85, 25}}), iconTransformation(extent = {{90, -60}, {110, -40}})));
|
|
|
|
|
ComputeDroneVelocity computeDroneVelocity1 annotation(
|
|
|
|
|
Placement(transformation(extent = {{-20, 10}, {0, 35}})));
|
|
|
|
|
ComputeDroneAngularsVelocities computeDroneAngularsVelocities1 annotation(
|
|
|
|
|
Placement(transformation(extent = {{-30, 70}, {-15, 80}})));
|
|
|
|
|
equation
|
|
|
|
|
// enter your equations here
|
|
|
|
|
equation
|
|
|
|
|
connect(computeDroneVelocity1.Attitude, Attitude[:]) annotation(
|
|
|
|
|
Line(points = {{-9.333328247070313, 35}, {-15, 35}, {-50, 35}, {-50, 45}, {-55, 45}}, color = {0, 0, 127}, thickness = 0.0625),
|
|
|
|
|
AutoRoute = false);
|
|
|
|
|
connect(computeDroneVelocity1.TotalThrust, TotalThrust) annotation(
|
|
|
|
|
Line(points = {{-20, 28.7}, {-25, 28.7}, {-50, 28.7}, {-50, 5}, {-55, 5}}, color = {0, 0, 127}, thickness = 0.0625));
|
|
|
|
|
connect(computeDroneAngularsVelocities1.Moments[:], Moments[:]) annotation(
|
|
|
|
|
Line(points = {{-30, 75}, {-35, 75}, {-50, 75}, {-55, 75}}, color = {0, 0, 127}, thickness = 0.0625));
|
|
|
|
|
connect(computeDroneAngularsVelocities1.DroneAngularVelocities[:], DroneAngularVelocities[:]) annotation(
|
|
|
|
|
Line(points = {{-15.3, 75}, {-10.3, 75}, {5, 75}, {5, 60}, {10, 60}}, color = {0, 0, 127}, thickness = 0.0625));
|
|
|
|
|
connect(computeDroneVelocity1.DroneVelocity[:], DroneVelocity[:]) annotation(
|
|
|
|
|
Line(points = {{0, 28.7}, {5, 28.7}, {75, 28.7}, {75, 30}, {80, 30}}, color = {0, 0, 127}, thickness = 0.0625));
|
|
|
|
|
connect(ExternalForce[:], computeDroneVelocity1.ExternalForce[:]) annotation(
|
|
|
|
|
Line(points = {{-55, -30.7}, {-50, -30.7}, {-25, -30.7}, {-25, 16.3}, {-20, 16.3}}));
|
|
|
|
|
connect(computeDroneVelocity1.Accelerations[:], Accelerations[:]) annotation(
|
|
|
|
|
Line(points = {{0, 16.3}, {5, 16.3}, {70, 16.3}, {70, 15}, {75, 15}}, color = {0, 0, 127}, thickness = 0.0625));
|
|
|
|
|
annotation(
|
|
|
|
|
Moments(flags = 2),
|
|
|
|
|
TotalThrust(flags = 2),
|
|
|
|
|
Attitude(flags = 2),
|
|
|
|
|
DroneAngularVelocities(flags = 2),
|
|
|
|
|
DroneVelocity(flags = 2),
|
|
|
|
|
ExternalForce(flags = 2),
|
|
|
|
|
computeDroneVelocity1(TotalThrust(flags = 2), Attitude(flags = 2), DroneVelocity(flags = 2), ExternalForce(flags = 2), computationAccelerationModel1(TotalThrust(flags = 2), Attitude(flags = 2), DroneAcceleration(flags = 2), ExternalForce(flags = 2), Reb(flags = 2), Rz(flags = 2), Ry(flags = 2), Rx(flags = 2)), integrator4(u(flags = 2), y(flags = 2)), integrator5(u(flags = 2), y(flags = 2)), integrator6(u(flags = 2), y(flags = 2))),
|
|
|
|
|
computeDroneAngularsVelocities1(Moments(flags = 2), DroneAngularVelocities(flags = 2), computationAngularAccelerationModel1(Moments(flags = 2), DroneAngularAcceleration(flags = 2), invJ(flags = 2)), integrator1(u(flags = 2), y(flags = 2)), integrator2(u(flags = 2), y(flags = 2)), integrator3(u(flags = 2), y(flags = 2))),
|
|
|
|
|
Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {103.3, -100}}), Text(origin = {-3, 10}, extent = {{-23, 10}, {23, -10}}, textString = "%name")}, coordinateSystem(initialScale = 0.1)),
|
|
|
|
|
experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001"));
|
|
|
|
|
end RigidBodyDynamicModel;
|