We can model a trebuchet as a simple system of three masses on two linkages as...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
We can model a trebuchet as a simple system of three masses on two linkages as shown in the sche- matic below. We will assume that the Trebuchet is already built and has a throwing arm ₁ that is 15 Im long, and a 3 m counterweight arm (13). It has a 10,000 Kg counterweight, and the effective arm mass m₁ is 100 Kg. The initial throwing arm angle is 0₁ (t = 0) = -20° that is, the throwing arm is 20° off from being full vertical. You first have to tune the trebuchet for throwing a 50 Kg projectile. You can change the sling length, 12, and the initial sling gle, 0₂(t = 0), which can be between 0° and 180°. You can also set the trigger angle 0* = 02-0₁ at which the sling releases the projectile. 1 The function must be called trebuchetSim It must take 4 input arguments: m₂, l2, 0₂ (t = 0), and 8*, in that order and in units of kilograms, meters, and degrees (not radians). • It must output the horizontal and vertical position of the projectile relative to the axle of the throwing arm when the sling is released (u2x U2y), and the projectile's horizontal and vertical velocity, (v2x.Vzy) at this instant. These should be combined in a single array containing y = [Uzx, Uzy, v2x, V2y]. It must use ode 23 to perform the simulation. • It must use default model parameters of: m₁ = 100 Kg, m3 = 10,000 Kg. ₁ = 15 m, ₁ = 3 m, g = 9.8 m/s², and initial values for the state of the state of trebuchet of 8₁ (t = 0) = -20°, w₁(t = 0) = 0, and w₂(t = 0) = 0. It must use ode 23 to perform the simulation. It must use default model parameters of: m₁ = 100 Kg, m3 = 10,000 Kg. ₁ = 15 m, 4₁ = 3 m, g = 9.8 m/s², and initial values for the state of the state of trebuchet of 8₁ (t = 0) = -20°, w₁(t = 0) = 0, and w₂(t = 0) = 0. • It must call ode 23 with a simulation timespan of 3 s, but it must use the odeset command to set an events function that stops the simulation at the point that the sling angle relative to the throwing arm reaches its release angle, i.e. when 0₂-0₁ = 0. • It must the odeset command to set ODE solver's MaxStep option to 0.01 s. Step 2: Build a MATLAB function called projectileSim to simulate the flight of the projectile until it hits the ground. This function should use ode 23 to follow the projectile in flight until it hits the ground and then return the horizontal distance from the trebuchet's axle to where the projectile landed. We will use the trebuchet's axle as the origin of our coordinate system as the tebuchet Sim function returns the location of the projectile relative to the axle when it is released. We will also assume that ground level is 20 m below the axle. This will use the same equation of motion as used for the football simulation in Lab 8. See the bonus video that I recorded for help on how to write the projectileSim function and the accompanying lecture code. The function must have the following attributes: The function must be called projectileSim. • It must take 5 required input arguments: (1) the initial position and velocity of the projectile when it is released from the trebuchet as a single array [uzx, Uzy, Vzx. Vzy] in units of meters and meters per second, (2) the mass of the projectile m₂ in kilograms, (3) the drag coeffi- cient d in N.s²/m², (4) the gravitational acceleration g in m/s², and (5) the height of the ground relative to the axle of the trebuchet's throwing arm, h in meters. • The code must return a single output: the horizontal distance in meters from the axle to where the projectile lands. The MaxStep option of the ODE solver must be set to 0.01 s. • • The function should use odeset to set an event function to terminate the simulation when the projectile strikes the ground. • If either of the initial velocity components, 2x and v2y are negative the function should re- turn a distance of zero. If the projectile has not hit the ground after 1 minute of flight, also have the simulation stop and return zero. Step 3: Write a MATLAB function called computeRange that uses trebuchet Sim to compute the location and velocity of the projectile when it is released from the trebuchet and feeds these conditions into projectileSim to compute the distance the projectile travels. • The function must be called computeRange. • The function must take four input arguments: m₂, l₂, 0₂(t = 0), and the sling release angle * in units of kilograms, meters and degrees. The function must return a single argument: the distance in meters that the projectile travels. If either computeRange or trebuchetSim return an error, computeRange must return a distance value of zero. • • • The function must use default model parameters of: h= -20 m (the ground is 20 m below the trebuchet axle), g = 9.8 m/s², and drag parameter of d = 0.01 N.s²/m². Step 4: Write a MATLAB function called optimizeTrebuchet that optimizes 1₂. 0₂(0), and 0. for a given projectile mass m₂ to maximize the range for a given projectile mass. Your function should use MATLAB's fminsearch command, to minimize the negative of the range computed by computeRange. You should watch the plots of the trebuchet motion that are generated as fminsearch calls computeRange to see what it is doing as it explores the trebuchet design- space. Your function should have the following attributes: The function must be called optimizeTrebuchet. • The function must take wo input arguments: (1) The projectile mass m₂ in kilograms, and (2) an array containing an initial guess for [12, 02(0), 0*] in units of meters and degrees. The function must return two output arguments: (1) The maximum range, and (2) an array containing the values of [1₂, 8₂(0), 0] that achieve this range. • You should try running your optimization code starting from different initial values of [1₂, 0₂(0), 0]. Does the code always find the same optimal solution? Once you can optimize the trebuchet for a 50 Kg projectile, try changing the mass and see how that affects the optimal trebuchet setup [12. 02(0), 0]. You can also see how sensitive the range it small changes in [12, 02(0), 0*]. We can model a trebuchet as a simple system of three masses on two linkages as shown in the sche- matic below. We will assume that the Trebuchet is already built and has a throwing arm ₁ that is 15 Im long, and a 3 m counterweight arm (13). It has a 10,000 Kg counterweight, and the effective arm mass m₁ is 100 Kg. The initial throwing arm angle is 0₁ (t = 0) = -20° that is, the throwing arm is 20° off from being full vertical. You first have to tune the trebuchet for throwing a 50 Kg projectile. You can change the sling length, 12, and the initial sling gle, 0₂(t = 0), which can be between 0° and 180°. You can also set the trigger angle 0* = 02-0₁ at which the sling releases the projectile. 1 The function must be called trebuchetSim It must take 4 input arguments: m₂, l2, 0₂ (t = 0), and 8*, in that order and in units of kilograms, meters, and degrees (not radians). • It must output the horizontal and vertical position of the projectile relative to the axle of the throwing arm when the sling is released (u2x U2y), and the projectile's horizontal and vertical velocity, (v2x.Vzy) at this instant. These should be combined in a single array containing y = [Uzx, Uzy, v2x, V2y]. It must use ode 23 to perform the simulation. • It must use default model parameters of: m₁ = 100 Kg, m3 = 10,000 Kg. ₁ = 15 m, ₁ = 3 m, g = 9.8 m/s², and initial values for the state of the state of trebuchet of 8₁ (t = 0) = -20°, w₁(t = 0) = 0, and w₂(t = 0) = 0. It must use ode 23 to perform the simulation. It must use default model parameters of: m₁ = 100 Kg, m3 = 10,000 Kg. ₁ = 15 m, 4₁ = 3 m, g = 9.8 m/s², and initial values for the state of the state of trebuchet of 8₁ (t = 0) = -20°, w₁(t = 0) = 0, and w₂(t = 0) = 0. • It must call ode 23 with a simulation timespan of 3 s, but it must use the odeset command to set an events function that stops the simulation at the point that the sling angle relative to the throwing arm reaches its release angle, i.e. when 0₂-0₁ = 0. • It must the odeset command to set ODE solver's MaxStep option to 0.01 s. Step 2: Build a MATLAB function called projectileSim to simulate the flight of the projectile until it hits the ground. This function should use ode 23 to follow the projectile in flight until it hits the ground and then return the horizontal distance from the trebuchet's axle to where the projectile landed. We will use the trebuchet's axle as the origin of our coordinate system as the tebuchet Sim function returns the location of the projectile relative to the axle when it is released. We will also assume that ground level is 20 m below the axle. This will use the same equation of motion as used for the football simulation in Lab 8. See the bonus video that I recorded for help on how to write the projectileSim function and the accompanying lecture code. The function must have the following attributes: The function must be called projectileSim. • It must take 5 required input arguments: (1) the initial position and velocity of the projectile when it is released from the trebuchet as a single array [uzx, Uzy, Vzx. Vzy] in units of meters and meters per second, (2) the mass of the projectile m₂ in kilograms, (3) the drag coeffi- cient d in N.s²/m², (4) the gravitational acceleration g in m/s², and (5) the height of the ground relative to the axle of the trebuchet's throwing arm, h in meters. • The code must return a single output: the horizontal distance in meters from the axle to where the projectile lands. The MaxStep option of the ODE solver must be set to 0.01 s. • • The function should use odeset to set an event function to terminate the simulation when the projectile strikes the ground. • If either of the initial velocity components, 2x and v2y are negative the function should re- turn a distance of zero. If the projectile has not hit the ground after 1 minute of flight, also have the simulation stop and return zero. Step 3: Write a MATLAB function called computeRange that uses trebuchet Sim to compute the location and velocity of the projectile when it is released from the trebuchet and feeds these conditions into projectileSim to compute the distance the projectile travels. • The function must be called computeRange. • The function must take four input arguments: m₂, l₂, 0₂(t = 0), and the sling release angle * in units of kilograms, meters and degrees. The function must return a single argument: the distance in meters that the projectile travels. If either computeRange or trebuchetSim return an error, computeRange must return a distance value of zero. • • • The function must use default model parameters of: h= -20 m (the ground is 20 m below the trebuchet axle), g = 9.8 m/s², and drag parameter of d = 0.01 N.s²/m². Step 4: Write a MATLAB function called optimizeTrebuchet that optimizes 1₂. 0₂(0), and 0. for a given projectile mass m₂ to maximize the range for a given projectile mass. Your function should use MATLAB's fminsearch command, to minimize the negative of the range computed by computeRange. You should watch the plots of the trebuchet motion that are generated as fminsearch calls computeRange to see what it is doing as it explores the trebuchet design- space. Your function should have the following attributes: The function must be called optimizeTrebuchet. • The function must take wo input arguments: (1) The projectile mass m₂ in kilograms, and (2) an array containing an initial guess for [12, 02(0), 0*] in units of meters and degrees. The function must return two output arguments: (1) The maximum range, and (2) an array containing the values of [1₂, 8₂(0), 0] that achieve this range. • You should try running your optimization code starting from different initial values of [1₂, 0₂(0), 0]. Does the code always find the same optimal solution? Once you can optimize the trebuchet for a 50 Kg projectile, try changing the mass and see how that affects the optimal trebuchet setup [12. 02(0), 0]. You can also see how sensitive the range it small changes in [12, 02(0), 0*].
Expert Answer:
Answer rating: 100% (QA)
To accomplish the tasks outlined we will follow a stepbystep approach writing MATLAB functions as described in the problem statement Lets break down e... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these finance questions
-
Based on your understanding of the OSI (Open Systems Interconnect) model, what are the security effects of cryptographic tunneling? Provide input on the type of cryptographic tunneling protocols...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
A gaseous mixture consists of 80.0 mole percent N2 and 20.0 mole percent O2 (the approximate composition of air). Suppose water is saturated with the gas mixture at 25C and 1.00 atm total pressure,...
-
Given the facts of Exercise 8, (1) Prepare the charge and discharge statement that would have resulted from the above events and (2) Prepare the entries to transfer all estate principal and income...
-
Write a memo to Jordan Carr outlining how you would recommend measuring customer satisfaction for JYC Investments. Be sure to discuss the advantages and disadvantages of your proposed measure.
-
Write the schemes similar to (4.4), (4.9), and (4.10) for \(\partial u /\left.\partial y ight|_{i, j}\).
-
Blueline Tours, Inc., operates tours throughout the United States. A study has indicated that some of the tours are not profitable, and consideration is being given to dropping these tours to improve...
-
Does anyone have the textbook solution for thisquestion?Problem 8-2Financial statements of Par Corp. and its subsidiary Star Inc. onDecember 31, Year 12, are shownbelow:BALANCE SHEETSAt Decemb 1...
-
In this mini-case, you will complete the test of details on accounts receivable for the 2019 audit of EarthWear Clothiers, Inc. The principal test of detail involves sending "confirmations" or...
-
What is the present value of the following cash flow stream at a rate of 17.5% per year? Years: CFS: 0 $0 $75 2 $225 319 $0 4 $300
-
Transactions for the month of July for Shelly's Bookstore were as follows; Purchases Sulca July 1 8 (balance) 600 @$7.30 1,200 @$7.40 July 3 350 $9.50 22 700 @$7.60 225 12 900 9.75 25 800 10.00 30...
-
On January 1 , year 1 , Dave received 1 , 3 5 0 shares of restricted stock from his employer, RRK Corporation. On that date, the stock price was $ 1 2 per share. On receiving the restricted stock,...
-
A - 9 8 . 5 muC charge is in a 4 3 4 6 4 N / C electric field. What is the magnitude of the force ( in N ) on this charge?
-
1. Officer Snow had reasonable suspicion to stop Eddy. Afraid that he could be armed, the officer reached inside his pocket and retrieved a handgun. Eddy is charged with illegal possession of a...
-
Write a program that will declare an array of 4 integers and the user a loop to ask the user to enter values for the array elements. The asking for the values will be performed by a function called...
-
professional biography as a legal and compliance director in event and planning business.
-
Evaluate each logarithm to four decimal places. log 0.257
-
For each of the following situations, indicate whether the taxpayer(s) is (are) required to file a tax return for 2012. Explain your answer. a. Helen is a single taxpayer with interest income in 2012...
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
Amy is a calendar-year taxpayer reporting on the cash basis. Please indicate how she should treat the following items for 2012: a. She makes a deductible contribution to an IRA on April 15,...
-
Use properties of the real numbers and mental math to calculate the following: 1. \(2 \times 13 \times 50\) 2. \(13+84+27\) 3. \(9 \times 16 \times 11\)
-
In each of the following, identify which property of the real numbers is being applied. 1. \(4+(8+13)=(4+8)+13\) 2. \(34 \times\left(\frac{1}{34} ight)=1\) 3. \(14+27=27+14\)
-
Find the value of the following numbers modulo 12 : 1. 34 2. 539 3. 156
Study smarter with the SolutionInn App