Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve using matlab coding for a thumbs up thank you Exercise M3 Let's add one more cart, change the values here and there, and

please solve using matlab coding for a thumbs up thank you
image text in transcribed
image text in transcribed
image text in transcribed
Exercise M3 Let's add one more cart, change the values here and there, and see what happens. As before, all collisions are elastic. (You may treat the diagram as a scale drawing.) 36cm/s 9cm/s 45cm/s 240g 60g 300g a) After each collision, output an array of three velocities. How many collisions are there? (b) Show that both momentum and energy are both conserved after each collision. (C) How do you know if there is another collision? Provide appropriate output You must use arrays and dot operations, which will make your script more compact and streamlined. However, you may NOT use functions or loops, as these will come later, in M6. Label the carts 1, 2, and 3, from left to right Define an array of three masses and an array of three initial velocities. Compute the total momentum and total energy initially in the system using dot operations and the SUM command. (This will be simpler than what you needed to do previously.) Choose short, meaningful names for them, as you will be using them after each collision Decide which collision will happen first, then use the formulas from exercises M1 and M2 to predict the two new velocities afterwards. You should end up with a new array of three velocities. Compute the total momentum and total energy, then compare them to the initial values in order to check momentum and energy conservation. Each check can be done with one, relatively simple expression. (And don't forget that a proper check returns zero, if at all possible.) Now, decide if there is another collision. That is use an IF/ELSE statement to determine whether or not there is another collision, and output something, eg, "There are no more collisions." or "There is another collision." Make the IF/ELSE conditional as general as possible. If there is another collision, then you can use the "final" velocities from the previous collision as the "initial" velocities for this collision. Repeat the calculations, checks, and IF/ELSE statement. You do not need to determine which two carts collide, as that is also coming later. Use one short and simple IF/ELSE conditional, and use it only to decide only if there is another collision or not. Repeat this process until there are no more collisions. Output the array of velocities after each collision. Think about the names you will use for these arrays to make them meaningful to someone who is reading the output. For instance, because the carts are labeled 1, 2, and 3, which serve also as array indices, you should label the collisions A, B, C, etc., or anything equivalent. (That is, you should NOT use 1, 2, 3, etc. to label the collisions.) For part (b), you should output all of your checks as well, one pair of checks after each collision. (C) How do you know if there is another collision? Provide appropriate output. You must use arrays and dot operations, which will make your script more compact and streamlined. However, you may NOT use functions or loops, as these will come later, in M6. Label the carts 1, 2 and 3, from left to right. Define an array of three masses and an array of three initial velocities. Compute the total momentum and total energy initially in the system using dot operations and the SUM command. (This will be simpler than what you needed to do previously) Choose short, meaningful names for them, as you will be using them after each collision. Decide which collision will happen first, then use the formulas from exercises M1 and M2 to predict the two new velocities afterwards. You should end up with a new array of three velocities. Compute the total momentum and total energy, then compare them to the initial values in order to check momentum and energy conservation. Each check can be done with one, relatively simple expression. (And don't forget that a proper check returns zero, if at all possible.) Now, decide if there is another collision. That is, use an IF/ELSE statement to determine whether or not there is another collision, and output something, e.g., "There are no more collisions." or "There is another collision." Make the IF/ELSE conditional as general as possible. If there is another collision, then you can use the "final" velocities from the previous collision as the "initial" velocities for this collision. Repeat the calculations, checks, and IF/ELSE statement You do not need to determine which two carts collide, as that is also coming later. Use one short and simple IF/ELSE conditional, and use it only to decide only if there is another collision or not. Repeat this process until there are no more collisions. Output the array of velocities after each collision. Think about the names you will use for these arrays to make them meaningful to someone who is reading the output. For instance, because the carts are labeled 1, 2, and 3, which serve also as array indices, you should label the collisions A, B, C, etc, or anything equivalent. (That is, you should NOT use 1, 2, 3, etc. to label the collisions.) . For part (b), you should output all of your checks as well, one pair of checks after each collision. Each check will need a meaningful variable name, to match your labeling of the collisions (A, B, C, etc.). Suppress all other output You are not expected to be able to predict how many collisions there are, so you cannot predict exactly how long your script will be either. Therefore, construct your script in stages. For instance, convert your M1 script to arrays and see what the output is after the first collision, including the checks. Develop a simple test of whether or not there is another collision and output a meaningful statement. If there is another collision, add more code. Continue this process until there are no more collisions. The "total" mass needed for the "final" velocities will always be one of two values, one for when carts 1 and 2 collide, e.g., m 12, and one for when carts 2 and 3 collide. These don't change, so you can define them once near the beginning of your script, then use each multiple times. Exercise M3 Addendum To help you sort out the simplest and most general conditional statement to determine whether or not there is another collision, consider the following 10 scenarios. Focus on carts 1 and 2 for now, and assume that cart 1 is to the left of cart 2. (The answers depend critically on which cart is on the left!) Once you figure out the pattern, a similar comparison can be done with carts 2 and 3. Keep in mind that you are going to use the same conditional statement after each collision, referring to both pairs of adjacent carts, suitably updated to refer to the elements of the final velocity array associated with a particular collision. This will help make the transition to M6 much smoother. V1 V2 collision? reason? 20 10 20 -10 10 10 10 20 10 -20 -10 20 -10 -10 -10 - 20 -20 10 -20 -10

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

4. What is Title VII? What does it state?

Answered: 1 week ago

Question

Compose the six common types of social business messages.

Answered: 1 week ago

Question

Describe positive and neutral messages.

Answered: 1 week ago