Hello Everybody!
I'm new to Modelica and i want to learn by realizing a first project: implementing an model aircraft.
The Pendulum example works fine, so i guess it should work in theory...
I want to attach a motor (1-D-mechanics) to the aircrafts body by adding this model to ModelicaAdditions.MultiBody.Parts.Mounting1D. (Gyro-effects will be neglected but the reaction-torque is neccessary)
model Mounting1D
extends Interfaces.OneFrame_a;
import ModelicaAdditions.MultiBody.Interfaces;
parameter Modelica.SIunits.Angle phi0=0 "Fixed offset angle of housing";
parameter ModelicaAdditions.MultiBody.Types.Axis n={0,1,0}
"Axis of rotation = axis of support torque (resolved in frame_a)";
Modelica.Mechanics.Rotational.Interfaces.Flange_b flange_b
"(right) flange fixed in housing";
//Interfaces.Frame_a frame_a ;
equation
flange_b.phi = phi0;
frame_a.f=zeros(3);
frame_a.t = -n*flange_b.tau;
end Mounting1D;
Now, i tried the following test:
>> loadModel(Modelica)
true
>> loadModel(ModelicaAdditions.MultiBody)
true
>> model TestMounting1D
import Modelica.Mechanics.Rotational;
import ModelicaAdditions.MultiBody.Joints;
import ModelicaAdditions.MultiBody.Parts;
Parts.InertialSystem inertialSystem;
Parts.Mounting1D mounting1D;
Modelica.Mechanics.Rotational.Spring spring(c=1);
Modelica.Mechanics.Rotational.Inertia inertia(J=1);
//Parts.Body body;
equation
connect(inertia.flange_b,spring.flange_a);
connect(spring.flange_a, mounting1D.flange_b);
connect(inertialSystem.frame_b, mounting1D.frame_a);
//connect(inertialSystem.frame_b, body.frame_a);
end TestMounting1D;
Ok
>> simulate(TestMounting1D,stopTime=1.0)
record SimulationResult
resultFile = "Simulation failed.
"
end SimulationResult;
>> readFile("output.log")
"Error, input data file does not match model.
nx in initfile: 0 from model code :2
ny in initfile: 111 from model code :44
np in initfile: 9 from model code :7
npstr in initfile: 2 from model code: 2
nystr in initfile: 0 from model code: 0
"
I have no idea what went wrong there.
Can someone help please?
Thanks!
joerg