Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
245 views

Lab 1

This document provides instructions for building a simple falling block model in Madymo. It describes how to create a new model, define rigid bodies for the block and floor, add surfaces, link the bodies with joints, and apply gravity. The objectives are to understand Madymo input files, contact definitions, and how to request output to validate the model against analytical solutions for a falling block.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views

Lab 1

This document provides instructions for building a simple falling block model in Madymo. It describes how to create a new model, define rigid bodies for the block and floor, add surfaces, link the bodies with joints, and apply gravity. The objectives are to understand Madymo input files, contact definitions, and how to request output to validate the model against analytical solutions for a falling block.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Introduction:

In this lab you will get your first exposure to constructing a model, running the solver and looking at output in Madymo. For this lab you will build a model from scratch to gain an understanding of the construction of an input file so that you will be able to better work with more complex models later in the laboratory sessions. In particular you will want to know how to define new contacts between body parts and structures as well as request output from your model to observe specific parameters (e.g. velocity, acceleration or forces acting on a body). Step-by-step instructions are provided for building a model of a falling block. You will then look at how the definition of different model parameters affects your outcomes. You will also analyze the falling block by hand using conservation of energy equations to validate your Madymo model predictions. Save your work often as Madymo may time out if you stop using it for a period of time (or if there is a sudden demand on licenses and yours isnt active it may allocate it to someone else).

Learning Objectives:
1) Understand the structure of a madymo input file and the definition of bodies and attributes. 2) Be familiar with contact definitions between objects. 3) Be able to request output from sensors in the model to correlate with analytical solutions.

Deliverables:
1) Input file (.xml) for you working falling block simulation. 2) Image of animation output and data plots (displayed side-by-side). 3) Comparison of output data and analytical solutions (submit complete analytical solutions of falling block using conservation of energy and balance of linear momentum). 4) Survey and Quiz (available on WebCT under Assessments).

Methods:
Creating a new model:
Double click on MADYMO/XMADgic icon to open the preprocessor. Go to file drop down menu and select new. Within the dialog box select Madymo and R7.3 then click OK. This will create a new model template file that looks like the picture below:

Figure 1: Template of a MADYMO model.

This template file provides all the math elements of the input file. As discussed in tutorial the components of the model are entered as systems. Each system should be a stand alone entity (e.g. if you move a system, all parts will move together such as a whole dummy, a vehicle, an environment etc). Note that the default units of Madymo are Newtons and metres. You need to create a system for your falling block simulation. Click on MADYMO at the top and look for SYSTEM.MODEL in the Element/Child pane (on the right hand side, click on the child tab to see a list of available commands). Scroll through the list (or click somewhere in the box type S to jump to commands starting with s). Double click on SYSTEM.MODEL to have that added as a child to your MADYMO input file. Double click on the NAME in the attribute pane (on the right of the screen) to add that as an attribute of the SYSTEM.MODEL. Now select a name for the system model e.g. falling-cube. There must be no space in the names in MADYMO (Figure 2). SAVE your work.

Figure 2: Building a system model in Madymo.

Defining Bodies in the Model: Each object that we add to our system needs to be added as a child (it will appear indented under system model). 1) We need to define the reference coordinate system. In the element/child pane double click CRDSYS_OBJECT.MB and add the attributes of NAME and POS to it. Set the position (POS) as 0 0 0 and call it ref-coord or any other name that you wish. 2) To add objects to your simulation requires a few components a. BODY.RIGID defines the mass, and inertia of your body (Figure 3). b. SURFACE.PLANE (or SURFACE.ELLIPSOID) is used in the definition of contact between bodies. c. JOINT (there are many suboptions) is used to define the motion of one object relative to another. Every body in the model needs to be connected either to the reference point or to another body via a joint. Unconnected bodies will result in errors.

Figure 3: Creating a rigid body in within the system model.

3) To add a floor to your simulation a. Create a BODY.RIGID under system model and NAME it floor. i. Notice that you can add attributes like CENTER_OF_GRAVITY, MASS, INERTIA, etc to it but it is not necessary at this point (these attributes are only required for moving objects whos motion is reactionary, not prescribed). b. Add a SURFACE.PLANE below (not as a child) BODY.RIGID and call it floor-plane. i. Add POINT1 POINT2 and POINT3 attributes as 3 of 4 corners of the plane (set them as 2 2 0, 0 2 0, and 0 0 0 respectively) note that the order of points are important as it determines the direction of the surface normal vector (used for contact). ii. Add the Body attribute to the list and set that as floor. That means the floor-plane surface belongs to the floor rigid.body. c. Now add a GROUP_MB under the SYSTEM.MODEL and add the SURFACE-LIST as attribute and set that as floor-plane. (this group definition is required for creating contacts later on). Now that you learned how to add a RIGID.BODY, try to do that and insert a cube into simulation. So define a new RIGID.BODY and call it Cube. Define its MASS, INERTIA, CENTER_Of_GRAVITY, etc (you need to calculate the xx, yy, zz, xy, yz, zx intertia for your block given its mass and dimensions). Add a SURFACE.ELLIPSOID and give it the attributes of name, semi-axis (Figure 4), degree. Play around to find out what these attributes do. When you create a SURFACE.ELLIPSOID it will include a CRDSYS_OBJECT_1.MB. To set the location of the surface ellipsoid with respect to the body add the attributes POS and BODY. Set the coordinate systems position, and relate it to the rigid body that you just created by setting its BODY attribute to Cube. Set the position to 0 0 0. SAVE your work. To construct a cube of dimensions height (h), width (w) and length (l) you assign semi-axes with dimensions h/2, w/2 and l/2. l

Figure 4: Defining the semi-axes of a cube.

Linking Bodies in the Model: At this point turn on the graphics viewer by clicking the icon on your toolbar or pushing F9. You will see the cube you created as well as the surface plane. The cube should be at the centre of your surface with half of the cube above the surface and half below (this is because you set the cg of your cube to be the center of the cube and you located the cube cg at the coordinate 0 0 0). Now we need to be able to describe the motion of the cube relative to the floor. Just like multibody dynamics problems you learned to solve in ENSC 282, Madymo calculates motion of bodies relative to eachother. Therefore you need to define the nature of the motion between two bodies through the use of joints. Bodies that are free to translate and rotate in any axes relative to another body (such as our falling block) are defined using free joints (no restrictions on any degree of freedom). There are many classes of joints from a bracket joint (JOINT.BRAC) which has zero degrees of freedom and locks one body relative to another to one degree of freedom translation (JOINT. Xxx) and one degree of freedom rotation (JOINT.ROT). Use the element definitions in the reference manual to see the descriptions of each joint. Every body in your simulation must be connected via a joint. The body can connect to another body or can connect directly to the reference point (if its motion is about the point of reference, though most bodies will NOT be).

1. Define a JOINT.BRAC to fix the floor plane to the Global Coordinate System. a. To link to a reference coordinate system you need to change the definition of the two connecting coordinate systems (by default a joint is defined to connect 2 rigid bodies). b. Right click on CRDSYS_OBJECT_1.MB and select change subclass (towards the bottom of the option list). Select CRDSYS_OBJECT_1.REF to define your joint as a connection between the reference coordinate system and a body. c. Add the attribute CRDSYS_REF under your CRDSYS_OBJECT_1.REF and select the coordinate system you already defined. d. Under CRDSYS_OBJECT_2.MB add the attributes BODY and POS to attach the floor to the reference coord system. 2. Define a JOINT.FREE to define the motion of cube with respect to the floor coordinate system (it can translate and rotate in any direction relative to the floor). Note that the location of the joint is important for determining the location and orientation of the cube (Figure 5)

Figure 5 a) A block oriented at 45 degrees when the joint is at the center of the block. B) a block oriented at 45 degrees when the joint is at the center of the floor.

a. Double click on JOINT.FREE in the elements list. b. Under CRDSYS_OBJECT_1.MB add the attributes POS and BODY. c. Body 1 needs to be a body that is already attached to another joint (the sequence of connections is important!) So, select the floor as your first body (as it is already connected to the reference point). Set the position as 0 0 1 to position the block 1 metre above the floor.

d. Body 2 is the block. As indicated in figure 2 you want the joint to be located at the center of the block therefore set the BODY to block and POS to 0 0 0. SAVE your work. We have now defined the two bodies in our system. Next we need to define the forces acting on the system. In this case we are analyzing a block that is free falling under the force of gravity. Gravity is a force that we would like applied to all elements of the model, therefore we will construct and apply to gravity function outside of the system model. It will then be available to be applied to all systems within our Madymo file. There are two steps for defining and applying gravity (or any external force/acceleration/motion). 1) Create a function for gravity. If must be defined as a FUNCTION.XY (where x is time and y is acceleration). a. To create the function outside of the SYSTEM.MODEL click on SYSTEM.MODEL, then look at the elements pane and click the below tab. Double click FUNCTION.XY. It will appear below the last element of your SYSTEM.MODEL and will not be indented (as the other commands are). b. Add a NAME to your function from the attributes list c. Enter the x and y coordinates of your function in the <![CDATA[ table. You must format your data table as follows (include the headings exactly as they are shown, the vertical lines must be included). | XI 0 10 YI -9.81 -9.81 |

d. Your function is not doing anything right now, we need to associate it with variables and apply it to your system. We are applying an acceleration (-9.81 m/s2) to the system so will use the LOAD.SYSTEM_ACC command. Be sure to add it below your function (not as child). e. As gravity acts in the z direction, select AZ_FUNC from the list of attributes as well as DESCRIPTION. f. Click to the right of AZ_FUNC and an option window opens. You are only allowed to select from previously defined functions. Select your gravity function. g. Click to the right of DESCRIPTION and name your acceleration load. h. Click to the right of SYSTEM_LIST and select ALL (this will apply gravity to all systems in your model). So we now have a block, a floor and a force of gravity. We are nearly done. However, we now need to define contact between our block and floor. Even though the bodies are connected through a joint without directly defining contact the two bodies will pass through each other as if the other is not there. In order to calculate a contact we need to know the contact properties of the objects. As you have learned from Hertz contact, contact between two bodies depends on the stiffness and geometry of the bodies. Madymo uses a contact algorithm to account for body geometry that then reduces the force to a point load (for computational efficiency). Refer to section 9.1 of the Theory manual if you are interested. There are 3 ways to define a contact; 1) using properties of the master object (assumes that the slave object is rigid), 2) using properties of the slave object (assumes that the master object is rigid), or 3) using properties of both objects (if they are of similar stiffness). There are several steps for defining a contact. 1) Define the properties of the bodies that will contact. We can either assign properties directly to the body, or define a general contact property for this scenario. We will assign contact properties to each object, as we will be adding more objects to this model later and want to use the objects in more than one contact definition. a. First define the contact function where x is deformation and y is force (in general you will need to look up the stiffness characteristics of the material you are using and convert to a force-deformation response using the geometry of the objects in contact, for now assume the floor is concrete and has a

b. c. d. e. f. g.

h. i.

j. k.

l. m.

stiffness K=1600kN/mm and fails at 0.4mm and the block is steel and has stiffness K=2000N/mm and fails at 0.5mm ). Define the functions as you did for gravity. Remember that compressive forces are negative so be sure to define your function for both positive and negative deformations. We now use these xy functions in defining our characteristic contacts. Click CHARACTERISTIC.CONTACT in the elements, below tab (do this twice, once for each material). Add attribute NAME and name your contact concrete_char. Click to the right of CONTACT_MODEL to select FORCE (you are using force-deformation data). Click to the right of LOAD_FUNC to select the function for your concrete. Repeat for steel. To assign the material properties to you objects return to your SYSTEM.MODEL and select the object surface (e.g. SURFACE.PLANE for the floor). Click on SURFACE.PLANE and add the attribute CHAR (this is the contact characteristic for the body). Click to the right of CHAR and you will be able to select from the contact characteristics you just defined. Repeat for the block. Now that we have assigned properties to each object, we need to specify that these two bodies will interact. We can do that either within our system model (if contact is between two bodies in the same system) or outside of the system model (if contact is between bodies from different systems). Select CONTACT.MB_MB from the elements list (this defines contact between two rigid bodies). Assign the floor as your master surface (SURFACE.PLANE has to be the master surface, thus you cannot define contact as being between two planes). Notice that you are choosing from your group definitions (not surfaces). This is why we defined a group for each of our bodies back in Step 1. Assign the block as your slave surface. For now, assign the contact type as COMBINED, since the material properties of the two contact bodies are similar (combined will account for the force/deformation characteristics of both surfaces). Save your work!

We are nearly done! The last part of the input file is to request outputs so that we can observe kinematic parameters of our falling block. For convenience we request outputs at the end of the input file (at the bottom of the list of commands) so they are all in one place and we can quickly see what outputs are being requested. We would like to know the velocity and acceleration of the falling block (to compare with our analytical solution) as well as the contact forces between the block and the floor. 1) Click on the last item in your madymo file. Then select and double click OUTPUT.BODY twice (one for velocity and one for acceleration). 2) To track velocity, add the attributes NAME, FILTER, EXTENDED_SAMPLING to your output command, set the parameters as follows a. NAME: block_vel (or whatever you like) b. FILTER: CFC1000 c. EXTENDED_SAMPLING: ON d. SIGNAL TYPE: LIN_VEL e. Under CRDSYS add the attributes BODY and POS so that the output data will be collected from the right part of your object (while position on the body is not important for linear motion it will become very important for rotating bodies!) i. BODY: block ii. POS: 0 0 0 (center of gravity of block). f. Repeat for acceleration using all the same parameters except SIGNAL TYPE: LIN_ACC. 3) We also want to track contact between the block and floor so add OUTPUT_CONTACT to your command list.

a. Add the NAME attribute. b. Select your block/floor contact in the contact list (do not select ALL, in larger models this will give you unmanageable amounts of data!). Save your file! The final step is to check the analysis parameters (those math commands that got added by default when you created a new Madymo file). We want to check two key parameters the run type of the analysis and the output requests. 1) Click on CONTROL_ANALYSIS.TIME and edit the TIME_END (the stop time of your analysis) to 0.5 sec. (use kinematic equations to determine approximately how long it will take for the block to fall 1 meter). 2) Click on CONTROL_OUTPUT and confirm that each of the output requests is set to ALL. (it doesnt matter if you collect data through your OUTPUT commands, you need to be sure they are being saved to a file.) Save your file! We are now done with building the input file. Take a look at the model geometry. You should have a block centered above a plane (floor) at a height of 1 metre. To avoid having to open the command prompt to run your model you need to set your Options in XMadgic to directly submit your run. 1) Click on the Options menu at the top of the screen. 2) Click on Madymo Release Settings a. Under the MADYMO Install Directory browse to the install folder C:\Program Files\Madymo\madymo_73 b. The other fields should auto populate. Click Done. 3) To submit your input file to the solver click on the Submit to Madymo icon (located below the Window and Help labels at the top of the screen). Be sure your file is saved before running. 4) You can watch the progress of the solver in the pane at the bottom of your screen. Once the run is finished you will see a message MADYMO run ended. You have just run your first MADYMO model. YAHOO! But now you want to see the results of your analysis. Time for a new program. Go back to your desktop or program files list and open MadPost. 1) Click the file menu then Open. Open your animation file (.kn3) (note that all output files are in the same directory as your input file location). 2) Select the blue play button (center top of the screen) to run the animation. Play with the animation controls (at the bottom of the screen). 3) Use your mouse in the active pane to rotate and zoom in on your animation. 4) Notice that your block is bouncing back with the same velocity as it impacts. So far we have defined an elastic collision between the block and the floor (which we know is not physically possible). In the Lab 3: Contact, you will play with changing contact parameters to see their effects. 5) Now, you want to confirm your model output and compare it to your analytical solution for a falling block so you need to see velocity data for your falling block. a. At the top of the page there is an icon that looks like a grid (black background, white lines) click on it and it will allow you to select your pane layout. Select two panes side by side. b. Click somewhere in the newly created Pane 2. The click file-open results file. At the bottom of the pop up window change your file filter to Madymo Time History and select the .lvl file (the linear velocity data file). c. Select the z-comp of velocity. d. A plot will open in Pane 2 that shows the z component of velocity as a function of time.

e. If you click on the play button again, your animation will play in Pane 1 while a bar tracks the progress through the velocity plot on Pane 2. Note the peak velocity of the block just before impact. f. Using conservation of energy, confirm that the peak velocity of your block matches what you would expect. 6) Finally, you want to look at your contact force data and confirm that it is also reasonable. Open the results file (.cntfrc) and look at the plot (force versus time). Record the duration of contact and the peak force. Assuming that the force ramp is linear, verify that your predicted peak contact for is reasonable using conservation of momentum

You might also like