Transcribed TextTranscribed Text

Your team's task is to complete a MATLAB simulation of a square rigid body suspended within a ring by one spring. The square is free to translate and rotate in the vertical plane, with gravity acting downward. You do not need to worry about collisions between the square and the ring. Below is a diagram explaining the setup of the system. springAftechor Angle o Jg os =1 x -15 - - 2 The system has already been set up for you in MATLAB. It involves four files that can be downloaded from our Piazza course page resources area as The main file issimulate.square.starter. m. When you first run it, this script will create the animation shown above right, except that the square will move straight up from its starting location. Here are some things to know about this system: The position of the center of the square is tracked through the variables x and y, both measured in m. The velocity of the center is tracked through VX and vy, measured in m/s. The angle of the square is tracked through the variable theta, measured in radians, with counterclock- wise positive. The object's angular velocity around the z-axis is omega, measured in rad/s. The initial values for these states are set via variables such as xInitial. The square's width is w, measured in m. The square is made of sheet material that has a planar density of density, measured in kg/m² The mass of the square is denoted n, measured in kg. IG is the square's mass moment of inertia around the z-axis though the center of mass, which is located at its geometric center. This parameter is measured in kg-m2. Gravity acts downward in the diagram, with gravitational acceleration having a magnitude of g, mea- sured in m/s². The square is surrounded by a ring of radius R, measured in m. You don't need to worry about collisions between the square and the ring. A spring connects a stationary frictionless pivot on the ring to a frictionless pin on the square. The square's pin is located at Dbll, byl] in the square's local frame. The location of the spring anchor point on the ring is set through the variable springAnchorAngle. This angle is measured in radians and is explained in the diagram above. The spring has a rest length of springRestLength, measured in m, and it exerts forces in both compression and extension. Its linear stiffness is springStiffness, measured in N/m. In addition to experiencing forces from gravity and the spring, the square undergoes a translational damping force as it moves through the simulation. This damping force is proportional to and in the opposite direction as the velocity of the center of mass, and it acts at that point. The translational damping coefficient is b, measured in N/(m/s). The square feels a rotational damping moment as it moves through the simulation. This damping moment is proportional to and in the opposite direction as the angular velocity that is occurring. The rotational damping coefficient is beta, measured in N-m/(rad/s). After completing these steps, make sure that your code still runs and produces a graph like the one shown above, plus a plot of the system's energy over time. Fix any errors you encounter before proceeding. 1. Work out the dynamics of the square on a piece of paper or a whiteboard. Your analysis should include a large free-body diagram of the square with all of the external forces and moments it is experiencing, given its current state. Write out any additional equations you will need to formulate the Newton-Euler equations of motion for this body, such as a vector expression for the viscous drag force. You do not need to turn this in, but it will be useful when you're programming (I promise). 2. Complete the function compute.square.derivatives.m. This the main function that ode45 uses to perform the entiresimulation It takes in the time t and the current state of the system Ug, ty,W/IT Its job is to calculate the first derivative of the provided state vector: Performing this calculation will require you to implement the dynamics you wrote out in the previous step. You may want to use, and you may also want to use the built-in Matlab function cross, which computes cross products. Please comment your work. (4 points) 3. Test your simulation for a wide range of initial conditions and parameter values. Use the provided energy plot to check the physical correctness of your dynamics, and fix any problems that you uncover. Try making the square very large or very small. Change the density of the material. Turn off the spring by setting its stiffness to zero. Adjust the spring stiffness and the damping values. Move the spring attachment point. Turn gravity off, then make it point upward. In all of these cases, make sure your simulation behaves in a realistic way, and work at improving your intuition for planar rigid body dynamics. After you've played with your simulation for about 30 minutes, configure it to your favorite set of initial conditions and parameter values. Put a brief comment in the code near the initial conditions to explain why you chose this configuration. (1 point)

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Square Rigid Body Simulation
    $30.00 for this solution

    PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

    Find A Tutor

    View available Differential Equations Tutors

    Get College Homework Help.

    Are you sure you don't want to upload any files?

    Fast tutor response requires as much info as possible.

    Upload a file
    Continue without uploading

    We couldn't find that subject.
    Please select the best match from the list below.

    We'll send you an email right away. If it's not in your inbox, check your spam folder.

    • 1
    • 2
    • 3
    Live Chats