Group Abstract Group Abstract

Message Boards Message Boards

0
|
10K Views
|
9 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Modeling a brick subjected to gravity with SystemModeler?

Posted 10 years ago

Most of the questions on this forum are of way higher level than those I need to ask, but I haven't found any other place, so here they come.

As my first (and only so far) achievement with SystemModeler, I was able to design a brick and have it subjected to gravity.

But when the simulation starts, it goes straight through the ground.

1) Why doesn't my brick simply lie on the ground ?

2) How do I apply a constant force on my brick in a chosen direction ? I found a relatively close example but it involves several models I don't understand and can't adapt to what I intend to do.

3) I saw several animations in which it was possible to change the value of a parameter (say, the brick's mass, the force applied,...) with a slider, but all had been designed exclusively with Mathematica. Is it available in SM also ? (and where ?)

Thank you for helping a free-lance amateur.

POSTED BY: Ch' Prof
9 Replies
Posted 10 years ago
POSTED BY: Ch' Prof
Posted 10 years ago
POSTED BY: Ch' Prof
Attachments:
POSTED BY: Patrik Ekenberg
Posted 10 years ago

I need some other information though :

  1. What does "Frame in which input force is resolved" mean ? enter image description here

  2. Also, is there an option somewhere to have forces vectors "nose out" ?

  3. Can I setup the initial position of the camera ?

  4. I would like to have sliders to easily setup my simulation, just like in this demonstration. Are they available in SM as in Mathematica ?

enter image description here

POSTED BY: Ch' Prof
Posted 10 years ago

I resumed practicing with SM this afternoon and thanks to your explanations, got it now. I made huge progress.

Here is what I'm trying to design : a very simple simulation that allows me to explain Newton's 1st and 2nd laws, and show why we use integration to go from acceleration to speed then to position :

enter image description here

You setup masses, velocities and forces on 2 different mobiles, and compare their evolutions.

Thanks again Patrik !

POSTED BY: Ch' Prof

I missed that you had replied to this thread, sorry!

I am glad that you found my tutorial helpful!

You can think of framea and frameb as two points in a coordinate system. The vector r[3] will describe their relative displacement from one another. If framea is in at {0,0,0}, and r[3]={1,1,0} then frameb will be located one unit along the x-axis and up one unit along the y-axis.

The BodyBox component will draw a rectangular parallelpiped between the origin and frameb. The location of the origin is determined by rshape[3] which is the vector from the point defined by framea to the box origin. The length of the body will be determined by the length of the vector r[3]-rshape[3], in Modelica written as:

Modelica.Math.Vectors.length(r - r_shape)

So if we use the previous example where framea is at point {0,0,0} and r[3]={1,1,0} then, as mentioned previously, frameb will be at point {1,1,0}. If r_shape[3]={0,1,0} then a body will be drawn between {1,0,0} since

r-r_shape={1,1,0}-{0,1,0}={1,0,0}

i.e one unit distance along the x-axis and it will have length 1. The width and height of the box is set by the width and height parameters respectively.

I have, however, never seen anyone use anything beside rshape[3]={0,0,0} which then means a body will be drawn between framea and frame_b. (As long as you haven't changed the length or lengthDirection parameters).

What is it you are trying to accomplish? Maybe I can be of better use if I know more.

POSTED BY: Patrik Ekenberg
Posted 10 years ago

Anyone ?

POSTED BY: Ch' Prof
Posted 10 years ago

Thank you very much Patrik, for your time and efforts.

I learned a lot more studying your tutorial this morning than during last few days.

A couple of things should be clarified though, regarding coordinates :

I understood r[3] and r_shape[3] decide of the position of a point of the BodyBox (Which point ?) and its orientation, but I can't figure out what frames are : on a Multibody/Parts/BodyBox, it looks like frame_a and frame_b aren't specific points on the box itself, like center of faces, what are they exactly ?

POSTED BY: Ch' Prof

Hi and welcome to the SystemModeler community!

I am assuming you used the Modelica MultiBody library for modelling your brick. I was looking for good introductory examples that explained the basic concepts of the MultiBody but did not find anything that I was satisfied with so I decided to write a tutorial.

I tried to make it general so that it could be useful for others also so I did not answer your questions directly there. I separated the instructions into 5 steps, and in the file that I attached you will find a model for each of the steps. Your first question (“Why doesn't my brick simply lie on the ground?”) will be answered in step/model 2 (BouncingSurface2). Your second question I will try and answer in step/model 3 (BouncingSurface3). Some of these things you might be familiar with already, so you can possibly skip ahead to step 2 and 3, or read it from the beginning.

Or if you just prefer the short answers: 1) Because you haven't yet added any equations or components that keep it up from falling through the ground and by there is be default a gravitational pull in the negative y-direction. You can remove the gravitational pull by changing the g parameter in the world component to 0. 2) You can for example use the Modelica.Mechanics.MultiBody.Forces.WorldForce block. To see how you can connect it up to your object, see model 3 (BouncingSurface3).

I attached the tutorial and the model to this post. I am thinking about refining it and making it a post here in the community, so if you decide to read it, and there is anything that you find that is unclear please let me know so I can polish it!

Cheers, Patrik!

Attachments:
POSTED BY: Patrik Ekenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard