Note that there are some explanatory texts on larger screens.

plurals
  1. POModelica: use of der() in a custom class/model
    primarykey
    data
    text
    <p>I'm trying to learn Modelica and I have constructed a very simple model using the multibody library. the model consists of a world object and a body (mass) connected to to beams which are then connected to 2 extended PartialOneFrame_a classes (see below) which I modified to create a constant force in one axis. essentially all this group of objects does is fall under gravity and spin around due to the two forces acting at a longituidnal offset from the body center creating a couple about the cg.</p> <pre><code> model Constant_Force extends Modelica.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}; end Constant_Force; </code></pre> <p>I next wanted see if I could create a very simple aerodynamic force component which I would connect to the end of one the rotating 'arms'. My idea was to follow the example of the Constant_force model above and for my first simple cut generate forces based on the local frame velocities. This where my problem arose - I tried to compute the velocity using der(frame_a.r_0) which I was then going to transform to local frame using resolve2 function but adding the der(...) line caused the model to not work properly - it would 'successfully' simulate (using OpenModelica) but the v11b vector (see below) would be all zeros, so would der(frame_a.r_0) that appeared for plot plotting - not only that, all the other component behaviors were now also just zero constantly - (frame_a.r_0, w_a etc of the body).</p> <pre><code> model Aerosurf extends Modelica.Mechanics.MultiBody.Interfaces.PartialOneFrame_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=der(frame_a.r_0); frame_a.f = {0.0,0.0,0.0}; frame_a.t = {0.0,0.0,0.0}; end Aerosurf; </code></pre> <p>I tried a number of ways just to simply compute the velocities (you will see from the commented lines) so i could plot to check correct behavior but to no avail. I used algorithm or equation approach - I did acheive some different (but also incorrect behaviours) with the different approaches.</p> <p>Any tips? I must be missing something fundamental here, it seems the frame component does not inherently carry the velocity vector so I must have to compute it??</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload