You are on page 1of 3
Project Description: Consider the spring mass system shown in the diagram. The block has a mass, m= 25 kg. The coefficient of kinetic friction between the block and the inclined plane is x= 0.15. Four different cases of the angle of the inclined plane, 8, must be considered (0°, 20°, 40°, and 60°). For each case of 6, determine the smallest value to within 50 ‘Nim of spring constant, k, that can be used to keep the maximum displacement, x, within 0.25 m of the equilibrium position if the block experiences an initial velocity of 1.15 m/s down the slope from the equilibrium position, Consider times spanning from 0 to 2.5 seconds. Scanned with CamScanner Derivation of the Equation of Motion: When the mass is moving down the slope: | Pay Se Be e ss mk + p,mg cosO + kx =0 When the mass is moving up the slope: FBD ~., KD ee kx. a@ ©, “Og mi — p,mg cos 0 + kx =0 Requirements: Inthe command window, your script should nicely display a list of spring constants with the corresponding values of 8, e.g. “For an angle of 30 degrees, k = 100 N/m” «Your program must automatically detect when the displacement condition is met. Le., you should increase k in the given increments until the maximum displacement condition js satisfied. You may not just try a set of pre-determined k values and then select afterwards. L.e., you cannot use a “for” loop to vary your k-values. # Your script should plot the displacement and velocity of the block for the selected values off for each angle on the same figure, i.e. one figure with subplots for displacement and Scanned with CamScanner velocity where each plot contains 4 lines, one for each case of 4 (including a legen Note, use \theta in the legend command to write the symbol theta, and \cire: degrees symbol. The use of comments in both the function and script files is required. In general, code must be clear, understandable, organized, and follow good programming practices. Hints/Tips/Notes: ‘This system will oscillate, so the direction of friction will change, based upon the direction of the velocity. Since the values of k and @ are necessary for the differential equation, these values must be inputs to your user defined function. Because of this, in order to call a numerical integrator such as ode45, you need to define an anonymous function in your script which only takes two arguments for the time and state of the differential equation (and not kand 6) © Le, the function file should have the usual ode45 inputs of (t, y), but should also have inputs for kand 8. Then, in your script, you can define anonymous functions for specific values of k and 0 that only has inputs of (1, y). Scanned with CamScanner

You might also like