Modelica: use of der() in a custom class/model -


I am trying to learn modelica and I have built a very simple model using multibody libraries. The model has a world object and is connected to a body (mass) beams, which is then connected to 2 expanded partial onframe_e classes (see below) which I modified to make constant force in an axis. Essentially this group of all objects falls under gravity and revolves around due to two forces, make a couple about the CG in the offset segment from the body center.

  Model Constant_Force Modelica extends Mechanics.MultiBody.Interfaces.PartialOneFrame_a; Parameter Real Force = 1.0; Equation frame_a.f = {0.0,0.0, force}; Frame_a.t = {0.0,0.0,0.0}; And Constant_ Force;   

I wanted to see if I could make a very simple aerodynamic force component which I would connect to the end of a 'rotating' arms. My idea was to follow the example of the Constant_force model above and for my first simple deduction forces generated on the basis of local frame velocities. This is where my problem arose - I tried to calculate the velocity using the fear (frames_arraj), which I wanted to convert to local frames through the process of solving, but der ... ) By adding the line the model was not working properly - it would simulate 'successfully' (using OpenModelica), but the V11b vector (see below) will be all zero, so fear (frame_ar.j.) which Conspiracy They had appeared for gram - not only that, all other constituent behaviors were still right at zero - (frame_ARR, body w_a etc.). Model AroSurf Modelica. Mechanics Multibidine Interface.partialonframe_a; Import Modelica.Mechanics.MultiBody.Frames; Import Modelica.SIunits; // Real [3] v11b; SIunits.Velocity v11b [3]; // initial equation // v11b = {0.0,0.0,0.0}; Algorithm //v11b:=der(frame_a.r_0); Equation v11b = fear (frames_arj.); Frame_a.f = {0.0,0.0,0.0}; Frame_a.t = {0.0,0.0,0.0}; End aerosurph; I have tried several ways to calculate the velocity (you will see from the commented lines), then I can check the correct behavior but there is no advantage. I used the algorithm or the equation approach - I received some different (but wrong behavior) with different approaches.

Any tips? I should remember something fundamental, it seems that the frame component does not take spontaneous motion vector, so I have to calculate it ??

Using the Modelica.Mechanics.MultiBody.Sensors.AbsoluteVelocity block from MSL The easiest way to do this is to connect it to your MB frame, then use the output variable, connector in your equation.

Comments