18 lines
1.4 KiB
Plaintext
18 lines
1.4 KiB
Plaintext
within AIDAModelica;
|
|
|
|
model ComputationAngularAccelerationModel "Computation Angular Acceleration Model"
|
|
import Modelica.Math;
|
|
Modelica.Blocks.Interfaces.RealInput Moments[3](each quantity = "Mechanics.Rotation.Torque", each displayUnit = "Nm") "'input Real' as connector" annotation(
|
|
Placement(transformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}), iconTransformation(extent = {{-95, -20}, {-55, 20}})));
|
|
Modelica.Blocks.Interfaces.RealOutput DroneAngularAcceleration[3](each quantity = "Mechanics.Rotation.RotAccel", each displayUnit = "rad/s²") "'output Real' as connector" annotation(
|
|
Placement(transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(extent = {{61.7, -10}, {81.7, 10}})));
|
|
parameter Real J[3, 3] = {{0.009074, 0, 0}, {0, 0.009074, 0}, {0, 0, 0.013279}} "Diagonal matrix of inertia";
|
|
Real invJ[3, 3] "Inverse of matrix J";
|
|
equation
|
|
// enter your equations here
|
|
invJ = Modelica.Math.Matrices.inv(J);
|
|
DroneAngularAcceleration = invJ * Moments;
|
|
annotation(
|
|
Icon(coordinateSystem(extent = {{-75, -50}, {75, 50}}, initialScale = 0.1), graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-76.7, 50}, {76.7, -50}}), Text(origin = {-5, 4}, extent = {{-11, 6}, {11, -6}}, textString = "%name")}));
|
|
end ComputationAngularAccelerationModel;
|