Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.8K 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
Attachments:
POSTED BY: Patrik Ekenberg
Posted 9 years ago

Also, I'm struggling over how to set values in an array using Mathematica sliders.

enter image description here

POSTED BY: Ch' Prof
Posted 9 years ago

Thank you Patrik,

As you can see, my first model is soon finished :

enter image description here

But nevertheless, here comes a new question.

I would like to add a checkerboard ground to my simulation, like in this model.

enter image description here

I haven't been able to see how it's been done. Could you explain it ?

POSTED BY: Ch' Prof
Attachments:
POSTED BY: Patrik Ekenberg
Posted 9 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 9 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
POSTED BY: Ch' Prof
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard