Comp1211 Simulations Worksheet 1 [CBPrice Feb26 2013 Rev3] Purpose (i) To use a simulation of the suspension on a mountain bike and to make some qualitative observations, (ii) To investigate the effect of the load on a mountain bike on the compression of the suspension spring, (iii) To investigate the effect of the suspension damping on the oscillations of the bike. In doing this you will be invited to (iv) plan one or more simulation studies. Background One aspect of simulation studies is to conduct “what-if” investigations. For example what happens to the displacement of a mountain bike if the load is increased? Or what happens to the behaviour of the bike if the damping coefficient is changed? This worksheet aims to introduce you to what-if investigations. User Interface The user interface has been designed with simplicity in mind. Here are it’s characteristics for a running level. (i) Selecting an Object: Move the red cross-hair over an object and left-click to select it. You will get some data on the HUD. (ii) Starting, Stopping and Reset: The F1 key will start and stop the simulation. The F2 key will reset the simulation to the default parameter values. (iii) Changing parameters via the Console: You can do this by hitting the tab key then by typing in a command such as ‘setparam damp 1.0’ which will set the value of the damp parameter to 1.0. Then hit enter. Hit Esc to exit if you make a mistake and wish to try again. Here’s a list of parameters you can change Console Command Effect setparam damp X setparam load X Sets the damping coefficient to the value of X Sets the load downwards on the bike to X Activities 0 Download and Install the Assets and code. Open up the zipped file from the module web-page and copy the folder structure (inside “UDK”) into C:\UDK\UDK-2012-10 overwriting any other files and folders. 1 First Run and Compile. Now run the UDK Editor and you should reply “Yes” to the “Scripts Outdated” dialogue box if you get one. Then run the UDK Editor again and open the level CBP55_ D_Euler_Lab_MountainBike.udk where you should see a mountain bike. Run the level in the Editor by hitting the blue arrow in the perspective viewport. Then move the red cross-hair over the bike and left mouse-click. You should get some info on the HUD top-right. Note that “Running” should be “False” and shown in red. 2 Initial Observations (1). In the running level, on the HUD check that the damping damp is set to 0.1 and the load is 0.0. (i) Using the console, set the load to 1.0 and observe the behaviour of the bike. Write this down in simple English. (ii) Now repeat for loads of 2,4,6,8,10 and 12. Note the orientation of the spring for each load. Write your observations down. 3 Initial Observations (2). Increase the load to 13 and then 13.5 (and perhaps beyond). Something strange happens. Any ideas why? 4 A Simulation Study (1). Here we shall conduct a planned investigation to see how the vertical displacement of the bike depends on the applied load. (i) First set the value of damping damp to 2.0. (ii) Now set the load to a range of values, 2,4,6,8,10 and 12, and for each load, when Z has become stable, record the value of Z for each value of load. (iii) Open up Excel and insert your values of load into a column, then add a second column of the associated values of Z. (iv) Plot these values in Excel using a “scatter” plot, theory says they should lie on a straight line, so add a linear trendline. 5 A Simulation Study (2). Now let’s investigate what is happening close to the ‘critical region’ just before the bike collapses and falls into the ground. (i) Record values of Z for loads of 13.0, 13.1, up to 13.7. (ii) Add these values to your previous Excel sheet and display on a new “scatter” plot. The points will not be on a straight line due to the suspension having changed its orientation significantly. (iii) Can you offer an explanation of the plot you have made? 6 A Simulation Study (3) OPTIONAL. In the investigations above, we have added a lot of damping to prevent the oscillations of the suspension from becoming significant. In this study we shall investigate these oscillations, and how the value of damping (damp) changes these oscillations. In this study, let’s agree to use a common load of 6.0. Run the level and set the load to 6.0. Now run a series of simulations for various values of damping damp. The best way to investigate is to use the log files generated by the simulation. You will find these in the directory C:\UDK\UDK-201106\UDKGame\Logs, they will have an obvious name.