Application of Math Principles To Engineering Systems Problems and Solutions By Professor David A. Hullender June 20, 2021 1 Table of Contents Topic Example Problems Solutions to Example Problems Previous Quiz Problems and some solutions Previous Homework and some solutions Previous Exams and some solutions page number 3 31 88 114 302 2 Example Problems 4.1 A mass sits at equilibrium on top of a spring and damper as shown below. Mass Spring x Damper It can be shown that the differential equation for the position of the mass ๐ฅ is given by ๐2๐ฅ ๐๐ฅ 10 2 + 60 + 80๐ฅ = 160 ๐๐ก ๐๐ก (a) What is the dependent variable in the differential equation?_________ (b) What is the independent variable in the differential equation?__________ (c) What is the order of the differential equation?________ (d) Is the differential equation linear or nonlinear? ________ (e) What is the equilibrium value of x? ______ (f) If the mass is disturbed, it will eventually return to the equilibrium position. Why? 4.2 Consider the following differential equation for a suspension system: ๐ฆฬ + 6.5๐ฆฬ + 9,800๐ฆ 3 = 9.8 1. What is the order of the differential equation? ____________ 2. Assuming ๐ฆ(๐ก) → ๐๐๐๐ ๐ก๐๐๐ก as ๐ก → ∞, what will be the value of this constant?_____________ 3. Assuming that the initial conditions for this differential equation are ๐ฆฬ (0− ) = 0 ๐๐๐ ๐ฆ(0− ) = 0, draw a sketch of ๐ฆ(๐ก) v. t starting at ๐ก = 0 showing the initial and final values and an estimate of y(t) between these values. 4. Obtain a linear approximation for this differential equation by obtaining a straight line approximation for ๐ฆ 3 using the two point method with the two points 0.1 and 0. Be sure to start by sketching ๐ฆ 3 and noting the two points for your straight line. 5. After substituting your straight line into the original differential equation, check to see if the new linearized differential equation gives the correct final value. 3 4.3 Consider the following spring-mass-damper system with input u(t). z M k b k b u The input (independent variable) to this system is the displacement u. The equations for this suspension system are 10๐งฬ + ๐1 + ๐2 = 0 ๐1 = 100(๐ง − ๐ฃ) ๐2 = 5(๐งฬ − ๐ฃฬ ) ๐3 = 100(๐ฃ − ๐ข) ๐4 = 5(๐ฃฬ − ๐ขฬ ) ๐1 + ๐2 − ๐3 − ๐4 = 0 (a) List the unknowns (dependent variables) and confirm that the number of equations matches the number of unknowns. (b) Use the "D" operator to convert the differential equations to algebraic equations. (c) Eliminate ๐1 , then eliminate ๐2 , then eliminate ๐3 , and then eliminate ๐4 . How many equations with which unknowns do you have left? 4.4 Laplace transform the following differential equation and solve for the Laplace transform Z(s). 2๐งฬ + 12๐งฬ + 36๐ง = 24 ๐ง(0− ) = 0 ๐งฬ (0− ) = 4 Note, the answer should be in the format of a numerator polynomial over a denominator polynomial. Your answer is not complete until it is in this format. (a) The final value theorem is ๐ง(๐ก)๐ก→∞ = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →0 Apply the final value theorem to your Z(s) and see if it gives the correct final value. (b) The initial value theorem is ๐ง(0+ ) = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →∞ Apply the initial value theorem and see if it gives ๐ง(0− ); note, ๐ง(0+ ) should equal ๐ง(0− ) if there is no impulse input to create an instantaneous change in z at t = 0. 4 4.5 (a) Solve the following differential equation x(t) using separation of variables if x(0-) =4. 2๐ฅฬ + 6๐ฅ = 0 (b) Confirm that your solution is correct by substituting the solution into the original differential equation. 4.6 1. The Laplace transform of z(t) is as follows: 6๐ 2 + 12๐ + 5 ๐(๐ ) = ๐ (๐ + 4)[(๐ + 2)2 + 82 ] Show that the inverse Laplace of Z(s) will be of the following format: ๐ง(๐ก) = ๐๐ ๐๐ก + ๐๐ ๐๐ก + ๐๐ ๐๐ก sin (๐๐ก + ๐) ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? 2. The equation for Y(s) is written below in terms of the input U(s). 6๐ 2 + 3๐ + 84 ๐(๐ ) = [ ] ๐(๐ ) (๐ + 3)[(๐ + 5)2 + 92 ] (a) (b) (c) (d) What is the transfer function? What are the eigenvalues? What are the time constants? If u(t) is a unit impulse, what is U(s) and what is Y(s)? 4.7 Laplace transform the differential equation below and then solve for Z(s). 3๐งฬ + 6๐งฬ + 12๐ง = 18 ๐ง(0− ) = 2 ๐งฬ (0− ) = 4 5 4.8 Consider the following Laplace transform: 15๐ 3 + 2๐ 2 + 640 ๐ (5๐ 4 + 162๐ 3 + 1424๐ 2 + 3744๐ + 1280) What will be the final value of z(t) found using the final value theorem? What is the initial value of z(t) as determined from the initial value theorem? What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command. ๐(๐ ) = 4.9 Consider the two simultaneous equations below for a mechanical lift system with step input u(t) with magnitude of 5. 10๐ฆฬ + 6๐ฆฬ + 3๐ฆ = 2๐ฃ ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 5 2๐ฃฬ + +10๐ฃ − 4๐ฆ = 2๐ข ๐ฃ(0− ) = 4 Convert these equations to the Laplace domain by Laplace transforming the equations. 4.10 For the differential equation below, use Euler’s numerical integration to compute the first two solution values of x(t) using a time step of 0.01. ๐ฅฬ + 10๐ฅ = 20 ๐ฅ(0− ) = 1 4.11 The differential equations for the suspension shown below with input displacement u(t) are 10๐งฬ + 100๐งฬ + 1000๐ง = 100๐คฬ + 1000๐ค 100๐คฬ + 4000๐ค = 100๐งฬ + 1000๐ง + 3000๐ข (a) Assume all initial conditions are zero and convert the equations above to Laplace domain. Z W U (b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 6 4.12 Express the following differential equation with input u in state variable format. What are the initial conditions for the state variables? ๐ฃฬ + 5๐ฃฬ + 10๐ฃ = 20๐ขฬ + 40๐ข ๐ฃ(0− ) = 3 ๐ฃฬ (0− ) = 0.5 ๐ข(0− ) = 0 4.13 A dynamic system is represented by the differential equation shown below. ๐งฬ + 7๐งฬ + 10๐ง = 14๐ขฬ + 20๐ข (a) What is the transfer function of this system? (b) What are the eigenvalues of this system? (c) What are the time constants for this system? (d) Suppose the input u(t) is a unit step. What will be the final value of z(t)? (e) How long will it take for z(t) to be within 1% of this final value? 4.14 (a) Perform the following matrix operations: 1 2 3 ๐ = [4 5 6] ๐๐ = 7 8 9 1 2 3 1 (2) ๐ = [4 5 6] ๐ = [ 1] 7 8 9 1 ๐ฅ1 (3) [−2 4 −1] [๐ฅ2 ] = ๐ฅ3 1 2 ๐ข 1 (4) [3 4] [๐ข ] = 2 5 6 (1) ๐๐ = 1 (5) [2] [4 5 6] = 3 1 1 (6) [2] .∗ [2] 3 3 (b) Express the differential equation below in matrix state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐งโ + 2๐งฬ + 3๐งฬ + 8๐ง = 10๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ฆ = 0.1๐งฬ 7 4.15 Solve the following differential equation using separation of variables. 20๐งฬ + 60๐ง = 80 ๐ง(0− ) = 2 4.16 The differential equation for the suspension system shown below is ๐งฬ + 0.8๐งฬ + ๐ง = 0.8๐ขฬ + ๐ข z u (a) Express this differential equation in state variable format assuming y = u -z is the output of interest. (b) Enter your state variable equations in MATLAB using the ‘ss’ command. (c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values? (d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot start and end at the correct initial and final values? 4.17 Obtain a straight line approximation for x3 in the neighborhood of x = 2. 4.18 Two simultaneous differential equations are shown below. ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −100๐ฅ1 − 2๐ฅ2 What are the two unknowns? _______________________ Using the ‘D’ operator, eliminate ๐ฅ2 and find a single differential equation for ๐ฅ1 . 8 4.19 (a) Express the differential equation shown below in state variable format using matrices, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? The output of interest is ๐ฆ = ๐ง. 4๐งฬ + 24๐งฬ + 40๐ง = 24๐ขฬ + 40๐ข ๐ง(0− ) = 3 ๐งฬ (0− ) = 2 ๐ข(๐ก) = ๐ข๐๐๐ก ๐ ๐ก๐๐ (b) What are the initial conditions for the state variables, i.e. ๐ฅ1 (0− ) =?, ๐ฅ2 (0− ) =?, ๐๐ก๐. (c) For an ode45 numerical simulation, what would you specify for the final time (when to stop the simulation)? 4.20 1. For each differential equation below, answer the following questions: (a) ๐ฃฬ + 16๐ฃฬ + 12๐ฃ = 5 Is the equation linear?________ What is the order? _______ What is the dependent variable?_______ What is the input to the differential equation?_____ What is the final value of the dependent variable?________ (b) 2๐ฆโ + 0.4๐ฆฬ + 0.1(๐ฆฬ )5 + 10๐ฆ = 24 Is the equation linear?________ What is the order? _______ What is the dependent variable?_______ What is the input to the differential equation?_____ What is the final value of the dependent variable?________ 2. Before the valve on the water tank shown below is opened, the height H of the water in the tank is 10 m. Once the valve is opened, water flows out of the tank. The differential equation for H with water flowing out is as follows 4๐ปฬ + 0.8√๐ป = 0 (a) On the sketch below, draw a reasonable estimate of H as a function of time. H H valve flow 0 time Use separation of variables to solve this differential equation for H(t). Does your equation for H(t) give the correct initial and final values for H? Equation for H(t) _______________________________ Initial value of H from the equation __________ Final value of H from the equation ___________ 9 3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that is, nothing is moving. cart spring pendulum If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left and then released, the cart will start rolling back and forth compressing and extending the spring while the pendulum swings back and forth. z ๏ฑ It can be shown, for small angles, the following two simultaneous equations with unknowns ๐ง ๐๐๐ ๐ accurately model the dynamics of this system ๐ฬ + 3๐ฬ + 9๐ = −0.9๐งฬ ๐(0− ) = ๐๐ ๐ฬ(0− ) = 0 7๐งฬ + 175๐ง = −2๐ฬ ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 Using the Laplace transform, convert these equations to algebraic equations, eliminate ๐, and finally end up with an equation for ๐(๐ ). 4.21 1. Obtain a linear approximation to the following differential equation using the initial and final values of z. ๐งฬ + 3๐งฬ + 6√๐ง = 12 ๐ง(0− ) = 1 2. Consider the following Laplace transform for Z(s): ๐(๐ ) = 6๐ 2 + 20๐ + 80 ๐ [๐ 2 + 12๐ + 40] (a) Use the final value theorem (FVT) to compute the final value of z(t). (b) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+. (c) What are the poles of Z(s) which are the roots of the denominator polynomial? 10 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ H1 ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H2 Q (a) (b) (c) (d) Laplace transform each of these three equations. Reduce the equations down to two equations with unknowns H1(s) and H2(s) . Reduce the equations down to one equation for the unknown H1(s). Use the final value theorem to determine the final value of H1. Does this value make sense? (e) Use the initial value theorem to check the initial value. Is it correct? 4.22 1. The differential equations for the suspension shown below with input displacement u(t) are ๐งฬ + 10๐งฬ + 100๐ง = 10๐คฬ + 100๐ค ๐คฬ + 40๐ค = ๐งฬ + 10๐ง + 30๐ข (a) Assume all initial conditions are zero and convert the equations above to Laplace domain. Z W U (b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 (c) What is the transfer function for this system? 11 (d) Consider the following MATLAB command and results: >> roots([1 40 300 3000]) ans = -33.7442 -3.1279 + 8.8950i -3.1279 - 8.8950i What are the eigenvalues of this system? (e) What are the time constants of this system? (f) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown to be ๐ง(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (โ๐ก + ∅) What are a = ? b = ? c = ? d = ? f = ? g = ? h = ? ∅ =? (g) For a unit step input, what is the final value of z(t) and how long will it take to get within 1% of this value? 2. Use the residue theorem to solve the following differential equation for y(t). 22๐ฆฬ + 44๐ฆ = 88 ๐ฆ(0− ) = 5 4.23 1. Find the magnitude and angle of the following complex numbers: (a) 4 + j4 (b) -4 + j4 (c) -4 – j4 (d) 4 - j4 (e) (4+๐4)(−4+๐4) 4−๐4 2. For the differential equation below, 2๐งฬ + 24๐งฬ + 40๐ง = 20๐ข ๐ง(0− ) = 0.5 ๐งฬ (0− ) = 3 ๐ข(๐ก) = 5 (a) Solve for the Laplace transform of z(t), Z(s). (b) Check your Z(s) to see if it gives the correct initial value using the initial value theorem. (c) Check your Z(s) to see if it gives the correct final value using the final value theorem. 3. (a) Find the inverse Laplace transform of Y(s) below. 32 ๐(๐ ) = ๐ [(๐ + 4)2 + 42 ] (b) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT. Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT. 12 4.24 1. Consider the following differential equation for y(t). 2๐ฆฬ + 5๐ฆ = 25 ๐ฆ(0− ) = 6 (a) Use the Laplace transform and the residue theorem to solve this differential equation for y(t) (b) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the correct values at t = 0 and at t = ∞? (c) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time constant for T. 2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐ฃ. The model for the system is represented by the following equations : 1000๐ฃฬ + 0.05๐ = 9800 ๐ = 100000๐ ๐ = 0.05๐ฃ Velocity v Pressure P Flow Rate Q (a) We have three equations. What are the three unknowns? (b) Assuming the initial velocity is zero, Laplace transform the equations and then find a single equation for the Laplace transform of the pressure P(s). (c) What is the final value for P(t) and how long does it take for P(t) to reach this final value within 1 %? 3. Express the following 3rd order differential equation in a format of three simultaneous 1st order differential equations; that is, state variable format. All initial conditions are zero. 2๐งโ + 16๐งฬ + 8๐งฬ + 5๐ง = 10 13 4. Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer function with the input being a unit impulse. What are the MATLAB commands for getting a plot of w(t) using the 'impulse' command in MATLAB? 2๐ + 4 ๐(๐ ) = 2 3๐ + 20๐ + 5 4.25 1. Use Laplace transform to solve the following differential equations for z(t): (a) ๐งฬ + 25๐ง = 2๐ขฬ + 15๐ข ๐ง(0− ) = 4 The input u(t) is a step with magnitude 5. (b) ๐งฬ + 6๐งฬ + 25๐ง = 50๐ข(๐ก) ๐ง(0− ) = 1 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. (c) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’ command. 2. A vehicle suspension system is defined by the following differential equations with input u(t): 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข (a) Define state variables and then find the equations for the derivatives of the state variables. (b) Express your state variable derivative equations from (a) in state variable matrix format assuming the output of interest is y = u - v, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 84๐ฃฬ + 300๐ฃ 3 = 2400 ๐ฃ(0− ) = 1.9 ๐ฃฬ (0− ) = 2 (a) What is the equilibrium (final value) of v(t)? (b) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. (c) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. (d) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? (e) What are the eigenvalues of your linearized differential equation? Time constants? 4.26 1. Use Laplace transform to solve the following differential equations for z(t): (a) 2๐งฬ + 10๐ง = 4๐ขฬ + 20๐ข ๐ง(0− ) = 3 The input u(t) is a step with magnitude 2. (b) (15%) 10๐งฬ + 60๐งฬ + 250๐ง = 24๐ข(๐ก) ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. 2. A vehicle suspension system is defined by the following differential equations with input u(t): 14 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข (a) Express this system of equations in state variable format. (b) Express your state variable equations from (a) in state variable matrix format assuming the output of interest is y = v - w, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 2.4๐ฃฬ + 3๐ฃ 3 = 3000 ๐ฃ(0− ) = 10.01 ๐ฃฬ (0− ) = 2 (a) What is the equilibrium (final value) of v(t)? (b) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. (c) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. (d) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? (e) What are the eigenvalues of your linearized differential equation? Time constants? 4.27 After Laplace transforming a differential equation for y(t) with input u(t), the following result was achieved: ๐ 2 +11๐ +30 ๐(๐ ) = [(๐ +2)[(๐ +3)2+42 ]] ๐(๐ ) (a) (b) (c) (d) (e) What is the transfer function for this system? ____________________________ What are the eigenvalues of this system?_________________________________ What are the time constants for this system? _____________________________ What is the damping ratio of this system? _______________________ What is the damped natural frequency of this system? ____________ (f) What is the undamped natural frequency of this system? _____________ (g)Suppose u(t) is a unit step input. It can be shown that y(t) will be of the form ๐ฆ(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก ๐ ๐๐( ๐๐ก + ๐) What are the following: ๐1 =? C1 = ? ๐2 =? C2 = ? ๐3 =? C3 = ? ๐ =? ๐ = ? (h)What will be the final value of y(t), i.e. y(∞)? 4.28 For the differential equation given below, obtain a straight line approximation for ๐ฅ 3 and use it to obtain an approximation for the eigenvalues. 2๐ฅฬ + 8๐ฅฬ + 20๐ฅ 3 = 160 ๐ฅ(0− ) = 1 ๐ฅฬ (0− ) = 0 15 4.29 (a) What are the eigenvalues of the suspension system shown below? What is the damping ratio? What is the undamped natural frequency? z M=10 K=90 y 10๐งฬ + 90๐ง = 90๐ฆ (b) It is desired to add a shock absorber (or viscous damper) as shown below so as to improve the ride quality of the suspension for bumps in the road. Derive a value for the damping coefficient b that will give an eigenvalue damping ratio of 0.707. 10๐งฬ + ๐๐งฬ + 90๐ง = ๐๐ฆฬ + 90๐ฆ M=10 K=90 b=? Bump 4.30 A system is expressed in the following transfer function format: 2(๐ + 2)(๐ + 8) ]๐(๐ ) (๐ + 10)(๐ + 20)(๐ 2 + 10๐ + 925)(๐ 2 + 24๐ + 2644) ๐(๐ ) = [ (a) What are the eigenvalues of this system? Note, check you work since the rest of this problem depends on you getting this part correct! (b) Is this system stable? Explain how you know? (c) What are the time constants of this system? 16 (d) What are the damping ratios, damped natural frequencies, and undamped natural frequencies of this system? (e) We know that if the input u(t) is a step input at time t=0, then z(t) will be of the following form: ๐ง(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก + ๐ถ4 ๐ −๐4๐ก ๐ ๐๐( ๐1 ๐ก + ๐1 ) + ๐ถ5 ๐ −๐5๐ก ๐ ๐๐( ๐2 ๐ก + ๐2 ) What are each of the following: ๐1 =? ___๐2 =? ___๐3 =? ___๐4 =? ___๐5 =? ___๐1 =? ___๐2 =? 4.31 The equations for a water tank are as follows: ๐๐ − ๐๐ − 5๐ปฬ = 0 ๐๐ = 10√๐ป Assume ๐๐ = 0 and ๐ป(0− ) = 4. Estimate how long it will take for the tank to drain by obtaining a straight line approximation for √๐ป and then getting an estimate for the time constant of the draining tank. Qi H Qo 4.32 Express the following differential equation in state variable matrix form; the output of interest is y=z-u. ๐งฬ + 8๐งฬ + 16๐ง = 25๐ขฬ + 32๐ข 4.33 The equations for an inverted pendulum are shown below. The force Fi is used to stabilize the mass Ms in the vertical position using a feedback controller; the input to the controller is ๐. Assuming small angles, the differential equations for this system are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the feedback controller is 17 ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] Prove mathematically that without the controller, this system is unstable. Ms ๏ฑ L z Mc Fi 4.34 The differential equation for the roll angle,๐, of a ship resulting from wave and wind disturbances, Td, is shown below ๏ฑ ๐ฬ + 1.8๐ฬ + 9๐ = 10−6 ๐๐ Assume that the torque disturbance ๐๐ is a sine wave, i.e. ๐๐ = 5000 ๐ ๐๐( 1.5๐ก) The roll angle ๐ of the ship will also be a sine wave. What will be the steady state amplitude and frequency of ๐(๐ก)? 4.35 The transfer function relating ๐(๐ ) to the input ๐(๐ ) is given below. ๐ +5 ๐(๐ ) = [๐ 2 +30๐ +200] ๐(๐ ) 9 Assume that the input u(t) is a sine wave, that is ๐(๐ ) = ๐ 2 +9. 18 It can be shown that the inverse Laplace transform of ๐(๐ ) is of the form ๐ง(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก ๐ ๐๐( ๐๐ก + ๐) Fill in the following table: ๐ถ1 r1 ๐ถ2 ๐2 ๐3 ๐ 4.36 The transfer function for the output of a system is shown below; R is the input and N(s) is a rational polynomial such as as2+bs+c, etc. ๐(๐ ) = [ (a) (b) (c) (d) (e) ๐(๐ ) ] ๐ (๐ ) (๐ + 2)[(๐ + 4)2 + 32 ][(๐ + 100)2 + 1002 ] What are the eigenvalues? What are the time constants? What are the damping ratios? What are the damped natural frequencies? If the input is a step, write the general form of the inverse Laplace of Y(s). Be as specific as possible. 4.37 After Laplace transforming a differential equation for z(t) with input r(t), the following result was achieved: 15๐ +680 ๐(๐ ) = [(๐ +4)[(๐ +2)2+82]] ๐ (๐ ) (a) (b) (c) (d) (e) (f) What is the transfer function for this system? _______________________ What are the eigenvalues of this system?___________________________ What are the time constants for this system? ________________________ What is the damping ratio of this system? _______________________ What is the damped natural frequency of this system? ____________ What is the undamped natural frequency, ๐๐ , of this system? ____________ 19 (g) (Suppose r(t) is a unit step input. It can be shown that z(t) will be of the form ๐ง(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก ๐ ๐๐( ๐๐ก + ๐) What are the following: ๐1 =? _______________ ๐2 =? _______________ ๐3 =? _______________ ๐ =? _______________ (h) What will be the final value of z(t), i.e. z(∞)? _______________________ 4.38 For the differential equation given below, demonstrate that z is always in the neighborhood of 2. Obtain a straight line approximation for ๐ง 3 and use it to obtain an estimate of the damping ratio and time constant of the system. 2๐งฬ + 3๐งฬ + 5๐ง 3 = 40 ๐ง(0− ) = 2.001 ๐งฬ (0− ) = 0.1 4.39 An analog controller Gc has been converted to z-transform format using the MATLAB 10๐ +1 commands shown below. ๐(๐ ) = ๐บ๐ (๐ )๐ธ(๐ ) = 100๐+1 ๐ธ(๐ ) >> Gc=tf([10 1],[100 1]); >> Gcd=c2d(Gc,0.001) ๐บ๐๐ = 0.1๐ง−0.0999 ๐ง−1 What is the digital code for this controller to be used in a digital computer program? 4.40 Consider the following differential equation for z: ๐งโ + 12๐งฬ + 189๐งฬ + 338๐ง = 16๐ขฬ + 32๐ขฬ + 169๐ข (a) What is the transfer function for z? (b) If ๐ 3 + 12๐ 2 + 189๐ + 338 = (๐ + 2)[(๐ + 5)2 + 122 ] (b.1) What are the eigenvalues of this system? (b.2) What are the time constants of this system? (b.3) What is the damping ratio? (b.4) How long will it take for z(t) to reach its final value within 1%? (b.5) What are MATLAB commands for entering this transfer function into MATLAB? (c) If the input u is a unit step and all initial conditions are zero, (c.1) What is Z(s)? 20 (c.2) What is the general format equation for z(t)? If you don’t know what ‘general format’ means, find z(t). (c.3) What is the final value of z(t)? 4.41 (a) Use Laplace transform and the residue theorem to solve the following differential equation for v(t); the input u is a unit step. ๐ฃ(0− ) = 3 2๐ฃฬ + 24๐ฃฬ + 40๐ฃ = 16๐ขฬ + 80๐ข ๐ฃฬ (0− ) = 0 (b) What is the final value of v? Check your answer using the final value theorem. (c) What are the MATLAB commands to get a plot of v(t) using the command ‘impulse’? (d) Express this differential equation in state variable format; assume z is the output of interest denoted by y below. A=? B=? C=? D=? ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข 4.42 Express the following system in state variable format assuming E is the output of interest. Matrix format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ ๐ฆ = ๐ถ๐ + ๐ท๐ E R + - 4 s u s+2 s+5 v w + - 1 s z 6 Note, w and v are mistakenly reversed in the diagram above. 4.43 Consider the differential equation below. 2๐ฆฬ + 48๐ฆฬ + 800๐ฆ = 60๐ฬ + 1600๐ (a) If r(t) is the input, what is the transfer function for y? (b) What is the DC gain of this system? ____________________ (c) What is the characteristic equation? ______________________ (d) What are the eigenvalues? ___________________________________ (e) What is the time constant? __________ What is the damping ratio? _____________ What is the undamped natural frequency?______________ What is the damped natural frequency? _____________ (f) If r is a step input, we know that the general form of y(t) will be ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก sin(๐๐ก + ๐) b= _________ d=__________ ๐ = __________ 21 4.44 Consider the block diagram shown below. (a) Express ๐บ๐ (๐ ) in state variable format (note, in this case E is the input). (b) Express G(s) in state variable format (note, in this case U is the input). (c) Using the results of (a) and (b) above, express the total system in matrix state variable format; assume u(t) is the output of interest in the equation for y, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ ๐ฆ = ๐ถ๐ + ๐ท๐ A=? B=? C=? D=? Gc (s ) R +- E 0.2 s + 1 U 0.02 s + 1 G (s ) 2s + 3 s + 4 s + 12 V 2 4.45 As shown below, two water tanks with the same diameter are connected by a long pipe. Initially, before the water is allowed to flow through the pipe, the height H1 of the water in tank #1 is greater than the height H2 of the water in tank #2. The volume of the water in the pipe is significantly larger than the tank volumes; thus, the inertia of the moving water in the pipe is significant. H1 H2 Q The equations for this system are as follows: Equation for height of water in tank #1: −๐ − 10๐ปฬ1 = 0 Equation for height of water in tank #2: ๐ − 10๐ปฬ2 = 0 ๐ป1 (0− ) = 10 ๐ ๐ป2 (0− ) = 5 ๐ Equation for turbulent flow ๐ through pipe: (๐ป1 − ๐ป2 ) = 50๐ฬ + 2๐ ๐(0− ) = 0 ๐3 ๐ 1. Knowing the initial and final values and given that the time constant for this system is 50 seconds, draw an estimate of the graph of H1(t). 2. Laplace transform the equations and solve for H1(s). 3. It can be shown that the inverse Laplace transform of the correct H1(s) is as follows 22 ๐ป1 (๐ก) = 7.5 + 2.638๐ −0.02๐ก sin (0.06๐ก + 1.2483) As demonstrated in the 2nd lecture, use MATLAB to plot H1(t). What aspects of your estimated plot and the MATLAB plot agree? What aspects do they not agree? Note, in MATLAB when multiplying two functions of time, you must use .* instead of just * since t is a vector of time values. This is equivalent to the dot product of two vectors. 4.46 1. Show the 4-quadrant position and then find the magnitude and angle of each of the following complex numbers: (a) 3+j4 (b) -3+j4 (c) -3-j4 (d) 3-j4 2. Find the magnitude and angle of the complex number A below: (3 + ๐4)(−3 + ๐4) −3 − ๐4 3. Repeat 1. and 2. above but this time use MATLAB to do the calculations to confirm your answers. In MATLAB, to compute the magnitude use command ‘abs’; to compute the 4quadrant angle, use the command ‘angle’. ๐ด= 4. The 2-mass system shown below with force input Fi is defined by the following two simultaneous differential equations: 5๐ฆฬ + 42๐ฆฬ + 500๐ฆ = 90๐ง + 6๐งฬ 10๐งฬ + 6๐งฬ + 90๐ง = 90๐ฆ + 6๐ฆฬ + ๐น๐ y z force input Fi Use MATLAB to find the following: 23 (a) (b) (c) (d) (e) (f) Find the transfer function relating Y(s) to the input Fi(s). What are the eigenvalues? What are the damped natural frequencies? What are the time constants? What are the undamped natural frequencies? What is the DC gain of the transfer function? What is the meaning of the DC gain? 4.47 The equations for an inverted pendulum are shown below. The force Fi is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Fi on the cart. Assuming small angles, the differential equations for the pendulum and cart are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the force Fi is ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] Ms ๏ฑ L z Mc Fi (a) What are the unknowns in these three equations? (b) Find the Laplace transform for the pendulum angle assuming all initial conditions are zero except the initial pendulum angle ๐(0− ) = 0.1 ๐๐๐. Note, there is no external input to this system so there is no transfer function. (c) What are the poles of the denominator of your Laplace transform found in part b? 4.48 The equations for an inverted pendulum are shown below. The force Fi is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Fi on the cart. Assuming small angles, the differential equations for the pendulum and cart are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the force Fi is ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] 24 Ms ๏ฑ L z Mc Fi (a) What are the unknowns in these three equations? (b) Find the Laplace transform for the pendulum angle assuming all initial conditions are zero except the initial pendulum angle ๐(0− ) = 0.1 ๐๐๐. Note, there is no external input to this system so there is no transfer function. (c) What are the poles of the denominator of your Laplace transform found in part b? 4.49 The Laplace transform of an engineering system is found to be the following: 100(4๐ 2 + 12๐ + 16) ๐(๐ ) = (๐ + 5)[(๐ + 2)2 + 32 ][(๐ + 15)2 + 82 ] (a) Obtain an equation for y(t) by finding the inverse Laplace of Y(s). It is okay to use MATLAB to do the complex arithmetic associated with the coefficients. (b) Use the MATLAB command ‘impulse’ to generate values for y(t) and t. Then, use the values of t in your equation from (a) and plot both solutions for y(t) on the same graph for comparison. How do they compare? 4.50 This problem pertains to improving the performance of a pile driver by changing the frequency of hitting the top of the pile (steel beam) with force Fi. The output of interest is the contact force Fo with the ground at the bottom of the pile. By carefully selecting the input frequency to approximately match one of the resonant frequencies of the beam, the pile is driven into the ground faster and more efficiently. The stress waves in the pile are defined by partial differential equations representing an infinite number of modes. However, it is possible to approximate the stress waves using a lumped parameter model such as shown below and obtain a finite order ordinary differential equation represented by a transfer function. 25 Fi Fo A typical transfer function for a five-lumped model of a pile is the following: ๐น๐ (๐ ) =[ 3125๐ 10 + 11250๐ 9 + 126500๐ 8 32๐ 5 + 1600๐ 4 + 32000๐ 3 + 320000๐ 2 + 1600000๐ + 3200000 ] ๐น (๐ ) + 287000๐ 7 + 1611200๐ 6 + 2148032๐ 5 + 7721600๐ 4 + 4832000๐ 3 + 12320000๐ 2 + 1600000๐ + 3200000 ๐ (a) Use the DC gain of this transfer function to determine the force at the ground if the input (b) (c) (d) (e) force is a constant of 1000 N. This is an input that could be generated by setting a 1000 N weight on top of the pile. Does your answer using the DC gain to compute the ground force make sense? Use the ‘damp’ command with the lumped model transfer function to approximate the actual resonant frequencies of this pile; the resonant frequencies are the damped natural frequencies in the eigenvalues. Suppose instead of a constant input, the input is sinusoidal with an amplitude of 1000 N. Using the MATLAB command ‘bode’ to generate the frequency response of this transfer function, determine the input frequency ๐๐ that generates the greatest force amplitude Ag at the ground. At this frequency, what is the corresponding amplitude of the force at the ground in Newtons? Note, the frequency response plot magnitude is in dB where M (dB) =20Log10( M). It suggested that you improve the resolution on your plot by limiting the frequency range to a relatively small band of frequencies around the peak. How does this input frequency from the frequency response compare with the damped natural frequency of the first mode? Examine your frequency response plot in (b) and confirm that the DC gain is the same as the low frequency magnitude of the transfer function. What is the low frequency gain of the transfer function in dB? Note, the zero frequency gain is the same thing as the DC gain. Realizing that it is not realistic for the input force from a pile driver to be a sinewave since that would require a pushing and pulling action, generate a series of pulses for the force input using the pulse generator M-file provided on Blackboard. The pulse period is 2๐/๐๐ where ๐๐ is the frequency found in (c) in rad/s. The magnitude of each pulse should be 1000 N. The width of each pulse should be less than or equal to 1/20 of the pulse period. Use the command ‘lsim’ to generate and plot Fo(t) for the pulse input. Be sure to run your simulation much longer than 5๐๐๐๐ฅ so you can see the peak amplitude of the steady state response of the force at the ground. 26 (f) To investigate the significance of the input frequency on the output peak values, repeat (e) but using input frequencies that are 20% greater and 20% less than the resonant frequency. What is the significance of being as close as possible to the resonant frequency? 4.51 1. A spring-mass –damper system is shown below; the displacement of the mass is z. z spring damper mass The differential equation for the position of the mass is as follows ๐งฬ + 0.1๐งฬ + 0.01๐ง = 0 ๐ง(0− ) = 0 ๐งฬ (0− ) = 2 ๐/๐ (a) Draw an best guess estimate of the plot of z(t). Be sure to show the initial and final values and the approximate time to reach the final value. Do this before proceeding to the next parts of the assignment. (b) Express this differential equation in state variable format and then use ode45 in MATLAB to generate a plot of z(t). Does this plot agree with your plot in (a)? 2. When a 2nd mass is added to the system, we now have two simultaneous equations for the system. (a) Express this system of equations in state variable format and write the initial conditions for the state variables. (b) Use ode45 to generate a plot of ๐งฬ (๐ก). ๐ ๐ ๐คฬ + 0.05๐คฬ + 0.005๐ค = 0.05๐งฬ + 0.005๐ง ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐งฬ + 0.15๐งฬ + 0.015๐ง = 0.05๐คฬ + 0.005๐ค z ๐ง(0− ) = 0 ๐งฬ (0− ) = 2 w 27 4.52 The schematic of a vehicle suspension system is shown below. The vehicle is moving to the right. At t = 0, the contact point at the ground encounters a step with magnitude 0.02 m. All initial conditions are zero. ๐งฬ + 20๐งฬ + 100๐ง = 20๐ขฬ + 100๐ข (a) Use ode45 to obtain a plot of ๐งฬ (๐ก). Explain why ๐งฬ (0+ ) is not equal to ๐งฬ (0− ). (b) Use SIMULINK to obtain a plot of ๐งฬ (๐ก). Confirm that the (a) and (b) results are the same by putting them on the same graph. 4.53 The equations for an inverted pendulum are shown below. The feedback force Ff is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Ff on the cart. Assuming small angles, the differential equations for the pendulum and cart are listed below as well as the transfer function for the feedback control force Ff. Equation for summing the moments on the pendulum bar and mass: ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 Equation for the force balance on the cart: ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 ๐ +6 Transfer function from feedback control design theory: ๐น๐ (๐ ) = −149.6 [๐ +8] ๐(๐ ) Ms ๏ฑ L z Ff Mc (a) Assume that the initial conditions are ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 ๐(0− ) = 0.1 ๐ฬ (0− ) = 0.05 ๐๐๐/๐ (10%) Estimate the plots of ๐(๐ก) and ๐ฬ (๐ก). Do this before running the next part. 28 (30%) Construct a SIMULINK diagram for this system and obtain plots of ๐(๐ก) and ๐ฬ (๐ก). (10%) Do the plots start and end at the correct values? ________________ (b) Express these equations in state variable format and then use ‘lsim’ with an initial condition vector to generate plots of ๐(๐ก) and ๐ฬ(๐ก). Are the plots in (a) the same as those in (b)? ________________ Hint: Solve for ๐งฬ in the 2nd equation and substitute it into the 1st equation to get an equation for ๐ฬ which can then be substituted back into the original 2nd equation. Also, note there is no input so B and D contain only zeros. 4.54 This assignment is a review of using symbolic math in MATLAB to get transfer functions, a review of the phase variable method to get state variable equations for transfer functions with equal order numerators and denominators, and a review of the use of ‘lsim’ to do time domain simulations. Also, this assignment is an introduction to the use of ‘lsim’ for simulating systems with random inputs. Consider the schematic of a vehicle suspension shown below. It is of interest to determine the levels of up and down acceleration in g’s that would be experienced by a passenger riding in this vehicle over a typical country road at a speed of 30 m/s. The differential equations for this suspension for road irregularities u(t) are also shown. The equation for the output of interest a(t) is also shown. Note, ๐งฬ is the up and down acceleration; dividing ๐งฬ by 9.8 m/s2 gives the acceleration in g’s. 29 (a) Use symbolic math to confirm the transfer function for a(s). What are the eigenvalues? (b) Using the phase variables method, express this transfer function in state variable format considering that ‘a’ is the output of interest. (c) Use the two M-files ‘StochInput’ and ‘dpsd’ to generate values for the road profile irregularities u(t), i.e. >> [u,t]=StochInput(4096,0.005); % This command generates 4096 values for u(t) separated by a time interval of 0.005 seconds. At 30 m/s, that is a value every 0.15 m. The M-file ‘dpsd’ defines the roughness of the road as a function of the wavelength of the irregularities. Generate two plots of u(t); the first plot shows all of u(t) and the second plot goes out to only 1 second using the ‘axis’ command. (d) Use ‘lsim’ and the state variable model to generate a plot of a(t). After the transients have died out (5 times the largest time constant), what is the observed peak value of normalized acceleration, a(t)? Do you think this value is small enough for passenger comfort? function [G]=dpsd(f) G=4e-6*30^1.1/f^2.1; end 30 Solutions to Example Problems 5.1 A mass sits at equilibrium on top of a spring and damper as shown below. Mass Spring x Damper It can be shown that the differential equation for the position of the mass ๐ฅ is given by ๐2๐ฅ ๐๐ฅ 10 2 + 60 + 80๐ฅ = 160 ๐๐ก ๐๐ก (a) What is the dependent variable in the differential equation? x (b) What is the independent variable in the differential equation? t (c) What is the order of the differential equation? 2nd (d) Is the differential equation linear or nonlinear? linear (e) What is the equilibrium value of x? 160/80=2 (f) If the mass is disturbed, it will eventually return to the equilibrium position. Why? This a passive system which means that energy is dissipated over time; there is no external energy source. 5.2 Consider the following differential equation for a suspension system: ๐ฆฬ + 6.5๐ฆฬ + 9,800๐ฆ 3 = 9.8 1. What is the order of the differential equation? ___2nd_________ 2. Assuming ๐ฆ(๐ก) → ๐๐๐๐ ๐ก๐๐๐ก as ๐ก → ∞, what will be the value of this constant?____0.1_______ 0 + 0 + 9,800๐ฆ 3 = 9.8 ๐กโ๐ข๐ ๐ฆ = 0.1 3. Assuming that the initial conditions for this differential equation are ๐ฆฬ (0− ) = 0 ๐๐๐ ๐ฆ(0− ) = 0, draw a sketch of ๐ฆ(๐ก) starting at ๐ก = 0. y(t) 0.1 0 time 31 4. Obtain a linear approximation for this differential equation by obtaining a straight line approximation for ๐ฆ 3 using the two point method. Be sure to start by sketching ๐ฆ 3 and noting the two points for your straight line. y3 y 3 ๏ป .01 y + 0 0.001 0 0.1 y 5. After substituting your straight line into the original differential equation, check to see if the new linearized differential equation gives the correct final value. ๐ฆฬ + 6.5๐ฆฬ + 9,800(0.01๐ฆ) = 9.8 ๐ฆ(∞) = 0.1 5.3 Consider the following spring-mass-damper system with input u(t). z M k b k b u The input (independent variable) to this system is the displacement u. The equations for this suspension system are 10๐งฬ + ๐1 + ๐2 = 0 ๐1 = 100(๐ง − ๐ฃ) ๐2 = 5(๐งฬ − ๐ฃฬ ) ๐3 = 100(๐ฃ − ๐ข) ๐4 = 5(๐ฃฬ − ๐ขฬ ) ๐1 + ๐2 − ๐3 − ๐4 = 0 (a) List the unknowns (dependent variables) and confirm that the number of equations matches the number of unknowns. 6 equations with unknowns: ๐1 , ๐2 , ๐3 , ๐4 , ๐ง, ๐๐๐ ๐ฃ 32 (b) Use the "D" operator to convert the differential equations to algebraic equations. 10๐ท2 ๐ง + ๐1 + ๐2 = 0 ๐1 = 100(๐ง − ๐ฃ) ๐2 = 5๐ท(๐ง − ๐ฃ) ๐3 = 100(๐ฃ − ๐ข) ๐4 = 5๐ท(๐ฃ − ๐ข) ๐1 + ๐2 − ๐3 − ๐4 = 0 (c) Eliminate ๐1 , then eliminate ๐2 , then eliminate ๐3 , and then eliminate ๐4 . How many equations with which unknowns do you have left? 10๐ท2 ๐ง + 100(๐ง − ๐ฃ) + 5๐ท(๐ง − ๐ฃ) = 0 100(๐ง − ๐ฃ) + 5๐ท(๐ง − ๐ฃ) − 100(๐ฃ − ๐ข) − 5๐ท(๐ง − ๐ฃ) = 0 Two equations with unknowns z and v. 5.4 (a) Laplace transform the following differential equation and solve for the Laplace transform Z(s). 2๐งฬ + 12๐งฬ + 36๐ง = 24 ๐ง(0− ) = 0 ๐งฬ (0− ) = 4 Note, the answer should be in the format of a numerator polynomial over a denominator polynomial. Your answer is not complete until it is in this format. 2(๐ 2 ๐(๐ ) − 0๐ − 4) + 12(๐ ๐(๐ ) − 0)+36Z(s)=24/s ๐(๐ ) = 8๐ + 24 + 12๐ + 36) ๐ (2๐ 2 (b) The final value theorem is ๐ง(๐ก)๐ก→∞ = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →0 Apply the final value theorem to your Z(s) and see if it gives the correct final value. 0 + 24 = 0.666 0 + 0 + 36 Setting the derivatives of z in the original differential equation and solving for z gives 0.666 which checks. ๐ ๐(๐ )๐ →0 = (c) The initial value theorem is ๐ง(๐ก)0+←๐ก = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →∞ Apply the initial value theorem and see if it gives ๐ง(0− ). ๐ ๐(๐ )๐ →∞ = 0 which is the initial value of z. 33 5.5 (a) Solve the following differential equation x(t) using separation of variables if x(0) =4. 2๐ฅฬ + 6๐ฅ = 0 ๐ฅ(๐ก) = 4๐ −3๐ก (b) Confirm that your solution is correct using the original differential equation. 2(−12)๐ −3๐ก + 6(4๐ −3๐ก ) = 0 5.6 1. The Laplace transform of z(t) is as follows: ๐(๐ ) = 6๐ 2 + 12๐ + 5 ๐ (๐ + 4)[(๐ + 2)2 + 82 ] We know that the inverse Laplace of Z(s) will be of the following format: ๐ง(๐ก) = ๐๐ ๐๐ก + ๐๐ ๐๐ก + ๐๐ ๐๐ก sin (๐๐ก + ๐) 5 ๐= = 0.184 4 ∗ 68 ๐=0 ๐= 6(−4)2 + 12(−4) + 5 = −0.07 (−4)([(−4 + 2)2 + 82 ] ๐ = −4 ๐ = −2 ๐=8 2. The equation for Y(s) is written below in terms of the input U(s). ๐(๐ ) = [ 6๐ 2 + 3๐ + 84 ] ๐(๐ ) (๐ + 3)[(๐ + 5)2 + 92 ] 6๐ 2 +3๐ +84 (a) What is the transfer function? [(๐ +3)[(๐ +5)2+92]] (b) What are the eigenvalues? ๐ = −3 ๐๐๐ − 5 ± ๐9 34 (c) What are the time constants? 1 3 ๐๐๐ 1 5 (d) If u(t) is a unit impulse, what is U(s) and what is Y(s)? ๐(๐ ) = 1 6๐ 2 + 3๐ + 84 ๐(๐ ) = [ ] (๐ + 3)[(๐ + 5)2 + 92 ] 5.7 Laplace transform the differential equation below and then solve for Z(s). 3๐งฬ + 6๐งฬ + 12๐ง = 18 ๐ง(0− ) = 2 ๐งฬ (0− ) = 4 ๐งฬ + 2๐งฬ + 4๐ง = 6 18 ๐ 2 ๐(๐ ) − 2๐ − 4 + 2(๐ ๐(๐ ) − 2) + 4๐(๐ ) = ๐ 2๐ 2 + 8๐ + 6 ๐(๐ ) = ๐ (๐ 2 + 2๐ + 4) 5.8 Consider the following Laplace transform: ๐(๐ ) = 15๐ 3 + 2๐ 2 + 640 ๐ (5๐ 4 + 162๐ 3 + 1424๐ 2 + 3744๐ + 1280) What will be the final value of z(t) found using the final value theorem? ๐ง(∞) = 0 + 0 + 640 = 0.5 0 + 0 + 0 + 0 + 1280 What is the initial value of z(t) as determined from the initial value theorem? ๐ง(0+ ) = 0 What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command. >> num=[15 2 0 640]; >> den=[5 162 1424 3744 1280 0]; >> z=tf(num,den); >> impulse(z) 35 5.9 Consider the two simultaneous equations below for a mechanical lift system with step input u(t) with magnitude of 5. 10๐ฆฬ + 6๐ฆฬ + 3๐ฆ = 2๐ฃ ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 5 2๐ฃฬ + +10๐ฃ − 4๐ฆ = 2๐ข ๐ฃ(0− ) = 4 Convert these equations to the Laplace domain by Laplace transforming the equations. ๐ฆฬ + 0.6๐ฆฬ + 0.3๐ฆ = 0.2๐ฃ ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 5 ๐ฃฬ + 5๐ฃ − 2๐ฆ = ๐ข ๐ฃ(0− ) = 4 Laplace transforming gives ๐ 2 ๐(๐ ) − 5 + 0.6๐ ๐(๐ ) + 0.3๐(๐ ) = 0.2๐(๐ ) 5 ๐ ๐(๐ ) − 4 + 5๐(๐ ) − 2๐(๐ ) = ๐ 5.10 For the differential equation below, use Euler’s numerical integration to compute the first two solution values of x(t) using a time step of 0.01. ๐(๐− ) = ๐ ๐ฬ + ๐๐๐ = ๐๐ Time t x(t) ๐ฬ (๐) = ๐๐ − ๐๐๐(๐) x(t+T)=x(t)+T๐ฬ (๐) 0 1 20-10*1=10 1+0.01*10=1.1 0.01 1.1 20-10*1.1=9 1.1+0.01*9=1.19 0.02 1.19 20-10*1.19=8.1 1.19+0.01*8.1=1.271 Use the inverse Laplace transform and solve for the exact solution of x(t) and compare the numerical solution values with the exact solution values. ๐๐ฟ(๐) − ๐ + ๐๐๐ฟ(๐) = ๐ฟ(๐) = ๐๐ ๐ ๐๐ + ๐ ๐(๐ + ๐๐) ๐(๐) = ๐ − ๐−๐๐๐ t Numerical x(t) ๐(๐) = ๐ − ๐−๐๐๐ 0 1 1 0.01 1.1 1.09516 0.02 1.19 1.18127 36 5.11 The differential equations for the suspension shown below with input displacement u(t) are 10๐งฬ + 100๐งฬ + 1000๐ง = 100๐คฬ + 1000๐ค 100๐คฬ + 4000๐ค = 100๐งฬ + 1000๐ง + 3000๐ข (a) Assume all initial conditions are zero and convert the equations above to Laplace domain. Z W U ๐งฬ + 10๐งฬ + 100๐ง = 10๐คฬ + 100๐ค ๐คฬ + 40๐ค = ๐งฬ + 10๐ง + 30๐ข Laplace transforming gives (๐ 2 + 10๐ + 100)๐(๐ ) = (10๐ + 100)๐(๐ ) (๐ + 40)๐(๐ ) = (๐ + 10)๐(๐ ) + 30๐(๐ ) (b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get (๐ + 10)๐(๐ ) + 30๐(๐ ) (๐ + 40) (๐ + 10)๐(๐ ) + 30๐(๐ ) (๐ 2 + 10๐ + 100)๐(๐ ) = (10๐ + 100) (๐ + 40) ๐(๐ ) = ๐(๐ ) = [ 3000 + 300๐ ] ๐(๐ ) ๐ 3 + 40๐ 2 + 300๐ + 3000 5.12 Express the following differential equation with input u in state variable format. What are the initial conditions for the state variables? ๐ฬ + ๐๐ฬ + ๐๐๐ = ๐๐๐ฬ + ๐๐๐ ๐๐ = ๐ ๐(๐− ) = ๐ ๐๐ = ๐ฬ − ๐๐๐ ๐ฬ ๐ = ๐๐ + ๐๐๐ ๐ฬ (๐− ) = ๐. ๐ ๐๐ (๐− ) = ๐ ๐(๐− ) = ๐ ๐๐ (๐− ) = ๐. ๐ ๐ฬ ๐ = −๐๐๐๐ − ๐๐๐ − ๐๐๐ 37 5.13 A dynamic system is represented by the differential equation shown below. ๐งฬ + 7๐งฬ + 10๐ง = 14๐ขฬ + 20๐ข (a) What is the transfer function of this system? 14๐ + 20 2 ๐ + 7๐ + 10 (b) What are the eigenvalues of this system? Eigenvalues = -5 and -2 (c) What are the time constants for this system? Time constants = 1/5 and 1/2 (d) Suppose the input u(t) is a unit step. What will be the final value of z(t)? 0 + 0 + 10๐ง(∞) = 0 + 20(1) ๐ง(∞) = 2 (e) How long will it take for z(t) to be within 1% of this final value? It takes about five times the largest time constant = 5/2 = 2.5 seconds 5.14 Perform the following matrix operations: 1 2 3 1 4 7 ๐ = [4 5 6] ๐๐ = [2 5 8] 7 8 9 3 6 9 1 2 3 1 6 (2) ๐ = [4 5 6] ๐ = [ 1] ๐๐ = [15] 7 8 9 1 24 ๐ฅ1 (3) [−2 4 −1] [๐ฅ2 ] = −2๐ฅ1 + 4๐ฅ2 − ๐ฅ3 ๐ฅ3 ๐ข1 + 2๐ข2 1 2 ๐ข 1 (4) [3 4] [๐ข ] = [3๐ข1 + 4๐ข2 ] 2 5๐ข1 + 6๐ข2 5 6 1 4 5 5 (5) [2] [4 5 6] = [ 8 10 12] 3 12 15 18 1 1 1 (6) [2] .∗ [2] = [4] 3 3 9 (1) Express the differential equation below in matrix state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐งโ + 2๐งฬ + 3๐งฬ + 8๐ง = 10๐ข ๐ฆ = 0.1๐งฬ ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅ3 = ๐งฬ ๐ฅฬ 1 0 1 0 ๐ฅ1 0 [๐ฅฬ 2 ] = [ 0 0 1 ] [๐ฅ2 ] + [ 0 ] ๐ข ๐ฅฬ 3 −8 −3 −2 ๐ฅ3 10 ๐ฆ = [0 0 ๐ฅ1 ๐ฅ 0.1] [ 2 ] + [0]๐ข ๐ฅ3 38 5.15 Solve the following differential equation using separation of variables. 20๐งฬ + 60๐ง = 80 ๐ง(0− ) = 2 ๐ง(๐ก) ๐ก 1 ∫ ๐๐ง = − ∫ ๐๐ก = −๐ก 3๐ง − 4 2 0 Integrating gives 4 2 ๐ง(๐ก) = + ๐ −3๐ก 3 3 5.16 The differential equation for the suspension system shown below is ๐งฬ + 0.8๐งฬ + ๐ง = 0.8๐ขฬ + ๐ข z u (a) Express this differential equation in state variable format assuming y = u -z is the output of interest. ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ − 0.8๐ข 0 1 0.8 ๐ฬ = [ ]๐ + [ ]๐ข −1 −0.8 0.36 ๐ฆ = [−1 0]๐ + [1]๐ข (b) Enter your state variable equations in MATLAB using the ‘ss’ command. >> A=[0 1;-1 -0.8]; >> B=[0.8;0.36]; >> C=[-1 0]; >>D=[1]; >>G=ss(A,B,C,D); (c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values? >> ev=eig(A) Eigenvalues = -0.4 ± j0.8 (d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot start and end at the correct initial and final values? >> step(G) The value of y at t = 0+ is 1 and the final value is 0. 39 5.17 Obtain a straight line approximation for x3 in the neighborhood of x=2. ๐๐ ≈ ๐๐ + ๐(๐)๐ (๐ − ๐) = ๐๐๐ − ๐๐ 5.18 Two simultaneous differential equations are shown below. ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −100๐ฅ1 − 2๐ฅ2 What are the two unknowns? ๐ฅ1 ๐๐๐ ๐ฅ2 ๐๐๐ ๐กโ๐ ๐ข๐๐๐๐๐ค๐๐ Eliminate ๐ฅ2 and find a single differential equation for ๐ฅ1 . To eliminate ๐ฅ2 , we need to use the s or D operator: −100 ๐ท๐ฅ1 = ๐ฅ2 = ๐ฅ ๐ท+2 1 Which gives ๐ฅฬ 1 + 2๐ฅฬ 1 + 100๐ฅ1 = 0 5.19 (a) Express the differential equation shown below in state variable format using matrices, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? The output of interest is ๐ฆ = ๐ง. 4๐งฬ + 24๐งฬ + 40๐ง = 24๐ขฬ + 40๐ข ๐ง(0− ) = 3 ๐งฬ (0− ) = 2 ๐ข(๐ก) = ๐ข๐๐๐ก ๐ ๐ก๐๐ ๐ด = [0 1; −10 − 6]; ๐ต = [6; −26]; ๐ถ = [1 0]; ๐ท = [0] (b) What are the initial conditions for the state variables, i.e. ๐ฅ1 (0− ) =?, ๐ฅ2 (0− ) =?, ๐๐ก๐. ๐ฅ1 (0− ) = 3 ๐ฅ2 (0− ) = 2 (c) For an ode45 numerical simulation, what would you specify for the final time (when to stop the simulation)? Final time =5/3 sec. 5.20 1. For each differential equation below, answer the following questions: (a) ๐ฃฬ + 16๐ฃฬ + 12๐ฃ = 5 Is the equation linear?__yes___ What is the order? ___2nd_ What is the dependent variable?_v_____ What is the independent variable? time What is the final value of the dependent variable? 5/12=0.4166 (b) 2๐ฆโ + 0.4๐ฆฬ + 0.1(๐ฆฬ )5 + 10๐ฆ = 24 Is the equation linear?__no What is the order? ___3rd What is the dependent variable?_y____ What is the independent variable? time What is the final value of the dependent variable? 2.4 2. Before the valve on the water tank is opened, the height H of the water in the tank is 10 m. Once the valve is opened, water flows out of the tank. The differential equation for H with water flowing out is as follows 4๐ปฬ + 0.8√๐ป = 0 (a) On the sketch below, draw a reasonable estimate of H as a function of time. 40 H 10 H valve flow 0 time Use separation of variables to solve this differential equation for H(t). ๐ป(๐ก) ๐ก ๐๐ป 4∫ = − ∫ 0.8๐๐ก ๐ป(๐ก) = (√๐ป(0) − 0.1๐ก)2 √๐ป(๐ก) − √๐ป(0) = −0.1๐ก ๐ป(0) √๐ป 0 Does your equation for H(t) give the correct initial and final values for H? Equation for H(t) ๐ป(๐ก) = (√10 − 0.1๐ก)2 Initial value of H from the equation ๐ป(0) = (√10 − 0.1 ∗ (0))2 = 10 √ 2 Final value of H from the equation ๐ป(∞) = (√10 − 0.1๐ก) = 0 √๐ป cannot go negative 3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that is, nothing is moving. cart spring pendulum If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left and then released, the cart will start rolling back and forth compressing and extending the spring while the pendulum swings back and forth. z ๏ฑ 41 It can be shown, for small angles, the following two simultaneous equations with unknowns ๐ง ๐๐๐ ๐ accurately model the dynamics of this system ๐ฬ + 3๐ฬ + 9๐ = −0.9๐งฬ 7๐งฬ + 175๐ง = −2๐ฬ ๐(0− ) = ๐0 ๐ง(0− ) = 0 ๐ฬ(0− ) = 0 ๐งฬ (0− ) = 0 Using the Laplace transform, convert these equations to algebraic equations, eliminate ๐, and finally end up with an equation for ๐(๐ ). (๐ 2 + 3๐ + 9)๐(๐ ) − ๐ ๐0 − 3๐0 = −0.9๐ 2 ๐(๐ ) (7๐ 2 + 175)๐(๐ ) = −2๐ 2 ๐(๐ ) + 2๐ ๐0 Which simplifies to ๐(๐ ) = [ 90๐0 ] 26๐ 4 + 105๐ 3 + 1190๐ 2 + 2625๐ + 7875 5.21 1. Obtain a linear approximation to the following differential equation using the initial and final values of z. ๐งฬ + 3๐งฬ + 6√๐ง = 12 ๐ง(0− ) = 1 0 + 0 + 6√๐ง = 12 ๐กโ๐ข๐ , ๐ง(∞) = 4 1 2 √๐ง ≅ ๐ง + 3 3 ๐ง 2 ๐งฬ + 3๐งฬ + 6[ + ] = 12 3 3 ๐งฬ + 3๐งฬ + 2๐ง = 8 2. Consider the following Laplace transform for Z(s): ๐(๐ ) = 6๐ 2 + 20๐ + 80 ๐ [๐ 2 + 12๐ + 40] (a) Use the final value theorem (FVT) to compute the final value of z(t). 80 ๐ ๐(๐ )๐ =0 = =2 40 (b) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+. ๐ ๐(๐ )๐ =∞ = 6 42 (c) What are the poles of Z(s) which are the roots of the denominator polynomial? ๐ = 0, − 6 + ๐2, − 6 − ๐2 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ป1 (0− ) = 3 ๐ − 40๐ปฬ2 = 0 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 250๐ฬ ๐(0− ) = 0 H1 H2 Q (a) Laplace transform each of these three equations. −๐ − 20[๐ ๐ป1 (๐ ) − 3] = 0 ๐ − 40[๐ ๐ป2 − 5] = 0 ๐ป1 − ๐ป2 = 250[๐ ๐(๐ ) − 0] (b) Reduce the equations down to two equations with unknowns H1(s) and H2(s) . ๐ป1 − ๐ป2 ๐= 250๐ Thus, − ๐ป1 − ๐ป2 − 20[๐ ๐ป1 (๐ ) − 3] = 0 250๐ ๐ป1 − ๐ป2 − 40[๐ ๐ป2 − 5] = 0 250๐ (c) Reduce the equations down to one equation for the unknown H1(s). ๐ป2 = [5,000๐ 2 + 1]๐ป1 + 15,000๐ Thus, ๐ป1 = 1.5๐ฅ108 ๐ 2 + 65,000 ๐ (5๐ฅ107 ๐ 2 + 15,000) (d) Use the final value theorem to determine the final value of H1. Does this value make sense? 65,000 ๐ ๐ป1 (๐ )๐ =0 = = 4.333 15,000 43 Since the initial water height in this tank was 3 and the other 5, a final value between 3 and 5 makes sense. However, since the poles of H1(s) are complex with zero real part, the H 1 will not converge to a constant but oscillate forever. You can’t use the final value theorem in such cases. (e) Use the initial value theorem to check the initial value. Is it correct? ๐ ๐ป1 (๐ )๐ =∞ = 1.5๐ฅ108 5๐ฅ107 = 3 which is the correct value. 5.22 1. The differential equations for the suspension shown below with input displacement u(t) are ๐งฬ + 10๐งฬ + 100๐ง = 10๐คฬ + 100๐ค ๐คฬ + 40๐ค = ๐งฬ + 10๐ง + 30๐ข (a) Assume all initial conditions are zero and convert the equations above to Laplace domain. Z W U (๐ 2 + 10๐ + 100)๐ = (10๐ + 100)๐ (๐ + 40)๐ = (๐ + 10)๐ + 30๐ (b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get ๐(๐ ) = [ ๐ 3 3000 + 300๐ ] ๐(๐ ) + 40๐ 2 + 300๐ + 3000 ๐ 2 + 10๐ + 100 (๐ + 40) ( ) ๐ = (๐ + 10)๐ + 30๐ 10๐ + 100 (๐ + 40)(๐ 2 + 10๐ + 100) = (10๐ + 100)(๐ + 10)๐ + 30(10๐ + 100)๐ (๐ 3 + 50๐ 2 + 500๐ + 4000 − 10๐ 2 − 200๐ − 1000)๐ = (300๐ + 3000)๐ 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 (c) What is the transfer function for this system? [ 3000 + 300๐ ] ๐ 3 + 40๐ 2 + 300๐ + 3000 (d) Consider the following MATLAB command and results: >> roots([1 40 300 3000]) ans = -33.7442 -3.1279 + 8.8950i -3.1279 - 8.8950i 44 What are the eigenvalues of this system? -33.7442 -3.1279 + 8.8950i -3.1279 - 8.8950i (e) (8%) What are the time constants of this system? 1/33.7442 = 0.0296 and 1/3.1279 = 0.3197 (f) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown to be ๐ง(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (โ๐ก + ∅) ๐(๐ ) = [ What are b=0 d = 33.7442 ๐ 3 3000 + 300๐ 1 ] 2 + 40๐ + 300๐ + 3000 ๐ g = 3.1279 h = 8.8950 (g) What is the final value of z(t) and how long will it take to get within 1% of this value? Final Value = sZ(s)s=0 = 3000/3000 = 1 Time required ≅ 5*0.3197 =1.6 sec 2. Use the residue theorem to solve the following differential equation for y(t). 22๐ฆฬ + 44๐ฆ = 88 ๐ฆ(0− ) = 5 22(๐ ๐๐ ) − 5) + 44๐(๐ ) = 88/๐ ๐(๐ ) = 5๐ + 4 ๐ (๐ + 2) ๐ฆ(๐ก) = 2 + 3๐ −2๐ก 3. Use separation of variables to solve the differential equation in problem 2. ๐ฆ(๐ก) ๐ก ๐๐ฆ ∫ = − ∫ ๐๐ก ๐ฆ(0) 2๐ฆ − 4 0 ๐๐ [ 2๐ฆ(๐ก) − 4 ] = −2๐ก 2๐ฆ(0) − 4 2๐ฆ(๐ก) − 4 = ๐ −2๐ก 2๐ฆ(0) − 4 ๐ฆ(๐ก) = 2 + 3๐ −2๐ก 5.23 1. Find the magnitude and angle of the following complex numbers: 45 +4 +4 ๐๐๐๐๐ = ๐ก๐๐−1 ( ) = (a) 4 + j4 Magnitue= √42 + 42 = √32 = 5.66 (b) -4 + j4 Magnitude= √42 + 42 = √32 = 5.66 (c)-4 – j4 Magnitude= √42 + 42 = √32 = 5.66 (d)4 - j4 +4 ๐๐๐๐๐ = ๐ก๐๐−1 (−4) = −4 ๐๐๐๐๐ = ๐ก๐๐−1 (−4) = Magnitude=√42 + 42 = √32 = 5.66 (4+๐4)(−4+๐4) (๐) 4−๐4 ๐ 4 3๐ 4 5๐ 4 −4 ๐๐๐๐๐ = ๐ก๐๐−1 (+4) = Magnitude= 5.66*5.66/5.66 = 5.66 ๐๐๐๐๐ = ๐ 4 3๐ + 4 − 7๐ 4 = 7๐ 3๐ − 4 4 2. For the differential equation below, 2๐งฬ + 24๐งฬ + 40๐ง = 20๐ข ๐ง(0− ) = 0.5 (a) Solve for the Laplace transform of z(t), Z(s). ๐งฬ (0− ) = 3 2[๐ 2 ๐(๐ ) − 0.5๐ − 3] + 24[๐ ๐(๐ ) − 0.5] + 40๐(๐ ) = 20 ๐(๐ ) = ๐ข(๐ก) = 5 5 ๐ 0.5๐ 2 + 9๐ + 50 ๐ (๐ 2 + 12๐ + 20) (b)Check your Z(s) to see if it gives the correct initial value using the initial value theorem. ๐ ๐(๐ )๐ =∞ = 0.5 ๐คโ๐๐โ ๐โ๐๐๐๐ (c)Check your Z(s) to see if it gives the correct final value using the final value theorem. 50 ๐ ๐(๐ )๐ =0 = = 2.5 ๐คโ๐๐โ ๐โ๐๐๐๐ ๐ค๐๐กโ ๐๐๐๐๐๐๐๐ ๐๐๐๐. ๐๐๐ ๐ค๐๐กโ ๐๐๐๐๐ฃ๐๐ก๐๐ฃ๐๐ = 0 20 IVT: limit sF(s)s=∞ FVT: limit sF(s)s=0 ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ} = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ (0− ) 3. (a) Find the inverse Laplace transform of Y(s) below. ๐(๐ ) = 32 ๐ [(๐ + 4)2 + 42 ] 32๐ ๐ ๐ก 1 32 32 + | | ๐ −4๐ก sin [4๐ก + ๐๐๐๐๐( )๐ =−4+๐4 ] } 2 2 [(๐ + 4) + 4 ] ๐ =0 4 ๐ ๐ =−4+๐4 ๐ 1 32 −4๐ก 3๐ 3๐ =1+ ๐ sin (4๐ก − ) = 1 + √2๐ −4๐ก sin (4๐ก − ) 4 √32 4 4 (b) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT. ๐ฆ(0) = 1 − 1 = 0 ๐คโ๐๐โ ๐โ๐๐๐๐ ๐ค๐๐กโ ๐ผ๐๐ Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT. ๐ฆ(∞) = 1 − 0 = 1 ๐คโ๐๐โ ๐โ๐๐๐๐ ๐ค๐๐กโ ๐น๐๐ ๐ฆ(๐ก) = { 46 5.24 1. Parts (a) and (b) of this problem are the Key Assignment. Consider the following differential equation for y(t). 2๐ฆฬ + 5๐ฆ = 25 ๐ฆ(0− ) = 6 (a) Use the Laplace transform and the residue theorem to solve this differential equation for y(t). (b) 2(๐ ๐ − 6) + 5๐ = 25/๐ 6๐ + 12.5 ๐(๐ ) = ๐ (๐ + 2.5) ๐ฆ(๐ก) = 5 + ๐ −2.5๐ก (c) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the correct values at t = 0 and at t = ∞? ๐ฆ(๐ก)๐ก=0 = 6 ๐ฆ(๐ก)๐ก=∞ = 5 Thus, the equation for y(t) gives the correct initial and final values. (d) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time constant for T. Time constant is 0.4 seconds so T=0.04. t y(t) ๐ฆฬ (๐ก) = −2.5๐ฆ + 12.5 ๐ฆ(๐ก + ๐) = ๐๐ฆฬ (๐ก) + ๐ฆ(๐ก) 0 6 12.5-2.5*6=-2.5 0.04*(-2.5)+6=5.9 0.04 5.9 12.5-2.5*5.9=-2.25 0.04*(-2.25)+5.9=5.81 0.08 5.81 47 2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐ฃ. The model for the system is represented by the following equations : 1000๐ฃฬ + 0.05๐ = 9800 ๐ = 100000๐ ๐ = 0.05๐ฃ Velocity v Pressure P Flow Rate Q (a) We have three equations. What are the three unknowns? v, P, and Q (b) Assuming the initial velocity is zero, Laplace transform the equations and then find a single equation for the Laplace transform of the pressure P(s). 9800 1000๐ ๐ + 0.05๐ = ๐ ๐ = 100000๐ ๐ = 0.05๐ Solving for P gives 49000 ๐(๐ ) = ๐ (๐ + 0.25) (c) What is the final value for P(t) and how long does it take for P(t) to reach this final value within 1 %? 49000 ๐ ๐(๐ )๐ =0 = (๐ +0.25) = 196000 It takes about 5 time constants which is 20 seconds. ๐ =0 3. Express the following 3rd order differential equation in a format of three simultaneous 1st order differential equations. All initial conditions are zero. 2๐งโ + 16๐งฬ + 8๐งฬ + 5๐ง = 10 ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅ3 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = ๐ฅ3 ๐ฅฬ 3 = 5 − 2.5๐ฅ1 − 4๐ฅ2 − 8๐ฅ3 4. Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer function with the input being a unit impulse. What are the MATLAB commands for getting a plot of w(t) using the 'impulse' command in MATLAB? 2๐ + 4 ๐(๐ ) = 2 3๐ + 20๐ + 5 48 >> w=tf([2 4],[3 20 5]); >> impulse(w) 5.25 1. Use Laplace transform to solve the following differential equations for z(t): ๐ง(0− ) = 4 (a) ๐งฬ + 25๐ง = 2๐ขฬ + 15๐ข The input u(t) is a step with magnitude 5. ๐ ๐(๐ ) − 4 + 25๐(๐ ) = (2๐ + 15) ๐(๐ ) = ๐ ๐ฌ 14๐ + 75 ๐ (๐ + 25) ๐ง(๐ก) = 3 + 11๐ −25๐ก (b) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’ command. >> z=tf([14 75],[1 25 0]); >> impulse(z) (c) ๐งฬ + 6๐งฬ + 25๐ง = 50๐ข(๐ก) ๐ง(0− ) = 1 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. (๐ 2 ๐(๐ ) − 1๐ ) + 6(๐ ๐(๐ ) − 1) + 25๐(๐ ) = 50(๐) ๐(๐ ) = ๐ + 56 (๐ + 3)2 + 42 1 ๐ง(๐ก) = |๐ + 56|๐ =−3+๐4 ๐ −3๐ก sin (4๐ก + ๐๐๐๐๐(๐ + 56)๐ =−3+๐4 ) 4 ๐ง(๐ก) = 13.29๐ −3๐ก sin (4๐ก + 0.0753) ๐ฟ๐๐. [๐(๐ก)] = ๐น(๐ ) ๐ฟ๐๐. [ ๐ฬ (๐ก)] = ๐ ๐น(๐ ) − ๐(0− ) 1 ๐(๐ ) | | ๐ −๐๐ก sin(๐๐ก + ๐) ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐ฟ๐๐. [๐ฬ (๐ก)] = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) ๐(๐ ) ) ๐ = ๐๐๐๐๐ ( ๐ท(๐ ) ๐ =−๐+๐๐ 2. A vehicle suspension system is defined by the following differential equations with input u(t): 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข ๐คฬ + 6๐คฬ + 25๐ค = 6๐ฃฬ + 25๐ฃ ๐ฃฬ + 4.5๐ฃฬ + 25๐ฃ = 3๐คฬ + 12.5๐ค + 1.5๐ขฬ + 12.5๐ข (a) Define state variables and then find the equations for the derivatives of the state variables. ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ ๐ฅ4 = ๐ฃฬ − 1.5๐ข ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −25๐ฅ1 − 6๐ฅ2 + 25๐ฅ3 + 6๐ฅ4 + 9๐ข 49 ๐ฅฬ 3 = ๐ฅ4 + 1.5๐ข ๐ฅฬ 4 = 12.5๐ฅ1 + 3๐ฅ2 − 25๐ฅ3 − 4.5๐ฅ4 + 5.75๐ข (b) Express your state variable derivative equations from (a) in state variable matrix format assuming the output of interest is y = u - v, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? 0 0 1 0 0 −25 −6 25 6 ๐ด=[ ] ๐ต = [ 9 ] ๐ถ = [0 0 0 0 0 1 1.5 12.5 3 −25 −4.5 5.75 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 84๐ฃฬ + 300๐ฃ 3 = 2400 −1 0] ๐ท = [1] ๐ฃ(0− ) = 1.9 ๐ฃฬ (0− ) = 2 (a) What is the equilibrium (final value) of v(t)? 0 + 0 + 300๐ฃ 3 = 2400 ๐กโ๐ข๐ ๐ฃ(∞) = 2 (b) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. ๐ฃ 3 ≈ 23 + 3(2)2 (๐ฃ − 2) = 12๐ฃ − 16 (c) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. ๐ฃฬ + 84๐ฃฬ + 300(12๐ฃ − 16) = 2400 ๐ฃฬ + 84๐ฃฬ + 3600๐ฃ = 7200 (d) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? 7200 = 2 ๐คโ๐๐โ ๐โ๐๐๐๐ 3600 (e) What are the eigenvalues of your linearized differential equation? Time constants? ๐ฃ= ๐ 2 + 84๐ + 3600 = (๐ + 42 + ๐42.85)(๐ + 42 − ๐42.85) ๐๐๐๐๐๐ฃ๐๐๐ข๐๐ = −42 ± ๐42.85 ๐ก๐๐๐ ๐๐๐๐ ๐ก๐๐๐ก = 1 = 0.0238 ๐ ๐๐๐๐๐๐ 42 5.26 1. Use Laplace transform to solve the following differential equations for z(t): (a) 2๐งฬ + 10๐ง = 4๐ขฬ + 20๐ข ๐ง(0− ) = 3 The input u(t) is a step with magnitude 2. 2[๐ ๐ − 3] + 10๐ = [4๐ + 20]๐ 50 2 14๐ + 40 (2๐ + 10)๐ = (4๐ + 20) + 6 = ๐ ๐ 7๐ + 20 ๐(๐ ) = ๐ (๐ + 5) ๐ง(๐ก) = ๐ ๐๐ ๐๐๐ข๐ ๐๐๐ ๐ = 0 + ๐ ๐๐ ๐๐๐ข๐ ๐๐๐ ๐ = −5 ๐ง(๐ก) = 4 + 3๐ −5๐ก Checking z(t) at t = ∞ gives the correct value of 4. However, the t = 0+ value of z is different from the t = 0- value due to the impulse created by ๐ขฬ . (b) 10๐งฬ + 60๐งฬ + 250๐ง = 24๐ข(๐ก) ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. (10๐ 2 + 60๐ + 250)๐ = 24 2.4 ๐(๐ ) = (๐ + 3)2 + 42 1 ๐ง(๐ก) = |2.4 + ๐0|๐ −3๐ก sin[4๐ก + ๐๐๐๐๐(2.4 + ๐0)] = 0.6๐ −3๐ก sin (4๐ก) 4 The t = ∞ value of z and the t = 0- value check; note, we have the impulse input in the equation for ๐งฬ which changes the initial value of ๐งฬ but not the initial value of ๐ง. 2. A vehicle suspension system is defined by the following differential equations with input u(t): 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข (a) Express this system of equations in state variable format. ๐คฬ + 6๐คฬ + 25๐ค = 6๐ฃฬ + 25๐ฃ ๐ฃฬ + 4.5๐ฃฬ + 25๐ฃ = 3๐คฬ + 12.5๐ค + 1.5๐ขฬ + 12.5๐ข ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ ๐ฅ4 = ๐ฃฬ − 1.5๐ข ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −25๐ฅ1 − 6 ๐ฅ2 + 25๐ฅ3 + 6๐ฅ4 + 9๐ข ๐ฅฬ 3 = ๐ฅ4 + 1.5๐ข ๐ฅฬ 4 = 12.5๐ฅ1 + 3๐ฅ2 − 25๐ฅ3 − 4.5๐ฅ4 + 5.75๐ข (b) Express your state variable equations from (a) in state variable matrix format assuming the output of interest is y = v - w, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? 0 0 1 0 0 25 6 ] ๐ด = [−25 −6 ๐ต=[ 9 ] ๐ถ = [−1 0 1 0] ๐ท = [0] 0 0 0 1 1.5 12.5 3 −25 −4.5 5.75 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 2.4๐ฃฬ + 3๐ฃ 3 = 3000 ๐ฃ(0− ) = 10.01 ๐ฃฬ (0− ) = 2 (a) What is the equilibrium (final value) of v(t)? 0 + 0 + 3๐ฃ 3 = 1000 ๐ฃ(∞) = 10 (b) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. ๐ฃ 3 ≈ 103 + 3(102 )(๐ฃ − 10) = 300๐ฃ − 2000 51 (c) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. ๐ฃฬ + 2.4๐ฃฬ + 3(300๐ฃ − 2000) = 3000 ๐ฃฬ + 2.4๐ฃฬ + 900๐ฃ = 9000 (d) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? 0 + 0 + 900๐ฃ = 9000 ๐ฃ(∞) = 10 ๐คโ๐๐โ ๐โ๐๐๐๐ (e) What are the eigenvalues of your linearized differential equation? Time constants? ๐๐๐๐๐๐ฃ๐๐๐ข๐๐ = −1.2 ± ๐29.98 1 ๐ก๐๐๐ ๐๐๐๐ ๐ก๐๐๐ก = = 0.833 1.2 5.27 After Laplace transforming a differential equation for y(t) with input u(t), the following result was achieved: ๐ 2 +11๐ +30 ๐(๐ ) = [(๐ +2)[(๐ +3)2+42 ]] ๐(๐ ) ๐ 2 +11๐ +30 (a) What is the transfer function for this system? [(๐ +2)[(๐ +3)2+42 ]] (b) What are the eigenvalues of this system? -2, -3-j4, -3+j4 (c) What are the time constants for this system? ½ and 1/3 (d)What is the damping ratio of this system? 0.6 (e) What is the damped natural frequency of this system? 4 (f) What is the undamped natural frequency of this system? 5 (g) Suppose u(t) is a unit step input. It can be shown that y(t) will be of the form ๐ฆ(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก ๐ ๐๐( ๐๐ก + ๐) What are the following: ๐1 =? 0 ๐2 =? 2 ๐3 =? 3 ๐ =? 4 (h) What will be the final value of y(t), i.e. y(∞)? 0.6 5.28 For the differential equation given below, obtain a straight line approximation for ๐ฅ 3 and use it to obtain an approximation for the eigenvalues. 2๐ฅฬ + 8๐ฅฬ + 20๐ฅ 3 = 160 ๐ฅ(0− ) = 1 ๐ฅฬ (0− ) = 0 The initial condition is 1 and the final value is 2. So we need a straight line approximation for ๐ฅ 3 using the two points x = 1 and x = 2. ๐ฅ 3 ≈ 7๐ฅ − 6 Using this approximation for ๐ฅ 3 in the differential equation gives ๐ฅฬ + 4๐ฅฬ + 70๐ฅ = 140 52 The eigenvalues are −2 ± ๐8.12 5.29 (a) What are the eigenvalues of the suspension system shown below? What is the damping ratio? What is the undamped natural frequency? z M=10 K=90 y 10๐งฬ + 90๐ง = 90๐ฆ Eigenvalues = 0 ± ๐3, damping ratio = 0, undamped natural frequency = 3 (b) It is desired to add a shock absorber (or viscous damper) as shown below so as to improve the ride quality of the suspension for bumps in the road. Derive a value for the damping coefficient b that will give an eigenvalue damping ratio of 0.707. 10๐งฬ + ๐๐งฬ + 90๐ง = ๐๐ฆฬ + 90๐ฆ M=10 K=90 b=? Bump b= 50.904 gives a damping ratio of 0.707. 5.30 A system is expressed in the following transfer function format: 2(๐ + 2)(๐ + 8) ]๐(๐ ) (๐ + 10)(๐ + 20)(๐ 2 + 10๐ + 925)(๐ 2 + 24๐ + 2644) ๐(๐ ) = [ (a) What are the eigenvalues of this system? Note, check you work since the rest of this problem depends on you getting this part correct! -10, -20, -5-j30, -5+j30, -12+j50,-12-j50 (b) Is this system stable? Explain how you know? Yes, all eigenvalues have negative real parts. 53 (c)What are the time constants of this system? 1/10, 1/20, 1/5, and 1/12 (d)What are the damping ratios, damped natural frequencies, and undamped natural frequencies of this system? Damping ratios 0.164 and 0.233 Damped natural frequencies = 30 and 50. Undamped natural frequencies = 30.41 and 51.42. (e) We know that if the input u(t) is a step input at time t=0, then z(t) will be of the following form: ๐ง(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก + ๐ถ4 ๐ −๐4๐ก ๐ ๐๐( ๐1 ๐ก + ๐1 ) + ๐ถ5 ๐ −๐5๐ก ๐ ๐๐( ๐2 ๐ก + ๐2 ) What are each of the following: ๐1 = 0 ๐2 = 10 ๐3 = 20 ๐4 = 5 ๐5 = 12 ๐1 = 30 ๐2 = 50 54 5.31 The equations for a water tank are as follows: ๐๐ − ๐๐ − 5๐ปฬ = 0 ๐๐ = 10√๐ป − Assume ๐๐ = 0 and ๐ป(0 ) = 4. Estimate how long it will take for the tank to drain by obtaining a straight line approximation for √๐ป and then getting an estimate for the time constant of the draining tank. Qi H Qo The water height goes from 4 to 0; so, we need a straight line approximation based on two points. √๐ป ≈ 0.5๐ป + 0. Using this approximation and combining the equations gives ๐ปฬ + ๐ป = 0 Thus, the time constant is 1 sec. So, it will take approximately 5 seconds to drain the tank. 5.32 Express the following differential equation in state variable matrix form; the output of interest is y=z-u. ๐งฬ + 8๐งฬ + 16๐ง = 25๐ขฬ + 32๐ข Using the phase variable method: ๐ฅฬ 0 1 ๐ฅ1 0 [ 1] = [ ][ ] + [ ]๐ข ๐ฅฬ 2 −16 −8 ๐ฅ2 1 ๐ฅ1 ๐ฆ = [32 8] [๐ฅ ] + [−1]๐ข 2 55 5.33 The equations for an inverted pendulum are shown below. The force Fi is used to stabilize the mass Ms in the vertical position. Assuming small angles, the differential equations for this system are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the feedback controller is ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] Ms ๏ฑ L z Mc Fi Prove mathematically that without the controller, this system is unstable. Setting Fi to zero and introducing the D operator and combining the equations gives the following characteristic equation: ๐ท2 − 0.09๐ท − 4.9 = 0 Thus, without Fi, the eigenvalues are +0.045±๐2.2. Since the real part is positive, the system is unstable which means the pendulum will fall from a vertical position without the control Fi. 56 5.34 The differential equation for the roll angle,๐, of a ship resulting from wave and wind disturbances, Td, is shown below ๏ฑ ๐ฬ + 1.8๐ฬ + 9๐ = 10−6 ๐๐ (a) Assume that the torque disturbance ๐๐ is a sine wave, i.e. ๐๐ = 5000 ๐ ๐๐( 1.5๐ก) The roll angle ๐ of the ship will also be a sine wave. What will be the steady state amplitude and frequency of ๐(๐ก)? Amplitude = 0.0006877 and frequency = 1.5 rad/sec 10−6 The transfer function for ๐ is defined by ๐(๐ ) = [๐ 2 +1.8๐ +9] ๐๐ (s). At steady state 10−6 ๐(๐ก) = 5000 |๐ 2 +1.8๐ +9| ๐ =๐1.5 sin(1.5๐ก + ∅) = 0.00068776sin (1.5๐ก − 0.38051) 5.35 The transfer function relating ๐(๐ ) to the input ๐(๐ ) is given below. ๐ +5 ๐ +5 9 ๐(๐ ) = [๐ 2 +30๐ +200] ๐(๐ ) = [(๐ +10)(๐ +20)] ๐ 2 +0๐ +9 9 Assume that the input u(t) is a sine wave, that is ๐(๐ ) = ๐ 2 +9. It can be shown that the inverse Laplace transform of ๐(๐ ) is of the form ๐ง(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก ๐ ๐๐( ๐๐ก + ๐) Fill in the following table: ๐ถ1 r1 (−10 + 5)9 (−10 + 20)(100 + 9) = −0.04128 10 ๐2 (−20 + 5)9 (−20 + 10)(400 + 9) = 0.033 20 ๐3 0 ๐ 3 ๐ถ2 5.36 The transfer function for the output of a system is shown below; R is the input and N(s) is a rational polynomial such as as2+bs+c, etc. 57 ๐(๐ ) = [ (๐ + 2)[(๐ + 4)2 ๐(๐ ) ] ๐ (๐ ) + 32 ][(๐ + 100)2 + 1002 ] (a)What are the eigenvalues? -2, -4+j3, -4-j3, -100+j100, -100-j100 (b)What are the time constants? ½, ¼, and 1/100 (c) What are the damping ratios? 0.8 and 0.707 (d)What are the damped natural frequencies? 3 and 100 (e) If the input is a step, write the general form of the inverse Laplace of Y(s). Be as specific as possible. ๐ฆ(๐ก) = [ N ( s )e st ] ( s + 2)[( s + 4) 2 + 3 2 ][( s + 100 ) 2 + 100 2 ] ๐ =0 st +[ N ( s )e ]๐ =−2 s[( s + 4) + 3 2 ][(s + 100 ) 2 + 100 2 ] 2 1 N ( s) + | | 4 s( s + 2)[(s + 100 ) 2 + 100 2 ] ๐ −3๐ก sin(3๐ก + ∅) ๐ =−4+๐3 + 1 N ( s) | | 100 s(s + 2)[(s + 4) 2 + 32 ] ๐ −100๐ก sin (100๐ก + ๐) ๐ =−100+๐100 5.37 After Laplace transforming a differential equation for z(t) with input r(t), the following result was achieved: 15๐ +680 ๐(๐ ) = [(๐ +4)[(๐ +2)2+82]] ๐ (๐ ) 15๐ +680 (a) What is the transfer function for this system? [(๐ +4)[(๐ +2)2+82]] (b) What are the eigenvalues of this system? -4, -2-j8, -2+j8 (c) What are the time constants for this system? ¼ and ½ (d) What is the damping ratio of this system? 0.2425 (e) What is the damped natural frequency of this system? 8 (f) What is the undamped natural frequency, ๐๐ , of this system? √68 = 8.2462 (g) (Suppose r(t) is a unit step input. It can be shown that z(t) will be of the form ๐ง(๐ก) = ๐ถ1 ๐ −๐1๐ก + ๐ถ2 ๐ −๐2๐ก + ๐ถ3 ๐ −๐3๐ก ๐ ๐๐( ๐๐ก + ๐) What are the following: ๐1 =? 0 ๐2 =? 4 ๐3 =? 2 ๐ =? 8 (h)What will be the final value of z(t), i.e. z(∞)? 2.5 5.38 For the differential equation given below, obtain a straight line approximation for ๐ง 3 and use it to obtain an estimate of the damping ratio and time constant of the system. 2๐งฬ + 3๐งฬ + 5๐ง 3 = 40 ๐ง(0− ) = 2.001 ๐งฬ (0− ) = 0.1 ๐ง 3 ≈ 8 + 12(๐ง − 2) = 12๐ง − 16 Thus, 2๐งฬ + 3๐งฬ + 5(12๐ง − 16) = 40 ๐งฬ + 1.5๐งฬ + 30๐ง = 60 Thus, damping ratio = 0.1369 and time constant = 1/0.75 = 1.333 58 5.39 An analog controller Gc has been converted to z-transform format using the MATLAB 10๐ +1 commands shown below. ๐(๐ ) = ๐บ๐ (๐ )๐ธ(๐ ) = 100๐+1 ๐ธ(๐ ) >> Gc=tf([10 1],[100 1]); >> Gcd=c2d(Gc,0.001) ๐บ๐๐ = Thus, 0.1๐ง−0.0999 ๐ง−1 ๐(๐ง) = [ 0.1๐ง−0.0999 ๐ง−1 ] ๐ธ(๐ง) What is the digital code for this controller to be used in a digital computer program? ๐(๐ง) = ๐ง −1 ๐(๐ง) + 0.1๐ธ(๐ง) − 0.0999๐ง −1 ๐ธ(๐ง) Or, ๐ข๐ = ๐ข๐−1 + 0.1๐๐ − 0.0999๐๐−1 5.40 Consider the following differential equation for z: ๐งโ + 12๐งฬ + 189๐งฬ + 338๐ง = 16๐ขฬ + 32๐ขฬ + 169๐ข (a)What is the transfer function for z? 16๐ 2 + 32๐ + 169 ๐ 3 + 12๐ 2 + 189๐ + 338 (b)If ๐ 3 + 12๐ 2 + 189๐ + 338 = (๐ + 2)[(๐ + 5)2 + 122 ] (b.1) What are the eigenvalues of this system? -2, -5+j12, -5-j12 (b.2) What are the time constants of this system? 1/2 and 1/5 (b.3) What is the damping ratio? 0.3846 (b.4) How long will it take for z(t) to reach its final value within 1%? 2.5 sec (b.5) What are MATLAB commands for entering this transfer function into MATLAB? >> G=tf([16 32 169],[1 12 189 338]) (b.6) If the input u is a unit step and all initial conditions are zero, (b.6.1) What is Z(s)? 16๐ 2 + 32๐ + 169 ๐ (๐ 3 + 12๐ 2 + 189๐ + 338) (b.6.2) What is the general format equation for z(t)? If you don’t know what ‘general format’ means, find z(t). ๐ง(๐ก) = 0.5 + ๐๐ −2๐ก + ๐๐ −5๐ก sin (12๐ก + ∅) (b.6.3) What is the final value of z(t)? 0.5 59 5.41 (a) Use Laplace transform and the residue theorem to solve the following differential equation for v(t); the input u is a unit step. ๐ฃ(0− ) = 3 2๐ฃฬ + 24๐ฃฬ + 40๐ฃ = 16๐ขฬ + 80๐ข ๐ฃฬ (0− ) = 0 (b) What is the final value of v? Check your answer using the final value theorem. (c) What are the MATLAB commands to get a plot of v(t) using the command ‘impulse’? (d) Express this differential equation in state variable format; assume z is the output of interest denoted by y below. A=? B=? C=? D=? ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข 5.42 Express the following system in state variable format assuming E is the output of interest, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ ๐ฆ = ๐ถ๐ + ๐ท๐ E R u 4 s + - s+2 s+5 w v + - z 1 s 6 The equations are: ๐งฬ = ๐ฃ ๐ ๐ ๐๐๐ก ๐ฅ1 = ๐ง ๐ฃ = ๐ค − 6๐ง ๐คฬ + 5๐ค = ๐ขฬ + 2๐ข ๐ ๐ ๐๐๐ก ๐ฅ2 = ๐ค − ๐ข ๐ขฬ = 4๐ธ ๐ ๐ ๐๐๐ก ๐ฅ3 = ๐ข ๐ธ =๐ −๐ง −6 1 1 ๐ด = [ 0 −5 −3] −4 0 0 0 ๐ต = [0 ] 4 ๐ถ = [−1 0 0] ๐ท = [1] 5.43 Consider the differential equation below. 2๐ฆฬ + 48๐ฆฬ + 800๐ฆ = 60๐ฬ + 1600๐ (a) If r(t) is the input, what is the transfer function for y? (b) What is the d.c. gain of this system? ____________________ (c) What is the characteristic equation? ______________________ (d) What are the eigenvalues? ___________________________________ (e) What is the time constant? __________ 60 What is the damping ratio? _____________ What is the undamped natural frequency?______________ What is the damped natural frequency? _____________ (f) If r is a step input, we know that the general form of y(t) will be ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก sin(๐๐ก + ๐) b= _________ d=__________ ๐ = __________ 5.44 Consider the block diagram shown below. (a) Express ๐บ๐ (๐ ) in state variable format (note, in this case E is the input). (b) Express G(s) in state variable format (note, in this case U is the input). (c) Using the results of (a) and (b) above, express the total system in matrix state variable format; assume u(t) is the output of interest in the equation for y, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ ๐ฆ = ๐ถ๐ + ๐ท๐ A=? B=? C=? D=? Gc (s ) R +- E 0.2 s + 1 U 0.02 s + 1 G (s ) 2s + 3 s + 4 s + 12 V 2 61 5.45 As shown below, two water tanks with the same diameter are connected by a long pipe. Initially, before the water is allowed to flow through the pipe, the height H1 of the water in tank #1 is greater than the height H2 of the water in tank #2. The volume of the water in the pipe is significantly larger than the tank volumes; thus, the inertia of the moving water in the pipe is significant. H1 H2 d L Q The equations for this system are as follows: Equation for height of water in tank #1: −๐ − 10๐ปฬ1 = 0 Equation for height of water in tank #2: ๐ − 10๐ปฬ2 = 0 ๐ป1 (0− ) = 10 ๐ ๐ป2 (0− ) = 5 ๐ Equation for turbulent flow ๐ through pipe: (๐ป1 − ๐ป2 ) = 50๐ฬ + 2๐ ๐(0− ) = 0 ๐3 ๐ 1. (25%) Knowing the initial and final values and given that the time constant for this system is 50 seconds, draw an estimate of the graph of H1(t). H1(t) 10 7.5 0 250 t 2. (45%) Laplace transform the equations and solve for H1(s). −๐ − 10(๐ ๐ป1 − 10) = 0 ๐ − 10(๐ ๐ป2 − 5) = 0 ๐ป1 (๐ ) = ๐ป1 − ๐ป2 = 50๐ ๐ + 2๐ 2500๐ 2 + 100๐ + 7.5 ๐ (250๐ 2 + 10๐ + 1) >> syms s Q H1 H2 >> Y=solve(-Q-10*(s*H1-10)==0, Q-10*(s*H2-5)==0,H1-H2==50*s*Q+2*Q ,H1,H2,Q); >> pretty(Y.H1) 2 (1000 s + 40 s + 3) 5 ----------------------2 s (250 s + 10 s + 1) 2 62 3. (30%) It can be shown that the inverse Laplace transform of the correct H1(s) is as follows ๐ป1 (๐ก) = 7.5 + 2.638๐ −0.02๐ก sin (0.06๐ก + 1.2483) As demonstrated in the 2nd lecture, use MATLAB to plot H1(t). What aspects of your estimated plot and the MATLAB plot agree? What aspects do they not agree? Starting and ending values and final time. >> t=0:0.01:250; >> plot(t,7.5+2.638*exp(-0.02*t).*sin(0.06*t+1.2483),'r','Linewidth',2) >> xlabel('time, sec') >> ylabel('height of water in tank #1, m') >> title('homework #1 MAE3360') Since the time constant is 50 sec., the time to equilibrium agrees with 5*50 = 250 sec. The oscillation is caused by the inertia of the moving water in the pipe. homework #1 MAE3360 10.5 10 height of water in tank #1, m 9.5 9 8.5 8 7.5 7 6.5 0 50 100 150 200 250 time, sec Note, in MATLAB when multiplying two functions of time, you must use .* instead of just * since t is a vector of time values. This is equivalent to a dot product. 63 5.46 1. Show the 4-quadrant position and then find the magnitude and angle of each of the following complex numbers: (a) 3+j4 ๐ = √32 + 42 = 5 4 ๐๐๐๐๐ = ๐ก๐๐−1 (3) = 0.9273 4 (b) -3+j4 ๐ = √32 + 42 = 5 ๐๐๐๐๐ = ๐ − ๐ก๐๐−1 (3) = 2.2143 (c) -3-j4 ๐ = √32 + 42 = 5 ๐๐๐๐๐ = ๐ + ๐ก๐๐−1 (3) = 4.0689 (d) 3-j4 ๐ = √32 + 42 = 5 ๐๐๐๐๐ = 2๐ − ๐ก๐๐−1 (3) = 5.3559 3+j4 x 4 4 4 -3+j4 x 3 x -3-j4 x 3-j4 Find the magnitude and angle of the complex number A below: (3 + ๐4)(−3 + ๐4) 5∗5 ๐= =5 −3 − ๐4 5 ๐๐๐๐๐ = 0.9273 + 2.2143 − 4.0689 = −0.9273 2. Repeat calculations above but this time use MATLAB to do the calculations to confirm your answers. In MATLAB, to compute the magnitude use command ‘abs’; to compute the 4-quadrant angle, use the command ‘angle’. >> a=-3-j*4; >> a=3-j*4; >> a=3+j*4; >> a=-3+j*4; ๐ด= >> M=abs(a) >> M=abs(a) >> M=abs(a) >> M=abs(a) M= M= M= M= 5 5 5 5 >> angle(a) >> angle(a) >> angle(a) >> angle(a) ans = 0.9273 ans = 2.2143 ans = -2.2143 = 4.0689 ans = -0.9273 = 5.3559 >> A=(3+j*4)*(-3+j*4)/(-3-j*4); >> M=abs(A) M= 5 >> angle(A) ans = -0.9273 64 3. The 2-mass system shown below with force input Fi is defined by the following two simultaneous differential equations: 5๐ฆฬ + 42๐ฆฬ + 500๐ฆ = 90๐ง + 6๐งฬ 10๐งฬ + 6๐งฬ + 90๐ง = 90๐ฆ + 6๐ฆฬ + ๐น๐ y z force input Fi Use MATLAB to find the following: (a) Find the transfer function relating Y(s) to the input Fi(s). First doing it manually by Laplace transforming both equations without IC terms since they don’t change the transfer function gives: (5๐ 2 + 42๐ + 500)๐ = (90 + 6๐ )๐ (10๐ 2 + 6๐ + 90)๐ = (90 + 6๐ )๐ + ๐น๐ Solving the first equation for Z (5๐ 2 + 42๐ + 500) ๐ (90 + 6๐ ) and substituting the result into the 2nd equation gives (5๐ 2 + 42๐ + 500) 2 (10๐ + 6๐ + 90) ๐ = (90 + 6๐ )๐ + ๐น๐ (90 + 6๐ ) Solving for Y gives ๐= ๐(๐ ) = [ 25๐ 4 + 225๐ 3 3๐ + 45 ] ๐น (๐ ) + 2833๐ 2 + 2850๐ + 18450 ๐ Using MATLAB to check the results >> syms s y z Fi >> H=solve((5*s^2+42*s+500)*y==(90+6*s)*z, (10*s^2+6*s+90)*z==(90+6*s)*y+Fi, y,z); >> pretty(H.y) 3 Fi (s + 15) ----------------------------------------4 3 2 25 s + 225 s + 2833 s + 2850 s + 18450 (b) What are the eigenvalues? (c) What are the damped natural frequencies? Imaginary part of eigenvalue 65 (d) What are the time constants? (e) What are the undamped natural frequencies? Magnitude of eigenvalues (f) What is the DC gain of the transfer function? What is the meaning of the DC gain? >> G=tf([3 45],[25 225 2833 2850 18450]) >> damp(G) eigenvalues Damping Frequency Time Constant (rad/seconds) (seconds) -2.58e-01 + 2.68e+00i 9.57e-02 2.69e+00 3.88e+00 -2.58e-01 - 2.68e+00i 9.57e-02 2.69e+00 3.88e+00 -4.24e+00 + 9.15e+00i 4.21e-01 1.01e+01 2.36e-01 -4.24e+00 - 9.15e+00i 4.21e-01 1.01e+01 2.36e-01 >> dcgain(G) ans = 0.0024 If the input is a constant C, then the final value of the output will be (DC gain)*C. 5.47 The equations for an inverted pendulum are shown below. The force Fi is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Fi on the cart. Assuming small angles, the differential equations for the pendulum and cart are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the force Fi is ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] Ms ๏ฑ L z Mc Fi (a) What are the unknowns in these three equations? ๐, ๐ง, ๐น๐ 66 (b) Find the Laplace transform for the pendulum angle assuming all initial conditions are zero except the initial pendulum angle ๐(0− ) = 0.1 ๐๐๐. Note, there is no external input to this system so there is no transfer function. >> syms s T z Fi >> H=solve((s^2-4.9)*T-0.1*s+0.5*s^2*z==0, s^2*z+0.18*(s^2*T-0.1*s)+0.09*Fi==0,… (s+8)*Fi==-149.6*(s*T-0.1+6*T),Fi,T,z) >> pretty(H.T) 2 (455.0 s + 3640.0 s + 3366.0) 0.1 -------------------------------------3 2 455.0 s + 3640.0 s + 916.0 s + 596.0 (c) What are the poles of the denominator of your Laplace transform found in part b? โซ ๐๐๐๐ก๐ ([455 3640 916 596]) − 0.119 ± ๐0.393 ๐๐๐ − 7.76 5.48 The Laplace transform of an engineering system is found to be the following: ๐(๐ ) = 100(4๐ 2 + 12๐ + 16) (๐ + 5)[(๐ + 2)2 + 32 ][(๐ + 15)2 + 82 ] (a) (50%) Obtain an equation for y(t) by finding the inverse Laplace of Y(s). It is okay to use MATLAB to do the complex arithmetic associated with the coefficients. >> s=-5;a=100*(4*s^2+12*s+16)/(((s+2)^2+9)*((s+15)^2+64)) a = 1.8970 >> s=-2+j*3;N=100*(4*s^2+12*s+16);D=(s+5)*((s+15)^2+64); >> abs(N/D)/3 ans = 1.0091 >> angle(N/D) ans = 2.4260 >> s=-15+j*8;N=100*(4*s^2+12*s+16);D=(s+5)*((s+2)^2+9); >> abs(N/D)/8 ans = 4.0674 >> angle(N/D) ans = -2.4611 Thus ๐ฆ(๐ก) = 1.8970๐ −5๐ก + 1.0091๐ −2๐ก sin(3๐ก + 2.4260) + 4.0674๐ −15๐ก sin (8๐ก − 2.4611) (b) (50%) Use the MATLAB command ‘impulse’ to generate values for y(t) and t. Then, use the values of t in your equation from (a) and plot both solutions for y(t) on the same graph for comparison. How do they compare? Perfect match. 67 >> G=zpk(roots([1 3 4]),[-5 -2+j*3 -2-j*3 -15+j*8 -15-j*8],400) G= 400 (s^2 + 3s + 4) --------------------------------------(s+5) (s^2 + 4s + 13) (s^2 + 30s + 289) >> [Y,t]=impulse(G); >> y=1.897*exp(-5*t)+1.0091*exp(-2*t).*sin(3*t+2.426)+4.0674*exp(-15*t).*sin(8*t-2.4611); >> plot(t,y,'r',t,Y,'k:','linewidth',2) >> xlabel('time, s') >> ylabel('y(t)') >> legend('inverse Laplace','impulse command','location','Best') 0.7 0.6 0.5 inverse Laplace impulse command 0.4 y(t) 0.3 0.2 0.1 0 -0.1 -0.2 0 0.5 1 1.5 time, s 2 2.5 3 68 5.49 This problem pertains to improving the performance of a pile driver by changing the frequency of hitting the top of the pile (steel beam) with force Fi. The output of interest is the contact force Fo with the ground at the bottom of the pile. By carefully selecting the input frequency to approximately match one of the resonant frequencies of the beam, the pile is driven into the ground faster and more efficiently. The stress waves in the pile are defined by partial differential equations representing an infinite number of modes. However, it is possible to approximate the stress waves using a lumped parameter model such as shown below and obtain a finite order ordinary differential equation represented by a transfer function. Fi Fo A typical transfer function for a five-lumped model of a pile is the following: ๐น๐ (๐ ) =[ 32๐ 5 + 1600๐ 4 + 32000๐ 3 + 320000๐ 2 + 1600000๐ + 3200000 ] ๐น (๐ ) 3125๐ 10 + 11250๐ 9 + 126500๐ 8 + 287000๐ 7 + 1611200๐ 6 + 2148032๐ 5 + 7721600๐ 4 + 4832000๐ 3 + 12320000๐ 2 + 1600000๐ + 3200000 ๐ (a) Use the DC gain of this transfer function to determine the force at the ground if the input force is a constant of 1000 N. This is an input that could be generated by setting a 1000 N weight on top of the pile. Does your answer using the DC gain to compute the ground force make sense? DC gain = 3200000/3200000 = 1 Thus, if the input is 1000, then the output at steady state will also be 1000. Yes, this makes sense. (b) Use the ‘damp’ command with the lumped model transfer function to approximate the actual resonant frequencies of this pile; the resonant frequencies are the damped natural frequencies in the eigenvalues. Note, there are 5 complex modes to this lumped model with the following eigenvalues and frequencies. The damping ratios are so small for the first modes, the damped and undamped natural frequencies are essentially the same. Eigenvalue Damping ratio Frequency rad/s 69 -1.62e-02 + 5.69e-01i 2.85e-02 5.69e-01 -1.62e-02 - 5.69e-01i 2.85e-02 5.69e-01 -1.38e-01 + 1.66e+00i 8.31e-02 1.66e+00 -1.38e-01 - 1.66e+00i 8.31e-02 1.66e+00 -3.43e-01 + 2.60e+00i 1.31e-01 2.62e+00 -3.43e-01 - 2.60e+00i 1.31e-01 2.62e+00 -5.66e-01 + 3.32e+00i 1.68e-01 3.37e+00 -5.66e-01 - 3.32e+00i 1.68e-01 3.37e+00 -7.37e-01 + 3.77e+00i 1.92e-01 3.84e+00 -7.37e-01 - 3.77e+00i 1.92e-01 3.84e+00 (c) Suppose instead of a constant input, the input is sinusoidal with an amplitude of 1000 N. Using the MATLAB command ‘bode’ to generate the frequency response of this transfer function, determine the input frequency ๐๐ that generates the greatest force amplitude Ag at the ground. The frequency response first peak occurs at 0.569 rad/s which is identical to the first mode undamped natural frequency. Bode Diagram Magnitude (dB) 30 System: G Frequency (rad/s): 0.569 Magnitude (dB): 26.9 20 10 0 -10 0 Phase (deg) -90 -180 -270 -360 -0.6 10 -0.4 10 -0.2 10 0 10 0.2 10 Frequency (rad/s) At this frequency, what is the corresponding amplitude of the force at the ground in Newtons? Note, the frequency response plot magnitude is in dB where M (dB) =20Log10( M). It suggested that you improve the resolution on your plot by limiting the frequency range to a relatively small band of frequencies around the peak. The peak gain is 26.9 dB which is a gain of 10^(26.9/20) = 22.131 gives a peak output force of 22.131*1000 = 22,131 N. This is a huge amplification of the input force. 70 How does this input frequency from the frequency response compare with the damped natural frequency of the first mode? identical (d) Examine your frequency response plot in (b) and confirm that the DC gain is the same as the low frequency magnitude of the transfer function. What is the low frequency gain of the transfer function in dB? Note, the zero frequency gain is the same thing as the DC gain. The low frequency gain on the frequency response approaches the 0 dB which corresponds to a gain of 1 which is the DC gain of the transfer function. Note, DC means constant which has a frequency of zero. (e) Realizing that it is not realistic for the input force from a pile driver to be a sinewave since that would require a pushing and pulling action, generate a series of pulses for the force input using the pulse generator M-file provided on Blackboard. The pulse period is 2๐/๐๐ where ๐๐ is the frequency found in (c) in rad/s. The magnitude of each pulse should be 1000 N. The width of each pulse should be less than or equal to 1/20 of the pulse period. input frequency = 0.569 rad/s 1100 1000 900 pulse function amplitude 800 700 600 500 400 300 200 100 0 0 50 100 150 200 time, sec. 250 300 Use the command ‘lsim’ to generate and plot Fo(t) for the pulse input. Be sure to run your simulation much longer than 5๐๐๐๐ฅ so you can see the peak amplitude of the steady state response of the force at the ground. For the first mode frequency, the gain is 2.850 which is significantly less than 22.131; the peak output force is 2,850 N. 71 first mode resonant frequency 3000 X: 279.1 Y: 2850 Force at Ground, Fo 2000 1000 0 -1000 -2000 -3000 0 50 100 150 200 time, s 250 300 350 (f) To investigate the significance of the input frequency on the output peak values, repeat (e) but using input frequencies that are 20% greater and 20% less than the resonant frequency. What is the significance of being as close as possible to the resonant frequency? Note on the figures below, the gain drops to 0.6508 for 0.8*0.569 rad/s input frequency and 0.4962 for 1.2*0.569 rad/s. For lightly damped systems, the accuracy of matching the first mode frequency to achieve maximum amplification is critical. 0.8*first mode resonant frequency 1000 800 X: 375.8 Y: 650.8 Force at Ground, Fo 600 400 200 0 -200 -400 -600 0 50 100 150 200 250 time, s 300 350 400 450 72 1.2*first mode resonant frequency 800 X: 233.3 Y: 496.2 600 Force at Ground, Fo 400 200 0 -200 -400 -600 0 50 100 150 time, s 200 250 300 clear all format shortg Num=[32 1600 32000 320000 1.6e6 3.2e6]; Den=[3125 11250 126500 287000 1611200 2148032 7721600 4.832e6 1.232e7 1.6e6 3.2e6]; G=tf(Num,Den); damp(G) figure(1) bode(G,{.2 2}) figure(2) m=20;period=2*pi/0.569;T=period/m;F=1000;N=30;np=10; [Fi,t]=PulseSeries(T,m,F,N,np); title('input frequency = 0.569 rad/s') [Fo,t]=lsim(G,Fi,t); figure(3) plot(t,Fo,'r') xlabel('time, s') ylabel('Force at Ground, Fo') title('first mode resonant frequency') figure(4) m=20;period=2*pi/(.8*0.569);T=period/m;F=1000;N=30;np=10; [Fi,t]=PulseSeries(T,m,F,N,np); title('input frequency = 0.8*0.569 rad/s') [Fo,t]=lsim(G,Fi,t); figure(5) plot(t,Fo,'r') xlabel('time, s') ylabel('Force at Ground, Fo') title('0.8*first mode resonant frequency') m=20;period=2*pi/(1.2*0.569);T=period/m;F=1000;N=30;np=10; figure(6) [Fi,t]=PulseSeries(T,m,F,N,np); title('input frequency = 1.2*0.569 rad/s') [Fo,t]=lsim(G,Fi,t); figure(7) plot(t,Fo,'r') xlabel('time, s') ylabel('Force at Ground, Fo') title('1.2*first mode resonant frequency') 73 5.50 1. A spring-mass –damper system is shown below; the displacement of the mass is z. z spring damper mass The differential equation for the position of the mass is as follows ๐งฬ + 0.1๐งฬ + 0.01๐ง = 0 ๐ง(0− ) = 0 ๐งฬ (0− ) = 2 ๐/๐ (a) Draw an best guess estimate of the plot of z(t). Be sure to show the initial and final values and the approximate time to reach the final value. Do this before proceeding to the next parts of the assignment. The time constant is 20 and the damping ratio is 0.5. So the plot will start at zero, be slightly oscillatory, and end at zero after about 100 sec. (b) Express this differential equation in state variable format and then use ode45 in MATLAB to generate a plot of z(t). Does this plot agree with your plot in (a)? yes ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −0.1๐ฅ2 − 0.01๐ฅ1 ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 2 clear all [t,x]=ode45(@hmwk6_2016,[0 100],[0 2]); plot(t,x(:,1),'r','linewidth',2) title('Homework 6.1');ylabel('z(t) m');xlabel('time, s') function dx=hmwk6_2016(t,x) dx=zeros(2,1); dx(1)=x(2); dx(2)=-0.1*x(2)-0.01*x(1); end 74 Homework 6.1 12 10 8 z(t) m 6 4 2 0 -2 0 10 20 30 40 50 time, s 60 70 80 90 100 2. When a 2nd mass is added to the system, we now have two simultaneous equations for the system. (a) Express this system of equations in state variable format and write the initial conditions for the state variables. (b) Use ode45 to generate a plot of ๐งฬ (๐ก). ๐งฬ + 0.15๐งฬ + 0.015๐ง = 0.05๐คฬ + 0.005๐ค ๐ง(0− ) = 0 ๐งฬ (0− ) = 2 ๐ ๐ ๐คฬ + 0.05๐คฬ + 0.005๐ค = 0.05๐งฬ + 0.005๐ง ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 z w ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅ3 = ๐ค ๐ฅ4 = ๐คฬ ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 2 ๐ฅ3 (0− ) = 0 ๐ฅ4 (0− ) = 0 75 clear all [t,x]=ode45(@hmwk6_2_2016,[0 100],[0 2 0 0]); plot(t,x(:,2),'r','linewidth',2) title('Homework 6.2');ylabel('dz/dt m/s');xlabel('time, s') function dx=hmwk6_2_2016(t,x) dx=zeros(4,1); dx(1)=x(2); dx(2)=-0.15*x(2)-0.015*x(1)+0.05*x(4)+0.005*x(3); dx(3)=x(4); dx(4)=-0.005*x(3)-0.05*x(4)+0.05*x(2)+0.005*x(1); end Homework 6.2 2 1.5 dz/dt m/s 1 0.5 0 -0.5 0 10 20 30 40 50 time, s 60 70 80 90 100 76 5.51 The schematic of a vehicle suspension system is shown below. The vehicle is moving to the right. At t = 0, the contact point at the ground encounters a step with magnitude 0.02 m. (a) Use ode45 to obtain a plot of ๐งฬ (๐ก). Explain why ๐งฬ (0+ ) is not equal to ๐งฬ (0− ). ๐ฬ (๐+ ) is not equal to ๐ฬ (๐− ) because the input is a step which means at time zero there is an impulse force (due to ๐ฬ ) from the damper on the mass instantaneously changing ๐ฬ from zero to a positive value. function dx = Eqns7_2016( t,x) dx=zeros(2,1); dx(1)=x(2)+20*0.02; dx(2)=-100*x(1)-20*x(2)-300*0.02; end (b) Use SIMULINK to obtain a plot of ๐งฬ (๐ก). Confirm that the (a) and (b) results are the same by putting them on the same graph. After running the SIMULINK model, the following commands are executed in the Command Window: 77 >> [t,x]=ode45(@Eqns7_2016,[0 0.6],[0 0]); >> plot(t,x(:,2)+20*0.02,'r',y(:,1),y(:,2),'k*','LineWidth',2) >> title('homework 7 comparing ode45 and simulink simulations') >> xlabel('time, s') >> ylabel('velocity of mass, m/s') >> legend('ode45','SIMULINK') homework 7 comparing ode45 and simulink simulations 0.4 ode45 SIMULINK 0.35 0.3 velocity of mass, m/s 0.25 0.2 0.15 0.1 0.05 0 -0.05 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 time, s 78 5.52 The equations for an inverted pendulum are shown below. The feedback force Ff is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Ff on the cart. Assuming small angles, the differential equations for the pendulum and cart are listed below as well as the transfer function for the feedback control force Ff. Equation for summing the moments on the pendulum bar and mass: ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 Equation for the force balance on the cart: ๐ +6 Transfer function from feedback control design theory: ๐น๐ (๐ ) = −149.6 [๐ +8] ๐(๐ ) Ms ๏ฑ L z Ff Mc (a) Assume that the initial conditions are ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 ๐(0− ) = 0.1 ๐ฬ(0− ) = 0.05 ๐๐๐/๐ Estimate the plots of ๐(๐ก) and ๐ฬ (๐ก). Do this before running the next part. Construct a SIMULINK diagram for this system and obtain plots of ๐(๐ก) and ๐ฬ(๐ก). 79 80 Simulink solution homework 8 0.12 0.1 0.08 ๏ฑ rad 0.06 0.04 0.02 0 -0.02 -0.04 -0.06 0 5 10 15 20 25 30 35 40 45 time, s Simulink solution homework 8 0.05 0.04 0.03 d๏ฑ/dt rad/s 0.02 0.01 0 -0.01 -0.02 -0.03 -0.04 0 5 10 15 20 25 30 35 40 45 time, s Do the plots start and end at the correct values? ___yes (b) Express these equations in state variable format and then use ‘lsim’ with an initial condition vector to generate plots of ๐(๐ก) and ๐ฬ(๐ก). Are the plots in (a) the same as those in 81 (c) Yes but it required calculating SIMILINK Ff(0+) to use for Ff(0-) in the state variable formulation. Hint: Solve for ๐งฬ in the 2nd equation and substitute it into the 1st equation to get an equation for ๐ฬ which can then be substituted back into the original 2nd equation. Also, note there is no input so B and D contain only zeros. ๐ฬ − 0.04945๐น๐ − 5.3846๐ = 0 ๐งฬ + 0.9692๐ + 0.0989๐น๐ = 0 From the transfer function, we get ๐น๐ฬ + 8๐น๐ = −149.6๐ฬ − 897.6๐ So, the choices for the state variables are ๐ฅ1 = ๐ ๐ฅ2 = ๐ฬ ๐ฅ3 = ๐ง ๐ฅ4 = ๐งฬ ๐ฅ5 = ๐น๐ Note, in the SIMULINK simulation, the input at t = 0+ to the transfer function will be a constant of 0.1 which is the initial condition of ๐. Using the initial value theorem, we calculate ๐น๐ (0+ ) = ๐ (−149.6 [ ๐ + 6 0.1 ] ) = −14.96 ๐ + 8 ๐ ๐ =∞ >> A=[0 1 0 0 0;5.3846 0 0 0 0.04945;0 0 0 1 0;-0.9692 0 0 0 -0.0989;-897.6 -149.6 0 0 -8]; >> B=[0;0;0;0;0];C=[1 0 0 0 0;0 1 0 0 0];D=[0;0]; >> G=ss(A,B,C,D); >> Xo=[0.1;0.05;0;0;-14.96]; >> t=0:0.01:42; >> u=0*t; % we need a value for u at each value of t but it doesn’t matter what it is since B and D are zero. >> [y,t]=lsim(G,u,t,Xo); Note, we could have used the command >> [y,t]=initial(G,Xo); Rum the SIMULINK model with output Y at this time >> plot(t,Y(:,1),'r','Linewidth',2) >> xlabel('time, s') >> ylabel('\theta, rad') >> title('inverted pendulum simulation using state variables') >> plot(t,Y(:,2),'r','Linewidth',2) >> title('inverted pendulum simulation using state variables') >> ylabel('d\theta/dt, rad/s') >> xlabel('time, s') 82 As shown below, the SIMULINK and state variable simulation results are identical. Note, since z was not an output of interest, the state variable model in this case does not really need the state variables of z and ๐งฬ to simulate the pendulum angle. inverted pendulum simulation 0.12 SIMULINK State Variables 0.1 0.08 0.06 ๏ฑ, rad 0.04 0.02 0 -0.02 -0.04 -0.06 0 5 10 15 20 25 30 35 40 45 time, s 5.53 This assignment is a review of using symbolic math in MATLAB to get transfer functions, a review of the phase variable method to get state variable equations for transfer functions with equal order numerators and denominators, and a review of the use of ‘lsim’ to do time domain simulations. Also, this assignment is an introduction to the use of ‘lsim’ for simulating systems with random inputs. Consider the schematic of a vehicle suspension shown below. It is of interest to determine the levels of up and down acceleration in g’s that would be experienced by a passenger riding in this vehicle over a typical country road at a speed of 30 m/s. The differential equations for this suspension for road irregularities u(t) are also shown. The equation for the output of interest a(t) is also shown. Note, ๐งฬ is the up and down acceleration; dividing ๐งฬ by 9.8 m/s2 gives the acceleration in g’s. z w 5๏ฆ z๏ฆ+ 30 z๏ฆ+ 200 z = 30 w๏ฆ+ 200w ๏ฆ ๏ฆ+ 230w๏ฆ+ 10200 w = 30 z๏ฆ+ 200 z + 200u๏ฆ+ 10000u 2.5w a=๏ฆ z๏ฆ/ 9.8 a( s) = ๏น 1 ๏ฉ 480s 4 + 27,200s 3 + 160,000s 2 u( s ) 9.8 ๏ช๏ซ s 4 + 98s 3 + 4,600s 2 + 27,200s + 160,000 ๏บ๏ป u 83 z w 5๏ฆ z๏ฆ+ 30 z๏ฆ+ 200 z = 30w๏ฆ+ 200 w ๏ฆ ๏ฆ+ 230 w๏ฆ+ 10200 w = 30 z๏ฆ+ 200 z + 200u๏ฆ+ 10000u 2.5w a=๏ฆ z๏ฆ/ 9.8 a( s) = u ๏น 1 ๏ฉ 480 s 4 + 27,200 s 3 + 160,000 s 2 u( s) ๏ช 4 3 2 9.8 ๏ซ s + 98s + 4,600 s + 27,200s + 160,000 ๏บ๏ป (a) Use symbolic math to confirm the transfer function for a(s). What are the eigenvalues? Syms s z w u a >> H=solve((5*s^2+30*s+200)*z==(30*s+200)*w,… (2.5*s^2+230*s+10200)*w==(30*s+200)*z+(200*s+10000)*u, a==s^2*z/9.8, a,z,w) >> digits(5) >> a=vpa(H.a) >> a=collect(a,s) Or, you can get the transfer function for z(s) and then multiply by s^2/9.8. >> syms s z w u >> G=solve((5*s^2+30*s+200)*z==(30*s+200)*w,… (2.5*s^2+230*s+10200)*w==(30*s+200)*z+(200*s+10000)*u,z,w) >> z=collect(G.z) Using ‘damp’ to get the eigenvalues: Pole Damping Frequency Time Constant (rad/seconds) (seconds) -2.93e+00 + 5.59e+00i 4.64e-01 -2.93e+00 - 5.59e+00i 4.64e-01 -4.61e+01 + 4.36e+01i 7.27e-01 -4.61e+01 - 4.36e+01i 7.27e-01 6.31e+00 6.31e+00 6.34e+01 6.34e+01 3.42e-01 3.42e-01 2.17e-02 2.17e-02 (b) Using the phase variables method, express this transfer function in state variable format considering that ‘a’ is the output of interest. 1 480๐ 4 + 27,200๐ 3 + 160,000๐ 2 [ 4 ]= 9.8 ๐ + 98๐ 3 + 4600๐ 2 + 27,200๐ + 160,000 1 9.8 [480 + −1.984๐4๐ 3 − 2.048๐6๐ 2 − 1.296๐7๐ − 7.68๐7 ๐ 4 + 98๐ 3 + 4600๐ 2 + 27,200๐ + 160,000 ] Thus 0 1 0 0 0 0 1 0 ๐ด=[ ] 0 0 0 1 −160,000 −27,200 −4600 −98 ๐ถ= 0 ๐ต = [0] 0 1 1 [−7.68๐7 −1.296๐7 −2.048๐6 −1.984๐4] ๐ท = [480/9.8] 9.8 84 Or, since this was generated in MATLAB and we have the transfer function for the output of interest, we could use ‘tf2ss’ to get the state variable equations, i.e. >> [A,B,C,D]=tf2ss([480 27200 160000 0 0]/9.8, [1 98 4600 27200 160000]); >> h=ss(A,B,C,D); (c) Use the two M-files ‘rinput’ and ‘dpsd’ to generate values for the road profile irregularities u(t), i.e. >> [u,t]=StochInput(4096,0.005); % This command generates 4096 values for u(t) separated by a time interval of 0.005 seconds. At 30 m/s, that is a value every 0.15 m. The M-file ‘dpsd’ defines the roughness of the road as a function of the wavelength of the irregularities. These Mfiles are provided on Blackboard. (d) Generate two plots of u(t); the first plot shows all of u(t) and the second plot goes out to only 1 second using the ‘axis’ command. Homework 9 - suspension simulation input 0.03 0.02 road profile, u(t) m 0.01 0 -0.01 -0.02 -0.03 0 5 10 15 20 25 time, s >> axis([0 1 -0.01 0.01]) 85 Homework 9 - suspension simulation input 0.01 0.008 0.006 road profile, u(t) m 0.004 0.002 0 -0.002 -0.004 -0.006 -0.008 -0.01 0 0.1 0.2 0.3 0.4 0.5 time, s 0.6 0.7 0.8 0.9 1 (e) Use ‘lsim’ and the state variable model to generate a plot of a(t). After the transients have died out (5 times the largest time constant), what is the observed peak value of normalized acceleration, a(t)? Do you think this value is small enough for passenger comfort? The vertical acceleration is typically between -0.1 and 0.1 g’s; however, peak values of -0.18 are seen to occur. It is desirable to keep the acceleration levels less than 0.1 g. >> h=ss(A,B,C,D); >> [a,t]=lsim(h,u,t); >> plot(t,a) >> xlabel('time, s') >> ylabel('vertical acceleration, g') >> title('homeowrk 9 - suspendion ride quality') 86 >> title('homeowrk 9 - suspension ride quality') homeowrk 9 - suspension ride quality 0.2 0.15 vertical acceleration, g 0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 X: 12.33 Y: -0.1797 0 5 10 15 20 25 time, s inverted pendulum simulation 0.05 SIMULINK State Variables 0.04 0.03 d๏ฑ/dt, rad/s 0.02 0.01 0 -0.01 -0.02 -0.03 -0.04 0 5 10 15 20 25 30 35 40 45 time, s 87 Previous Quiz Problems and Solutions Quiz 1 A mass sits on top of a spring and damper as shown below. Mass Spring x Damper It can be shown that the differential equation for the position of the mass ๐ฅ is given by ๐2๐ฅ ๐๐ฅ 10 2 + 60 + 80๐ฅ = 160 ๐๐ก ๐๐ก (a) What is the dependent variable in the differential equation?_________ (b) What is the independent variable in the differential equation?__________ (c) What is the order of the differential equation?________ (d) Is the differential equation linear or nonlinear? ________ (e) If the mass is disturbed, it will bounce up and down for a while. Eventually, it will return to an equilibrium position which means ๐ฅ will become a constant. What will be this final value of ?_______ Quiz 1 Solution: A mass sits on top of a spring and damper as shown below. Mass Spring x Damper It can be shown that the differential equation for the position of the mass ๐ฅ is given by ๐2๐ฅ ๐๐ฅ 10 2 + 60 + 80๐ฅ = 160 ๐๐ก ๐๐ก (a) What is the dependent variable in the differential equation? x (b) What is the independent variable in the differential equation? t (c) What is the order of the differential equation? 2nd 88 (d) Is the differential equation linear or nonlinear? linear (e) If the mass is disturbed, it will bounce up and down for a while. Eventually, it will return to an equilibrium position which means ๐ฅ will become a constant. What will be this final value? 2 Quiz 2 Consider the following differential equation for a suspension system: ๐ฆฬ + 6.5๐ฆฬ + 9,800๐ฆ 3 = 9.8 (a) What is the order of the differential equation? ____________ (b) Assuming ๐ฆ(๐ก) → ๐๐๐๐ ๐ก๐๐๐ก as ๐ก → ∞, what will be the value of this constant?_____________ (c) Assuming that the initial conditions for this differential equation are ๐ฆฬ (0− ) = 0 ๐๐๐ ๐ฆ(0− ) = 0, draw a sketch of ๐ฆ(๐ก) starting at ๐ก = 0. (d) Obtain a linear approximation for this differential equation by obtaining a straight line approximation for ๐ฆ 3 using the two point method. Be sure to start by sketching ๐ฆ 3 and noting the two points for your straight line. (e) After substituting your straight line into the original differential equation, check to see if the new linearized differential equation gives the correct final value. Quiz 2 Solution: Consider the following differential equation for a suspension system: ๐ฆฬ + 6.5๐ฆฬ + 9,800๐ฆ 3 = 9.8 1. What is the order of the differential equation? ___2nd_________ 2. Assuming ๐ฆ(๐ก) → ๐๐๐๐ ๐ก๐๐๐ก as ๐ก → ∞, what will be the value of this constant?____0.1_______ 0 + 0 + 9,800๐ฆ 3 = 9.8 ๐กโ๐ข๐ ๐ฆ = 0.1 3. Assuming that the initial conditions for this differential equation are ๐ฆฬ (0− ) = 0 ๐๐๐ ๐ฆ(0− ) = 0, draw a sketch of ๐ฆ(๐ก) starting at ๐ก = 0. y(t) 0.1 0 time 89 4. Obtain a linear approximation for this differential equation by obtaining a straight line approximation for ๐ฆ 3 using the two point method. Be sure to start by sketching ๐ฆ 3 and noting the two points for your straight line. y3 y 3 ๏ป .01 y + 0 0.001 0 5. 0.1 y After substituting your straight line into the original differential equation, check to see if the new linearized differential equation gives the correct final value. ๐ฆฬ + 6.5๐ฆฬ + 9,800(0.01๐ฆ) = 9.8 ๐ฆ(∞) = 0.1 Quiz 3 Consider the following spring-mass-damper system with input u(t). z M k b k b u The input (independent variable) to this system is the displacement u. The equations for this suspension system are 10๐งฬ + ๐1 + ๐2 = 0 ๐1 = 100(๐ง − ๐ฃ) ๐2 = 5(๐งฬ − ๐ฃฬ ) ๐3 = 100(๐ฃ − ๐ข) ๐4 = 5(๐ฃฬ − ๐ขฬ ) ๐1 + ๐2 − ๐3 − ๐4 = 0 (a) List the unknowns (dependent variables) and confirm that the number of equations matches the number of unknowns. 90 (b) Use the "D" operator to convert the differential equations to algebraic equations. (c) Eliminate ๐1 , then eliminate ๐2 , then eliminate ๐3 , and then eliminate ๐4 . How many equations with which unknowns do you have left? Quiz 3 Solution: Consider the following spring-mass-damper system with input u(t). z M k b k b u The input (independent variable) to this system is the displacement u. The equations for this suspension system are 10๐งฬ + ๐1 + ๐2 = 0 ๐1 = 100(๐ง − ๐ฃ) ๐2 = 5(๐งฬ − ๐ฃฬ ) ๐3 = 100(๐ฃ − ๐ข) ๐4 = 5(๐ฃฬ − ๐ขฬ ) ๐1 + ๐2 − ๐3 − ๐4 = 0 (a) List the unknowns (dependent variables) and confirm that the number of equations matches the number of unknowns. 6 equations with unknowns: ๐1 , ๐2 , ๐3 , ๐4 , ๐ง, ๐๐๐ ๐ฃ (b) Use the "D" operator to convert the differential equations to algebraic equations. 10๐ท2 ๐ง + ๐1 + ๐2 = 0 ๐1 = 100(๐ง − ๐ฃ) ๐2 = 5๐ท(๐ง − ๐ฃ) ๐3 = 100(๐ฃ − ๐ข) ๐4 = 5๐ท(๐ฃ − ๐ข) ๐1 + ๐2 − ๐3 − ๐4 = 0 (c) Eliminate ๐1 , then eliminate ๐2 , then eliminate ๐3 , and then eliminate ๐4 . How many equations with which unknowns do you have left? 10๐ท2 ๐ง + 100(๐ง − ๐ฃ) + 5๐ท(๐ง − ๐ฃ) = 0 100(๐ง − ๐ฃ)5๐ท(๐ง − ๐ฃ) − 100(๐ฃ − ๐ข) − 5๐ท(๐ง − ๐ฃ) = 0 Two equations with unknowns z and v. 91 Quiz 4 (a) Laplace transform the following differential equation and solve for the Laplace transform Z(s). 2๐งฬ + 12๐งฬ + 36๐ง = 24 ๐ง(0− ) = 0 ๐งฬ (0− ) = 4 Note, the answer should be in the format of a numerator polynomial over a denominator polynomial. Your answer is not complete until it is in this format. (b) The final value theorem is ๐ง(๐ก)๐ก→∞ = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →0 Apply the final value theorem to your Z(s) and see if it gives the correct final value. (c) The initial value theorem is ๐ง(๐ก)0+←๐ก = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →∞ Apply the initial value theorem and see if it gives ๐ง(0− ). Quiz 4 Solution Laplace transform the following differential equation and solve for the Laplace transform Z(s). 2๐งฬ + 12๐งฬ + 36๐ง = 24 ๐ง(0− ) = 0 ๐งฬ (0− ) = 4 Note, the answer should be in the format of a numerator polynomial over a denominator polynomial. Your answer is not complete until it is in this format. 2(๐ 2 ๐(๐ ) − 0๐ − 4) + 12(๐ ๐(๐ ) − 0)+36Z(s)=24/s ๐(๐ ) = 8๐ + 24 ๐ (2๐ 2 + 12๐ + 36) (a) The final value theorem is ๐ง(๐ก)๐ก→∞ = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →0 Apply the final value theorem to your Z(s) and see if it gives the correct final value. ๐ ๐(๐ )๐ →0 = 0 + 24 = 0.666 0 + 0 + 36 Setting the derivatives of z in the original differential equation and solving for z gives 0.666 which checks. (b) The initial value theorem is ๐ง(๐ก)0+←๐ก = ๐๐๐๐๐ก ๐ ๐(๐ )๐ →∞ Apply the initial value theorem and see if it gives ๐ง(0− ). ๐ ๐(๐ )๐ →∞ = 0 which is the initial value of z. 92 Quiz 5 (a) Solve the following differential equation x(t) using separation of variables if x(0) =4. 2๐ฅฬ + 6๐ฅ = 0 (b) Confirm that your solution is correct using the original differential equation. Quiz 5 Solution (h) Solve the following differential equation x(t) using separation of variables if x(0) =4. 2๐ฅฬ + 6๐ฅ = 0 ๐ฅ(๐ก) = 4๐ −3๐ก (b)Confirm that your solution is correct using the original differential equation. 2(−12)๐ −3๐ก + 6(4๐ −3๐ก ) = 0 Quiz 6 The Laplace transform of z(t) is as follows: 6๐ 2 + 12๐ + 5 ๐(๐ ) = ๐ (๐ + 4)[(๐ + 2)2 + 82 ] We know that the inverse Laplace of Z(s) will be of the following format: ๐ง(๐ก) = ๐๐ ๐๐ก + ๐๐ ๐๐ก + ๐๐ ๐๐ก sin (๐๐ก + ๐) ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? Quiz 6 Solution 5 ๐ = 4∗(4+64) = 0.01838 ๐= ๐=0 6(−4)2 + 12(−4) + 5 96 − 48 + 5 = = −0.19485 (−4)[(−4 + 2)2 + 64] −4(68) ๐ = −2 ๐=8 ๐ = −4 Quiz 7 The equation for Y(s) is written below in terms of the input U(s). 6๐ 2 + 3๐ + 84 ๐(๐ ) = [ ] ๐(๐ ) (๐ + 3)[(๐ + 5)2 + 92 ] 93 (a)What is the transfer function? (b)What are the eigenvalues? (c)What are the time constants? (d)If u(t) is a unit impulse, what is U(s) and what is Y(s)? Quiz 7 Solution The equation for Y(s) is written below in terms of the input U(s). 6๐ 2 + 3๐ + 84 ๐(๐ ) = [ ] ๐(๐ ) (๐ + 3)[(๐ + 5)2 + 92 ] 6๐ 2 +3๐ +84 (a)What is the transfer function? [(๐ +3)[(๐ +5)2 +92]] (b)What are the eigenvalues? −3, −5 ± ๐9 (c)What are the time constants? 1/3 and 1/5 (d)If u(t) is a unit impulse, what is U(s) and what is Y(s)? Since U(s)=1 6๐ 2 +3๐ +84 ๐(๐ ) = [(๐ +3)[(๐ +5)2+92]] Quiz 8 The Laplace transform of z(t) is as follows: 6๐ 2 + 12๐ + 5 ๐(๐ ) = ๐ (๐ + 4)[(๐ + 2)2 + 82 ] We know that the inverse Laplace of Z(s) will be of the following format: ๐ง(๐ก) = ๐๐ ๐๐ก + ๐๐ ๐๐ก + ๐๐ ๐๐ก sin (๐๐ก + ๐) ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? Quiz 8 Solution The Laplace transform of z(t) is as follows: ๐(๐ ) = 6๐ 2 + 12๐ + 5 ๐ (๐ + 4)[(๐ + 2)2 + 82 ] 94 We know that the inverse Laplace of Z(s) will be of the following format: ๐ง(๐ก) = ๐๐ ๐๐ก + ๐๐ ๐๐ก + ๐๐ ๐๐ก sin (๐๐ก + ๐) 5 ๐= 4 ∗ 68 ๐=0 ๐= 6(−4)2 + 12(−4) + 5 = −0.07 (−4)([(−4 + 2)2 + 82 ] ๐ = −4 ๐ = −2 ๐=8 Quiz 9 Laplace transform the differential equation below and then solve for Z(s). 3๐งฬ + 6๐งฬ + 12๐ง = 18 ๐ง(0− ) = 2 ๐งฬ (0− ) = 4 Quiz 9 Solution Laplace transform the differential equation below and then solve for Z(s). 3๐งฬ + 6๐งฬ + 12๐ง = 18 ๐ง(0− ) = 2 ๐งฬ (0− ) = 4 ๐งฬ + 2๐งฬ + 4๐ง = 6 18 ๐ 2 ๐(๐ ) − 2๐ − 4 + 2(๐ ๐(๐ ) − 2) + 4๐(๐ ) = ๐ 2๐ 2 + 8๐ + 6 ๐(๐ ) = ๐ (๐ 2 + 2๐ + 4) Quiz 10 Consider the following Laplace transform: 15๐ 3 + 2๐ 2 + 640 ๐(๐ ) = ๐ (5๐ 4 + 162๐ 3 + 1424๐ 2 + 3744๐ + 1280) What will be the final value of z(t) found using the final value theorem? What is the initial value of z(t) as determined from the initial value theorem? What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command. 95 Quiz 10 Solution Consider the following Laplace transform: ๐(๐ ) = 15๐ 3 + 2๐ 2 + 640 ๐ (5๐ 4 + 162๐ 3 + 1424๐ 2 + 3744๐ + 1280) What will be the final value of z(t) found using the final value theorem? ๐ง(∞) = 0 + 0 + 640 = 0.5 0 + 0 + 0 + 0 + 1280 What is the initial value of z(t) as determined from the initial value theorem? ๐ง(0+ ) = 0 What are the MATLAB commands for generating a plot of z(t) using the ‘impulse’ command. >> num=[15 2 0 640]; >> den=[5 162 1424 3744 1280 0]; >> z=tf(num,den); >> impulse(z) Quiz 11 Consider the two simultaneous equations below for a mechanical lift system with step input u(t) with magnitude of 5. 10๐ฆฬ + 6๐ฆฬ + 3๐ฆ = 2๐ฃ 2๐ฃฬ + +10๐ฃ − 4๐ฆ = 2๐ข ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 5 ๐ฃ(0− ) = 4 Convert these equations to algebraic equations using the Laplace transform. Quiz 11 Solution Consider the two simultaneous equations below for a mechanical lift system with step input u(t) with magnitude of 5. 10๐ฆฬ + 6๐ฆฬ + 3๐ฆ = 2๐ฃ ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 5 2๐ฃฬ + +10๐ฃ − 4๐ฆ = 2๐ข ๐ฃ(0− ) = 4 Convert these equations to algebraic equations using the Laplace transform. ๐ฆฬ + 0.6๐ฆฬ + 0.3๐ฆ = 0.2๐ฃ ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 5 ๐ฃฬ + 5๐ฃ − 2๐ฆ = ๐ข ๐ฃ(0− ) = 4 Laplace transforming gives ๐ 2 ๐(๐ ) − 5 + 0.6๐ ๐(๐ ) + 0.3๐(๐ ) = 0.2๐(๐ ) 5 ๐ ๐(๐ ) − 4 + 5๐(๐ ) − 2๐(๐ ) = ๐ 96 Quiz 12 For the differential equation below, use Euler’s numerical integration to compute the first two solution values of x(t) using a time step of 0.01. ๐ฅฬ + 10๐ฅ = 20 ๐ฅ(0− ) = 1 Use the inverse Laplace transform and solve for the exact solution of x(t) and compare the numerical solution values with the exact solution values. Quiz 12 Solution For the differential equation below, use Euler’s numerical integration to compute the first two solution values of x(t) using a time step of 0.01. ๐ฅฬ + 10๐ฅ = 20 ๐ฅ(0− ) = 1 Time t x(t) ๐ฅฬ (๐ก) = 20 − 10๐ฅ(๐ก) x(t+T)=x(t)+T๐ฅฬ (๐ก) 0 1 20-10*1=10 1+0.01*10=1.1 0.01 1.1 20-10*1.1=9 1.1+0.01*9=1.19 0.02 1.19 20-10*1.19=8.1 1.19+0.01*8.1=1.271 Use the inverse Laplace transform and solve for the exact solution of x(t) and compare the numerical solution values with the exact solution values. ๐ ๐(๐ ) − 1 + 10๐(๐ ) = ๐(๐ ) = 20 ๐ 20 + ๐ ๐ (๐ + 10) ๐ฅ(๐ก) = 2 − ๐ −10๐ก t 0 0.01 0.02 Numerical x(t) 1 1.1 1.19 ๐ฅ(๐ก) = 2 − ๐ −10๐ก 1 1.09516 1.18127 Quiz 13 The differential equations for the suspension shown below with input displacement u(t) are 10๐งฬ + 100๐งฬ + 1000๐ง = 100๐คฬ + 1000๐ค 100๐คฬ + 4000๐ค = 100๐งฬ + 1000๐ง + 3000๐ข (a) Assume all initial conditions are zero and convert the equations above to Laplace domain. 97 Z W U (b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 Quiz 13 Solution The differential equations for the suspension shown below with input displacement u(t) are 10๐งฬ + 100๐งฬ + 1000๐ง = 100๐คฬ + 1000๐ค 100๐คฬ + 4000๐ค = 100๐งฬ + 1000๐ง + 3000๐ข (a) Assume all initial conditions are zero and convert the equations above to Laplace domain. Z W U ๐งฬ + 10๐งฬ + 100๐ง = 10๐คฬ + 100๐ค ๐คฬ + 40๐ค = ๐งฬ + 10๐ง + 30๐ข Laplace transforming gives (๐ 2 + 10๐ + 100)๐(๐ ) = (10๐ + 100)๐(๐ ) (๐ + 40)๐(๐ ) = (๐ + 10)๐(๐ ) + 30๐(๐ ) (b) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get (๐ + 10)๐(๐ ) + 30๐(๐ ) ๐(๐ ) = (๐ + 40) (๐ + 10)๐(๐ ) + 30๐(๐ ) (๐ 2 + 10๐ + 100)๐(๐ ) = (10๐ + 100) (๐ + 40) 98 ๐(๐ ) = [ ๐ 3 3000 + 300๐ ] ๐(๐ ) + 40๐ 2 + 300๐ + 3000 Quiz 14 Express the following differential equation with input u in state variable format. What are the initial conditions for the state variables? ๐ฃฬ + 5๐ฃฬ + 10๐ฃ = 20๐ขฬ + 40๐ข ๐ฃ(0− ) = 3 ๐ฃฬ (0− ) = 0.5 ๐ข(0− ) = 0 Quiz 14 solution Express the following differential equation with input u in state variable format. What are the initial conditions for the state variables? ๐ฃฬ + 5๐ฃฬ + 10๐ฃ = 20๐ขฬ + 40๐ข ๐ฅ1 = ๐ฃ ๐ฃ(0− ) = 3 ๐ฅ1 (0− ) = 3 ๐ฅ2 = ๐ฃฬ − 20๐ข ๐ฅฬ 1 = ๐ฅ2 + 20๐ข ๐ฃฬ (0− ) = 0.5 ๐ข(0− ) = 0 ๐ฅ2 (0− ) = 0.5 ๐ฅฬ 2 = −10๐ฅ1 − 5๐ฅ2 − 60๐ข Quiz 15 A dynamic system is represented by the differential equation shown below. ๐งฬ + 7๐งฬ + 10๐ง = 14๐ขฬ + 20๐ข (a) What is the transfer function of this system? (b) What are the eigenvalues of this system? (c) What are the time constants for this system? (d) Suppose the input u(t) is a unit step. What will be the final value of z(t)? (e) How long will it take for z(t) to be within 1% of this final value? Quiz 15 Solution A dynamic system is represented by the differential equation shown below. ๐งฬ + 7๐งฬ + 10๐ง = 14๐ขฬ + 20๐ข (a) What is the transfer function of this system? 14๐ + 20 2 ๐ + 7๐ + 10 (b) What are the eigenvalues of this system? Eigenvalues = -5 and -2 (c) What are the time constants for this system? 99 Time constants = 1/5 and ½ (d) Suppose the input u(t) is a unit step. What will be the final value of z(t)? 0 + 0 + 10๐ง(∞) = 0 + 20(1) ๐ง(∞) = 2 (e) How long will it take for z(t) to be within 1% of this final value? It takes about five times the largest time constant = 5/2 = 2.5 seconds Quiz 16 Perform the following matrix operations: (1) 1 ๐ = [4 7 1 (2) ๐ = [4 7 2 3 5 6] 8 9 2 3 5 6] 8 9 ๐๐ = 1 ๐ = [ 1] 1 ๐๐ = ๐ฅ1 (3) [−2 4 −1] [๐ฅ2 ] = ๐ฅ3 1 2 ๐ข 1 (4) [3 4] [๐ข ] = 2 5 6 1 (5) [2] [4 3 5 6] = 1 1 (6) [2] .∗ [2] 3 3 Express the differential equation below in matrix state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐งโ + 2๐งฬ + 3๐งฬ + 8๐ง = 10๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ฆ = 0.1๐งฬ 100 Quiz 16 Solution Perform the following matrix operations: (1) 1 ๐ = [4 7 1 (2) ๐ = [4 7 2 3 5 6] 8 9 2 3 5 6] 8 9 1 ๐ = [2 3 ๐ 1 ๐ = [ 1] 1 4 7 5 8] 6 9 6 ๐๐ = [15] 24 ๐ฅ1 (3) [−2 4 −1] [๐ฅ2 ] = −2๐ฅ1 + 4๐ฅ2 − ๐ฅ3 ๐ฅ3 ๐ข1 + 2๐ข2 1 2 ๐ข 1 (4) [3 4] [๐ข ] = [3๐ข1 + 4๐ข2 ] 2 5๐ข1 + 6๐ข2 5 6 1 (5) [2] [4 3 4 5 5 5 6] = [ 8 10 12] 12 15 18 1 1 1 (6) [2] .∗ [2] = [4] 3 3 9 Express the differential equation below in matrix state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐งโ + 2๐งฬ + 3๐งฬ + 8๐ง = 10๐ข ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฆ = 0.1๐งฬ ๐ฅ3 = ๐งฬ ๐ฅฬ 1 0 1 0 ๐ฅ1 0 ๐ฅ + [๐ฅฬ 2 ] = [ 0 ] [ ] [ 0 1 0 ]๐ข 2 ๐ฅ ๐ฅฬ 3 −8 −3 −2 3 10 ๐ฆ = [0 0 ๐ฅ1 ๐ฅ 0.1] [ 2 ] + [0]๐ข ๐ฅ3 101 Quiz 17 Solve the following differential equation using separation of variables. 20๐งฬ + 60๐ง = 80 ๐ง(0− ) = 2 Quiz 17 Solution Solve the following differential equation using separation of variables. 20๐งฬ + 60๐ง = 80 ๐ง(0− ) = 2 ๐ง(๐ก) ๐ก 1 ∫ ๐๐ง = − ∫ ๐๐ก = −๐ก 3๐ง − 4 2 0 Integrating gives 4 2 ๐ง(๐ก) = + ๐ −3๐ก 3 3 Quiz 18 The differential equation for the suspension system shown below is ๐งฬ + 0.8๐งฬ + ๐ง = 0.8๐ขฬ + ๐ข z u (a) Express this differential equation in state variable format assuming y = u -z is the output of interest. (b) Enter your state variable equations in MATLAB using the ‘ss’ command. (c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values? (d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot start and end at the correct initial and final values? Get one of the instructors to confirm your graph _________________ 102 Quiz 18 Solution The differential equation for the suspension system shown below is ๐งฬ + 0.8๐งฬ + ๐ง = 0.8๐ขฬ + ๐ข z u (a) Express this differential equation in state variable format assuming y = u -z is the output of interest. ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ − 0.8๐ข 0 1 0.8 ๐ฬ = [ ]๐ + [ ]๐ข −1 −0.8 0.36 ๐ฆ = [−1 0]๐ + [1]๐ข (b) Enter your state variable equations in MATLAB using the ‘ss’ command. >> A=[0 1;-1 -0.8]; >> B=[0.8;0.36]; >> C=[-1 0]; >>D=[1]; >>G=ss(A,B,C,D); (c) Use the ‘eig’ command to get the eigenvalues? Are these the correct values? >> ev=eig(A) Eigenvalues = -0.4 ± j0.8 (d) Use the command ‘step’ to get a plot of y(t) for u(t) a step with magnitude 0.1. Does the plot start and end at the correct initial and final values? >> step(G) The value of y at t = 0+ is 1 and the final value is 0. Quiz 19 Obtain a straight line approximation for x3 in the neighborhood of x = 2. Quiz 19 Solution Obtain a straight line approximation for x3 in the neighborhood of x = 2. ๐ฅ 3 ≈ 23 + 12(๐ฅ − 2) = 12๐ฅ − 16 103 Quiz 20 Two simultaneous differential equations are shown below. ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −100๐ฅ1 − 2๐ฅ2 What are the two unknowns? _______________________ Eliminate ๐ฅ2 and get a single differential equation for ๐ฅ1 . Quiz 20 Solution The two unknowns are ๐ฅ1 ๐๐๐ ๐ฅ2 . ๐ฅฬ 1 + 2๐ฅฬ 1 + 100๐ฅ1 = 0 Quiz 21 (a) Express the differential equation shown below in state variable format using matrices, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? The output of interest is ๐ฆ = ๐ง. 4๐งฬ + 24๐งฬ + 40๐ง = 24๐ขฬ + 40๐ข ๐ง(0− ) = 3 ๐งฬ (0− ) = 2 ๐ข(๐ก) = ๐ข๐๐๐ก ๐ ๐ก๐๐ (b) What are the initial conditions for the state variables, i.e. ๐ฅ1 (0− ) =?, ๐ฅ2 (0− ) =?, ๐๐ก๐. (c) For an ode45 numerical simulation, what would you specify for the final time (when to stop the simulation)? Quiz 21 Solution 0 1 6 (a) ๐ด = [ ] ๐ต=[ ] ๐ถ = [1 0 ] ๐ท = [0] −10 −6 −26 (b) ๐ฅ1 (0− ) = 3 ๐ฅ2 (0− ) = 2 Note, a unit step is zero at t = 0(c) Final time 5/3 sec. Quiz 22 As shown below, two water tanks with the same diameter are connected by a long pipe. At time zero, water starts to flow between the tanks. H1 H2 Q The equations for this system are as follows: (1) Equation for height of water in tank #1: −๐ − 10๐ปฬ1 = 0 (2) Equation for height of water in tank #2: ๐ − 10๐ปฬ2 = 0 (3) Equation for flow through pipe: ๐ = 0.5(๐ป1 − ๐ป2 ) ๐ป1 (0− ) = 10 ๐ ๐ป2 (0− ) = 5 ๐ ๐3 ๐ 104 (a) (30%) List the unknowns in these equations. Do we have enough equations to solve for all of the unknowns? (b) (60%) Considering the common sense aspects of this system, estimate the graphs below that we would get by simulating these equations. H1 Q H2 0 t 0 0 t t (c) (10%) If the time constant for this system is 10 sec, approximately how long will it take for the water in the tanks to reach equilibrium (heights quit changing)? Quiz 23 A spring-mass –damper system is shown below; the displacement of the mass is x. x spring damper mass Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows: (1) Force balance on mass equation: (2) Spring force equation: (3) Damper force equation: (a) List the unknowns. 10๐ฅฬ + ๐น๐ + ๐น๐ = 0 ๐ฅ(0− ) = 0 ๐ฅฬ (0− ) = 2 ๐/๐ ๐น๐ = 1000๐ฅ ๐น๐ = 100๐ฅฬ (b) Are any of the equations nonlinear? (c) State for each equation if algebraic or differential. (d) Laplace transform each of the equations. ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ } = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) 105 Quiz 24 A spring-mass –damper system is shown below; the displacement of the mass is x. x input force Fi spring damper mass Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows: (1) Force balance on mass equation: (2) Spring force equation: (3) Damper force equation: 10๐ฅฬ + ๐น๐ + ๐น๐ − ๐น๐ = 0 ๐ฅ(0− ) = 0 ๐ฅฬ (0− ) = 2 ๐/๐ ๐น๐ = 1000๐ฅ ๐น๐ = 100๐ฅฬ (a) (70%) Solve for the transfer function relating X(s) to Fi(s), i.e. ๐(๐ ) = [? ]๐น๐ (๐ ) Note, the initial conditions do not affect the transfer function (b) (30%) What are the eigenvalues of this system? ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ } = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) Quiz 25 Obtain a linear approximation for the following differential equation by obtaining a straight line approximation for x3. Note, realizing that x will become a constant as t→ ∞, what is final value of x? 2๐ฅฬ + 4๐ฅฬ + 2๐ฅ 3 = 54 ๐ฅ(0− ) = 1 ๐ฅฬ (0− ) = 0 106 Quiz 26 A spring-mass –damper system is shown below; the displacement of the mass is x. x input force Fi spring damper mass Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows: (1) Force balance on mass equation: (2) Spring force equation: (3) Damper force equation: 10๐ฅฬ + ๐น๐ + ๐น๐ − ๐น๐ = 0 ๐ฅ(0− ) = 0 ๐ฅฬ (0− ) = 2 ๐/๐ ๐น๐ = 1000๐ฅ ๐น๐ = 100๐ฅฬ Assume ๐น๐ (๐ ) = 10/๐ and then Laplace transform these equations and then solve for X(s). The answer should be the ratio of two polynomials, i.e. ๐(๐ ) = ๐ฟ{๐} = ๐น(๐ ) ๐๐ ๐ + ๐๐ ๐−1 + โฏ ๐๐ ๐ + ๐๐ ๐−1 + โฏ . . ๐ฟ{๐ฬ } = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) Quiz 27 It has been demonstrated that the Laplace transform of a unit impulse function is 1. Prove this by using the integral definition of the Laplace transform of a unit pulse shown below and then taking the limit as b goes to zero. f(t) f(t) 1 b 0 limit as b → 0 0 t b unit pulse t unit impulse ∞ ๐น(๐ ) = ∫ ๐(๐ก)๐ −๐ ๐ก ๐๐ก 0 107 Quiz 28 The input ๐(๐ก) to the following differential equation is shown below ๐ฆ(0− ) = 1 ๐ฆฬ (0− ) = 0 4๐ฆฬ + 8๐ฆฬ + 24๐ฆ = 12๐(๐ก) f(t) 4 2 t 0 Find the equation for the Laplace of the input, F(s), using the integral definition given below. Show all steps even if you know the answer! ∞ ๐น(๐ ) = ∫ ๐(๐ก)๐ −๐ ๐ก ๐๐ก 0 Quiz 29 The differential equation for the downward speed ๐ฃ of a sphere assuming a linear drag force and assuming that the speed is zero when it is released is as follows ๐ฃฬ + 20๐ฃ = 1000 ๐ฃ(0− ) = 0 ๐/๐ (a) Draw a picture of what you think the speed will look like as a function of time. Note, be sure to show initial and final values and approximate time. v (t ) 0 t (b) Laplace transform the differential equation and solve for V(s). Be sure to check your V(s) using the initial and final value theorems. (c) Use the Residue theorem to find the inverse Laplace transform of your V(s) which will be an equation for v(t). Plug in t = 0 and t = ∞ to check your equation for v(t). 108 Quiz 30 A simple approximation for the transfer function equation relating a vertical force Fi generated on the axle by an out of balance tire on a car to the force Fo transmitted through the suspension is given by ๐น๐ (๐ ) = [ ๐ 2 6๐ + 3600 ] ๐น (๐ ) + 6๐ + 3600 ๐ (a) What is the approximate resonant frequency for this transfer function? _______ Note, the resonant frequency for a mode is the damped natural frequency. (b) The frequency response for this transfer function has been generated in MATLAB using the command ‘bode’ and is shown below. At what frequency does the gain of the transfer function peak? __________ What is the gain of the transfer function at this frequency? _______ Note, the gain is the magnitude of the transfer function. So if the peak of the input force is 1 N, what will be the peak of the output force _______? System: G 25 Bode Diagram Frequency (rad/s): 60 Magnitude (dB): 20 20 Magnitude (dB) 15 10 5 0 -5 -10 -15 -20 0 Phase (deg) -45 -90 -135 -180 10 2 Frequency (rad/s) (c) If the radius of the tire is 0.3 m, what is the approximate speed of the car that generates this peak?__________ 109 Quiz 31 A spring-mass –damper system is shown below; the displacement of the mass is z. z spring damper mass The differential equation for the position of the mass is as follows ๐งฬ + 0.1๐งฬ + 0.01๐ง = 0 ๐ง(0− ) = 0 ๐ ๐งฬ (0− ) = 2 ๐/๐ (a) Define state variables for this 2nd order differential equation and then write the derivative equations for the state variables, i.e. ๐ฅ1 =? ๐ฅ2 =? ๐ฅฬ 1 =? ๐ฅฬ 2 =? (b) Complete the first step of the Euler numerical integration solution of these state variable equations to get values of the state variables after one time step of โ๐ก = 1 sec. t ๐ฅ1 (๐ก) ๐ฅ2 (๐ก) ๐ฅฬ 1 (๐ก) ๐ฅฬ 2 (๐ก) ๐ฅ1 (๐ก + โ๐ก) ๐ฅ2 (๐ก + โ๐ก) 0 1 110 Quiz 32 An object is released from an airplane at an altitude of 500 meters with an initial horizontal velocity of 200 m/s and an initial vertical velocity of zero. z y The differential equations for the horizontal displacement z and the downward displacement y of the falling object considering gravity and aerodynamic drag are ๐งฬ + 0.005๐๐งฬ = 0 ๐ฆฬ + 0.005๐๐ฆฬ = 9.8 ๐ง(0− ) = 0 ๐งฬ (0− ) = 200 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 0 Where V is the magnitude of the velocity vector, i.e. ๐ = √๐งฬ 2 + ๐ฆฬ 2 (a) Are these equations linear or nonlinear? ___________ (b) How many state variables are needed to simulate the trajectory of the falling object? ___ (c) What would you choose for the state variables? (d) What are the initial conditions for your state variables? (e) What are the derivative equations for the state variables 111 Quiz 33 Initially a baseball is moving to the right at 50 m/s. At t = 0, a bat strikes the ball with an impulse force with area 1500. The differential equation for the velocity of the ball is 10๐ฃฬ + 1500๐ฟ(๐ก) = 0 Use Laplace transform to get an equation for v(t). Plot v(t) below. v(t) 0 t It is impossible to include an impulse which has an infinite amplitude in a simulation. However, realizing that the derivative of a unit step u(t) is a unit impulse ๐ฟ(๐ก), we can rewrite the differential equation above as 10๐ฃฬ + 1500๐ขฬ = 0 where u(t) is a unit step. Complete the MATLAB code below for an ode45 simulation to get a plot of v(t). [t,x] = ode45(@Qeqns,( ? ),( ); plot( ? ) % M-file Qeqns function dx = Qeqns(t,x) dx = zeros( ? ); dx = ? end ๐ฟ{๐ฬ } = ๐ ๐น(๐ ) − ๐(0− ) 112 Quiz 34 We know that a transfer function of s means that we are differentiating the input to the that transfer function. As we have discussed in class, differentiating any signal with high frequency noise is a disaster. Consequently, it is desirable to filter out the noise before taking the derivative. The way to do this is with a band limited differentiator such as the one shown below. ๐(๐ ) = [ ๐ ] ๐(๐ ) 10๐ + 1 Suppose we want the digital version of the band limited differentiator assuming a zero order hold digital to analog convertor is to be used. Suggest a sample time T that would be appropriate? T = _____ Explain how you got this value. Using ‘c2d’ in MATLAB >> T = >> G = tf([1 0],[10 0]); >> Gd = c2d(G,T) For a certain value of T we get ๐(๐ง) = [ 0.1๐ง − 0.1 ] ๐(๐ง) ๐ง − 0.9048 What is the line of code in a digital computer program to calculate Yk? Quiz 35 The schematic of a vehicle suspension system is shown below. The vehicle is moving to the right. At t = 0, the contact point at the ground encounters a step with magnitude 0.02 m. Complete the MATLAB ode45 commands below for a numerical simulation that generates a plot of z(t). [t,x]=ode45(@QE,[0 plot( ?],[ ? ? ]) ) function dx=QE(t,x) dx=zeros( ? ); end z ๏ฆ z๏ฆ+ 20 z๏ฆ+ 100 z = 20u๏ฆ+ 100u z (0 − ) = 0 u 0.02 m z๏ฆ(0 − ) = 0 113 Previous Homework and Solutions Homework 1 For each of the differential equations below, solve for the Laplace transform of y(t) which is denoted by Y(s). In every case, the answer should be the ratio of two polynomials; no other form is acceptable. For example 2๐ 2 + 4๐ + 5 ๐(๐ ) = 3 8๐ + 7๐ 2 + 3๐ + 4 1. ๐ฆฬ + 3๐ฆ = 0 ๐ฆ(0− ) = 4 2. ๐ฆฬ + 3๐ฆ = 2 ๐ฆ(0− ) = 4 3. ๐ฆฬ + 3๐ฆ = 10๐ฟ(๐ก) ๐ฆ(0− ) = 4 4. 5๐ฆฬ + 2๐ฆฬ + 3๐ฆ = 0 ๐ฆ(0− ) = 4 ๐ฆฬ (0− ) = 8 −) 5. 5๐ฆฬ + 2๐ฆฬ + 3๐ฆ = 10 ๐ฆ(0 = 4 ๐ฆฬ (0− ) = 8 Homework 1 Solution 1. 2. 3. 4. 5. 4 ๐ +3 4๐ +2 ๐ (๐ +3) 14 ๐ +3 20๐ +48 5๐ 2 +2๐ +3 20๐ 2 +48๐ +10 ๐ (5๐ 2 +2๐ +3) Homework 2 Use the residue theorem to find the inverse Laplace transform y(t) for each of the following Y(s): 1 1. ๐(๐ ) = ๐ +4 ๐ +2 2. ๐(๐ ) = (๐ +5)(๐ +10) ๐ 2 +2๐ +10 3. ๐(๐ ) = ๐ (๐ +2)(๐ +10) ๐ +4 4. ๐(๐ ) = (๐ +2+๐5)(๐ +2−๐5) Homework 2 Solution Use the residue theorem to find the inverse Laplace transform y(t) for each of the following Y(s): 1 1. ๐(๐ ) = ๐ +4 ๐ฆ(๐ก) = ๐ −4๐ก ๐ +2 2. ๐(๐ ) = (๐ +5)(๐ +10) 3 8 ๐ฆ(๐ก) = − 5 ๐ −5๐ก + 5 ๐ −10๐ก 114 ๐ 2 +2๐ +10 5 ๐ +4 4. ๐(๐ ) = (๐ +2+๐5)(๐ +2−๐5) −2−๐5+4 −(2+๐5)๐ก −2+๐5+4 −(2−๐5)๐ก ๐ + ๐ −10๐ ๐10 5 ∅ = ๐ก๐๐−1 2 = 1.19 ๐๐๐ √29๐ ๐∅ −๐∅ ๐ฆ(๐ก) = But, −2 + ๐5 + 4 = 2 + ๐5 = and −2 − ๐5 + 4 = 2 − ๐5 = √29๐ −√29๐ −๐∅ ๐ −(2+๐5)๐ก +√29๐ ๐∅ ๐ −(2−๐5)๐ก So, y(t)= 9 ๐ฆ(๐ก) = 0.5๐ −0๐ก − 8 ๐ −2๐ก + 8 ๐ −10๐ก 3. ๐(๐ ) = ๐ (๐ +2)(๐ +10) ๐10 = √29 −2๐ก ๐ ๐(5๐ก+∅) −๐ −๐(5๐ก+∅) ๐ [ ] 5 ๐2 = √29 −2๐ก ๐ sin 5 (5๐ก + ∅) 1 = √29e−2t sin (5๐ก + 1.19) 5 Note general formula for getting the sum of the two residues for a pair of complex poles: ๐(๐ ) ๐(๐ ) = ๐ท(๐ )(๐ + ๐ + ๐๐)(๐ + ๐ − ๐๐) ๐ −๐๐ก ๐ฆ(๐ก) = ๐ sin(๐๐ก + ∅) + ∑ ๐๐๐ ๐๐๐ข๐๐ ๐๐๐ ๐๐๐๐ก๐ ๐๐ ๐ท(๐ ) ๐ ๐(๐ ) ๐(๐ ) where ∅ = ๐๐๐๐๐ [๐ท(๐ )] and ๐ = |๐ท(๐ )| ๐ =−๐+๐๐ ๐ =−๐+๐๐ Homework #3 (a) For each of the differential equations below, solve for the Laplace transform of y(t) which is denoted by Y(s). In every case, the answer should be the ratio of two polynomials with the denominator factored; no other form is acceptable. For example 2๐ 2 + 4๐ + 5 ๐(๐ ) = (๐ + 2)(๐ + 10)[(๐ + .2)2 + 0. 52 ] Then find the inverse Laplace transform of each Y(s) to get y(t) using the residue method for the real poles and the short cut method (combined residues) for the complex poles. 1. ๐ฆฬ + 3๐ฆ = 0 ๐ฆ(0− ) = 4 2. ๐ฆฬ + 3๐ฆ = 2 ๐ฆ(0− ) = 4 3. ๐ฆฬ + 3๐ฆ = 10๐ฟ(๐ก) ๐ฆ(0− ) = 4 4. ๐ฆฬ + 5๐ฆฬ + 6๐ฆ = 10๐ฟ(๐ก) ๐ฆ(0− ) = 4 ๐ฆฬ (0− ) = 8 −) 5. 2๐ฆฬ + 0.8๐ฆฬ + 0.58๐ฆ = 0 ๐ฆ(0 = 4 ๐ฆฬ (0− ) = 8 6. 2๐ฆฬ + 0.8๐ฆฬ + 0.58๐ฆ = 10 ๐ฆ(0− ) = 4 ๐ฆฬ (0− ) = 8 (b) For 1. and 2. in part (a), solve these differential equations using the separation of variables method and confirm that you got the same answers as found in part (a). (c) For the following differential equations with input u(t), find the transfer functions and eigenvalues. 1. ๐ฆโ + 3๐ฆฬ + 11.25๐ฆฬ + 18.5๐ฆ = 10๐ข 2. ๐ฆโ + 3๐ฆฬ + 11.25๐ฆฬ + 18.5๐ฆ = 10๐ข + 5๐ขฬ 3. 4๐ฆโ + 12๐ฆฬ + 45๐ฆฬ + 74๐ฆ = 12๐ข + 8๐ขฬ + 4๐ขฬ Homework 3 Solution 115 Homework 4 A cart with the ring attached to it moves latterly with displacement z and the ball rolls without slip with angle ๐ inside the ring. ๏ฑ Z The differential equations for this system assuming small angles can be shown to be 2.45๐ฬ + 0.98๐ฬ + 9.8๐ + ๐งฬ = 0 12๐งฬ + 720๐งฬ + 1200๐ง + 3.5๐ฬ = 0 ๐(0− ) = 0.5 ๐ง(0− ) = 0 ๐ฬ(0− ) = 0 ๐งฬ (0− ) = 0 1. Use symbolic math and the 'solve' command in MATLAB and solve for the Laplace transform of ๐(๐ก), which is denoted by๐(๐ ). Use the initial value theorem to see if it is correct. 2. Perform the inverse Laplace transform and get an equation for ๐(๐ก). Use 'pfract' to simplify getting the inverse Laplace transform. Check the equation at t = 0; does it give the initial value? 3. Using the ‘impulse’ command get values of ๐(๐ก). Use the output bracket format so you will have values of ๐ and t to use in the ๐(๐ก) equation and in the plot command. [Th,t]=impulse( ) 4. Using the plot command in MATLAB plot ๐(๐ก) as a function of time using values from your equation and values from the impulse command (t and ๐). Both plots should be on the same graph; use the xlabel, ylabel, title, and legend commands with your plots. Are your plots identical? If not, find your error and get them to be identical. 116 Homework 4 Solution A cart with the ring attached to it moves latterly with displacement z and the ball rolls without slip with angle ๐ inside the ring. ๏ฑ Z The differential equations for this system assuming small angles can be shown to be 2.45๐ฬ + 0.98๐ฬ + 9.8๐ + ๐งฬ = 0 12๐งฬ + 720๐งฬ + 1200๐ง + 3.5๐ฬ = 0 ๐(0− ) = 0.5 ๐ง(0− ) = 0 ๐ฬ(0− ) = 0 ๐งฬ (0− ) = 0 1. Use symbolic math in MATLAB and solve for the Laplace transform of ๐(๐ก), ๐(๐ ). >> syms s Th Z >> H=solve(2.45*(s^2*Th-0.5*s)+0.98*(s*Th-0.5)+9.8*Th+s^2*Z==0,... (12*s^2+720*s+1200)*Z+3.5*(s^2*Th-0.5*s)==0,Z,Th); >> TH=collect(H.Th,s); >> pretty(TH) 3 2 185.0 s + 12684.0 s + 26040.0 s + 8400.0 ---------------------------------------------------------4 3 2 370.0 s + 25368.0 s + 53760.0 s + 117600.0 s + 168000.0 This is the Laplace transform ๐(๐ ). Checking the initial value theorem to see if it is correct: 185 ๐(0+ ) = ๐ ๐(๐ )๐ →∞ = 370 = 0.5 which is correct since the initial value is 0.5. 2. Perform the inverse Laplace transform and get an equation for ๐(๐ก). >> pfract([185 12684 26040 8400],[370 25368 53760 117600 168000]) Transfer function from input 1 to output: -6.349e-005 ----------s + 66.45 117 Tran10sfer function from input 2 to output: 0.4995 s + 0.1982 --------------------s^2 + 0.4034 s + 3.99 Transfer function from input 3 to output: 0.0005387 --------s + 1.713 >> roots([1 0.4034 3.99]) ans = -0.2017 + 1.9873i -0.2017 - 1.9873i >> n=0.4995*(-0.2017+j*1.9873)+0.1982; >> C=abs(n)/1.9873 C = 0.5019 >> phi=angle(n) phi = 1.4729 Thus, the inverse Laplace transform of ๐(๐ ) is ๐(๐ก) = −0.00006349๐ −66.45๐ก + 0.0005387๐ −1.713๐ก + 0.5019๐ −0.2017๐ก ๐ ๐๐( 1.9873๐ก + 1.4729) Checking the answer at t = 0 gives ๐(0) = 0.5 which is the correct value. 3. Using the ‘impulse’ command get values of ๐(๐ก). >> THtf=tf([185 12684 26040 8400],[370 25368 53760 117600 168000]); >> [THt,t]=impulse(THtf); % Note, the output brackets give numerical values for theta and time to be used in the equation for theta and in the plot command. 4. Using the plot command in MATLAB plot ๐(๐ก) as a function of time using values from your equation and values from the impulse command (t and ๐). Both plots should be on the same graph. Are your plots identical? If not, find your error and get them to be identical. >> THfun=-0.00006349*exp(-66.45*t)+0.0005387*exp(-1.713*t)+ 0.5019*exp(-0.2017*t).*sin(1.9873*t+1.4729); >> plot(t,THfun,'r.',t,THt,'b-') >> ylabel('Theta, radians') >> xlabel('Time, sec.') >> legend('using inverse Laplace','using impulse command') >> title('Homework 6 Solution') 118 Homework 6 Solution 0.5 using inverse Laplace using impulse command 0.4 0.3 Theta, radians 0.2 0.1 0 -0.1 -0.2 -0.3 -0.4 0 5 10 15 Time, sec. 20 25 30 The two different approaches give identical results for the simulation of the angular position of the ball in the ring. Note that it does start at 0.5 and ends at zero which are correct. Homework 5 A cart with the ring attached to it moves latterly with displacement z and the ball rolls without slip with angle ๐ inside the ring. The force F is the input to the system. ๏ฑ Z F The differential equations for this system assuming small angles can be shown to be 2.45๐ฬ + 0.98๐ฬ + 9.8๐ + ๐งฬ = 0 12๐งฬ + 720๐งฬ + 1200๐ง + 3.5๐ฬ = ๐น ๐(0− ) = 0 ๐ง(0− ) = 0 ๐ฬ (0− ) = 0 ๐งฬ (0− ) = 0 119 1. Use symbolic math in MATLAB and the ‘solve’ command to get the transfer function for ๐(๐ ). 2. What is the DC gain for this transfer function? What does this DC gain mean if F is a step input? Explain why this makes sense. 3. Use the ‘damp’ command to get the eigenvalues, damping ratios, undamped natural frequencies, and time constants. 4. Use ‘pfract’ to determine the modes of this system. This system consists of two basic components, the cart and the ball. See if you can determine by common sense which modes are associated with each component. 5. Assume that F is a step with magnitude of 1000 and use the ‘step’ command to get a plot of ๐(๐ก). Is the time required to reach steady state approximately 5 times the largest time constant? Is the oscillatory nature of the response consistent with the magnitude of the damping ratio? 6. Assume that F = 1000e-5t and use the ‘impulse’ command to get a plot of ๐(๐ก). Homework 5 Solution A cart with the ring attached to it moves latterly with displacement z and the ball rolls without slip with angle ๐ inside the ring. The force F is the input to the system. ๏ฑ Z F The differential equations for this system assuming small angles can be shown to be 2.45๐ฬ + 0.98๐ฬ + 9.8๐ + ๐งฬ = 0 12๐งฬ + 720๐งฬ + 1200๐ง + 3.5๐ฬ = ๐น ๐(0− ) = 0 ๐ง(0− ) = 0 ๐ฬ (0− ) = 0 ๐งฬ (0− ) = 0 1. Use symbolic math in MATLAB and the ‘solve’ command to get the transfer function for ๐(๐ ). >> syms s F Th Z >> H=solve((2.45*s^2+0.98*s+9.8)*Th+s^2*Z==0,... (12*s^2+720*s+1200)*Z+3.5*s^2*Th==F,Z,Th); >> h=collect(H.Th,s); >> h=collect(h,F); >> pretty(h) -50 s^2 --------------------------------------------------------------------------- F 1295 s^4 + 88788 s^3 + 188160 s^2 + 411600 s + 588000 120 2. What is the DC gain for this transfer function? What does this DC gain mean if F is a step input? Explain why this makes sense. >> G=tf([-50 0 0],[1295 88788 188160 411600 588000]); >> dcgain(G) ans = 0 A DC gain of zero means that the final value of ๐ will be zero if F is a constant input. This makes sense since a constant positive input will move the cart to the left a fixed distance and even though the cart has changed positions, the ball will end up at the bottom of the ring (๐ = 0). 3. Use the ‘damp’ command to get the eigenvalues, damping ratios, undamped natural frequencies, and time constants. >> damp(G) Eigenvalue Damping Undamped natural frequency (rad/s) -1.71e+000 -2.02e-001 + 1.99e+000i 1.01e-001 2.00e+000 -2.02e-001 - 1.99e+000i 1.01e-001 2.00e+000 -6.64e+001 Time constants = 1/1.71, 1/0.202, and 1/66.4 seconds 4. Use ‘pfract’ to determine the modes of this system. This system consists of two basic components, the cart and the ball. See if you can determine by common sense which modes are associated with each component. >> pfract([-50 0 0],[1295 88788 188160 411600 588000]) Mode #1 0.0005995 --------s + 66.45 Mode#2 -0.0003188 s + 0.000618 ----------------------s^2 + 0.4034 s + 3.99 Mode #3 -0.0002808 ---------s + 1.713 Mode 2 is an oscillatory mode which is associated with the ball rolling back and forth inside the ring. Modes 1 and 3 by default have to be associated with the movement of the cart. 121 5. Assume that F is a step with magnitude of 1000 and use the ‘step’ command to get a plot of ๐(๐ก). Is the time required to reach steady state approximately 5 times the largest time constant? Is the oscillatory nature of the response consistent with the magnitude of the damping ratio? >> step(1000*G) Step Response 0.2 0.15 Amplitude 0.1 0.05 0 -0.05 -0.1 -0.15 0 5 10 15 20 25 30 Time (sec) Note that the ball initially rolls up the right side of the ring which is consistent with the cart suddenly being pushed to the left. Five times the time constant of the oscillatory mode is about 25 seconds which is approximately how long it takes for the ball to quit moving around and end up at ๐ = 0 . The smaller the damping ratio, the more oscillatory the response. The response is consistent with a damping ratio of 0.1. 6. Assume that F = 1000e-5t and use the ‘impulse’ command to get a plot of ๐(๐ก). For this F(t), ๐น(๐ ) = ๐(๐ ) = 1000 . ๐ +5 Thus, −50๐ 2 1000 [ ] 4 3 2 1295๐ + 88788๐ + 188160๐ + 411600๐ + 588000 ๐ + 5 In MATLAB, the best way to multiply two transfer functions is with the 'series' command, i.e. >> GF=series(G,tf(1000,[1 5])) Transfer function: -50000 s^2 -------------------------------------------------------------------------1295 s^5 + 95263 s^4 + 632100 s^3 + 1.352e006 s^2 + 2.646e006 s + 2.94e006 122 Pretending that GF is a transfer function with a unit impulse input allows us to get a plot of ๐(๐ก) using the impulse command, i.e. >> impulse(GF) >> title('Response of ball for exponential force input') >> ylabel('Ball angle, radians') Response of ball for exponential force input 0.08 0.06 Ball angle, radians 0.04 0.02 0 -0.02 -0.04 -0.06 0 5 10 15 20 25 30 Time (sec) Homework 6 Consider the following differential equation with input u(t) which is a unit step function. ๐งฬ + 2๐ง = ๐ขฬ + 6๐ข ๐ง(0− ) = 1 (a) Using Laplace transform and the residue theorem, find an equation for z(t). (b) Express the original differential equation in the format required for numerical analysis. 1 Using 10 of the time constant for T, use Euler's integration to compute z(T) and z(2T). (c) Compare the values of z(T) and z(2T) obtained in part (b) with values of z(t) at t=T and t=2T using your equation obtained in part (a). They should be very close for this small value of T. If they are not close, then figure out which one you are doing incorrectly. Homework 6 Solution Consider the following differential equation with input u(t) which is a unit step function. ๐งฬ + 2๐ง = ๐ขฬ + 6๐ข ๐ง(0− ) = 1 (a) Using Laplace transform and the residue theorem, find an equation for z(t). ๐ ๐(๐ ) − 1 + 2๐(๐ ) = ๐ ๐(๐ ) − 0 + 6๐(๐ ) ๐(๐ ) = 1 ๐ Thus, ๐(๐ ) = 2๐ + 6 ๐ (๐ + 2) 123 Using the residue theorem to find the inverse Laplace transform gives ๐ง(๐ก) = 3 − ๐ −2๐ก (b) Express the original differential equation in the format required for numerical analysis. 1 Using 10 of the time constant for T, use Euler's integration to compute z(T) and z(2T). ๐งฬ − ๐ขฬ = 6๐ข − 2๐ง Thus, ๐ฅ =๐ง−๐ข and ๐ฅฬ = 6๐ข − 2๐ง = 6๐ข − 2(๐ฅ + ๐ข) = −2๐ฅ + 4๐ข Time constant =1/2 = 0.5. Thus, T = 0.05 (c) Compare the values of z(T) and z(2T) obtained in part (b) with values of z(t) at t=T and t=2T using your equation obtained in part (a). They should be very close for this small value of T. If they are not close, then figure out which one you are doing incorrectly. t x(t) 0- 1 0.05 1.1 x(t+T)= ๐ฅฬ (๐ก) = −2๐ฅ(๐ก) + 4๐ข(๐ก) T๐ฅฬ (๐ก) + ๐ฅ(๐ก) -2 + 4 = 2 0.05*2 + 1=1.1 -2*1.1 + 4= 1.8 0.10 1.19 -2*1.19+4=1.62 z(t+T)= Analytical Sol. x(t+T)+u(t+T) 3 − ๐ −2(๐ก+๐) 1.1+1=2.1 3 − ๐ −2(.05) = 2.095 0.05*1.8+1.1= 1.19+1=2.19 3 − ๐ −2(0.1) = 1.19 2.181 0.05*1.62+1.19= 1.271+1= 3 − ๐ −2(0.15) = 1.271 2.271 2.259 Because of the ๐ขฬ term in the original differential equation which is an impulse for ๐ข a step, the ๐ง(0− ) ≠ ๐ง(0+ ) = 2. Regardless, z(0.05) and z(0.1) from both methods of solution are very close, i.e. 2.1 compared to 2.095 and 2.19 compared to 2.181 124 Homework 7 Use 'ode45' in MATLAB and generate a plot of ๐ฃฬ (๐ก) for the following differential equation. The input u(t) is a step with magnitude of 0.5. 2๐ฃโ + 18๐ฃฬ + 6.6๐ฃฬ 3 + 130๐ฃ = 22๐ขฬ + 260๐ข ๐ฃ(0− ) = 0 ๐ฃฬ (0− ) = 0.5 ๐ฃฬ (0− ) = 0.2 Homework 7 Solution Homework 8 Consider the following differential equation for a suspension system: ๐ฆฬ + 6.5๐ฆฬ + 9,800๐ฆ 3 = 9.8 1. What is the order of the differential equation? ____________ 2. Assuming ๐ฆ(๐ก) → ๐๐๐๐ ๐ก๐๐๐ก as ๐ก → ∞, what will be the value of this constant?_____________ 3. Assuming that the initial conditions for this differential equation are ๐ฆฬ (0− ) = 0 ๐๐๐ ๐ฆ(0− ) = 0.11 , draw a sketch of ๐ฆ(๐ก) starting at ๐ก = 0. 4. Obtain a linear approximation for this differential equation by obtaining a straight line approximation for ๐ฆ 3 using the point and slope method. Be sure to start by sketching ๐ฆ 3 and noting the location of your straight line. 5. After substituting your straight line into the original differential equation, check to see if the new linearized differential equation gives the correct final value. Homework 8 Solution Consider the following differential equation for a suspension system: ๐ฆฬ + 6.5๐ฆฬ + 9,800๐ฆ 3 = 9.8 1. What is the order of the differential equation? ____________2 2. Assuming ๐ฆ(๐ก) → ๐๐๐๐ ๐ก๐๐๐ก as ๐ก → ∞, what will be the value of this constant?_____0.1 3. Assuming that the initial conditions for this differential equation are ๐ฆฬ (0− ) = 0 ๐๐๐ ๐ฆ(0− ) = 0.11 , draw a sketch of ๐ฆ(๐ก) starting at ๐ก = 0. Starts at 0.11 and t=0 and ends at 0.1 as t approaches infinity. 125 4. Obtain a linear approximation for this differential equation by obtaining a straight line approximation for ๐ฆ 3 using the point and slope method. Be sure to start by sketching ๐ฆ 3 and noting the location of your straight line. Y3=0.13+3(.1)2(y-0.1)=0.001+0.03(y-0.1)=0.03y-0.002 5. After substituting your straight line into the original differential equation, check to see if the new linearized differential equation gives the correct final value. y’’+6.5y’+9800[.03y-0.002]=9.8 Or y’’+6.5y’+294y=29.4 The final value is 29.4/294 = 0.1 which checks. Homework 9 The equations for a spring/mass/damper system are shown below. (a) Laplace transform the three equations to get three algebraic equations in terms of the three unknowns Y(s), ๐น๐ (๐ ), ๐๐๐ ๐น๐ (๐ ) and in terms of the ground input U(s). Assume ๐ข(0− ) = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 2 (b) Since you now have three algebraic equations and three unknowns, you can eliminate the unknowns ๐น๐ (๐ ) ๐๐๐ ๐น๐ (๐ ) and simplify the three equations down to one equation for the unknown ๐(๐ ). Do this to get an expression for ๐(๐ ). (c) What is the transfer function for this suspension system? What are the eigenvalues? What is the time constant? What is the damping ratio? What is the undamped natural frequency? (d) Assume u(t) is a step input with magnitude 0.2. Find an expression for Y(s); the answer will be a numerator polynomial over a denominator polynomial. Check the accuracy of your Y(s) using the initial and final value theorems. 126 Homework 9 Solution The equations for a spring/mass/damper system are shown below. (a) Laplace transform the three equations to get three algebraic equations in terms of the three unknowns Y(s), ๐น๐ (๐ ), ๐๐๐ ๐น๐ (๐ ) and in terms of the ground input U(s). Assume ๐ข(0− ) = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 2 100 10[๐ 2 ๐(๐ ) − 2] + ๐น๐ (๐ ) + ๐น๐ (๐ ) = − ๐ ๐น๐ (๐ ) = 1000[๐(๐ ) − ๐(๐ )] ๐น๐ (๐ ) = 40๐ [๐(๐ ) − ๐(๐ )] (b) Since you now have three algebraic equations and three unknowns, you can eliminate the unknowns ๐น๐ (๐ ) ๐๐๐ ๐น๐ (๐ ) and simplify the three equations down to one equation for the unknown ๐(๐ ). Do this to get an expression for ๐(๐ ). 10[๐ 2 ๐(๐ ) − 2] + 40๐ ๐(๐ ) + 1000๐(๐ ) = [40๐ + 1000]๐(๐ ) − 100 ๐ 40๐ + 1000 20๐ − 100 ] ๐(๐ ) + 2 + 40๐ + 1000 ๐ (10๐ + 40๐ + 1000) (c) What is the transfer function for this suspension system? What are the eigenvalues? What is the time constant? What is the damping ratio? What is the undamped natural frequency? ๐(๐ ) = [ Transfer function: 10๐ 2 40๐ +1000 10๐ 2 +40๐ +1000 Eigenvalues: −2 + ๐9.798 ๐๐๐ − 2 − ๐9.798 Time constant: 0.5 sec Damping ratio: 0.2 Undamped natural frequency: 10 rad/sec 127 (d) Assume u(t) is a step input with magnitude 0.2. Find an expression for Y(s); the answer will be a numerator polynomial over a denominator polynomial. Check the accuracy of your Y(s) using the initial and final value theorems. ๐(๐ ) = [ 40๐ + 1000 0.2 20๐ − 100 + ] 2 + 40๐ + 1000 ๐ ๐ (10๐ + 40๐ + 1000) 10๐ 2 which simplifies to ๐(๐ ) = [ 28๐ + 100 ] + 40๐ + 1000] ๐ [10๐ 2 100 Final value theorem: ๐ฆ(∞) = 1000 = 0.1 which checks since when you plug u=0.2 and all derivatives equal to zero into the original three equations and solve for y, you get 0.1. Initial value theorem: ๐ฆ(0+ ) = 0 which matches the initial condition on ๐ฆ(๐ก), ๐ฆ(0− ) = 0. Note, if you multiply Y(s) by s, you get the Laplace transform for ๐ฆฬ (๐ก), i.e. 28๐ + 100 ] [10๐ 2 + 40๐ + 1000] Applying the initial value theorem gives ๐ฆฬ (0+ ) = 2.8 ๐คโ๐๐โ ๐๐ ๐๐๐๐๐ก๐๐ ๐กโ๐๐ ๐ฆฬ (0− ) = 2. ๐ฬ(๐ ) = [ This difference is due to the ๐ขฬ term in the equations which is an impulse when ๐ข is a step; that is, an impulse force acting on the mass causes the velocity of the mass to instantly change. Homework 10 The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ H1 ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H2 Q 128 (a) If you Laplace transform each of these three equations you get −๐ − 20[๐ ๐ป1 (๐ ) − 3] = 0 ๐ − 40[๐ ๐ป2 − 5] = 0 ๐ป1 − ๐ป2 = 250[๐ ๐(๐ ) − 0] (b) Use symbolic math in MATLAB to get ๐ป1 = 1.5๐ฅ108 ๐ 2 + 65,000 ๐ (5๐ฅ107 ๐ 2 + 15,000) (c) Use the residue theorem and shortcut for complex poles to get an equation for H1(t). (d) Use the ‘impulse’ command in MATLAB to get a plot of H1(t) and plot the equation found in part (c) on the same graph with red dots for comparison. Homework 10 Solution The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H1 H2 Q (a) If you Laplace transform each of these three equations you get −๐ − 20[๐ ๐ป1 (๐ ) − 3] = 0 ๐ − 40[๐ ๐ป2 − 5] = 0 ๐ป1 − ๐ป2 = 250[๐ ๐(๐ ) − 0] (b) Use symbolic math in MATLAB to get ๐ป1 = 1.5๐ฅ108 ๐ 2 + 65,000 ๐ (5๐ฅ107 ๐ 2 + 15,000) syms s H1 Q H2 H=solve(-Q-20*(s*H1-3)==0,Q-40*(s*H2-5)==0,H1-H2==250*s*Q,H1,H2,Q); H1=H.H1; pretty(H1) 129 30000 s^2 + 13 H1(s) = --------------------- 3๐ 2 +13๐ฅ10−4 3๐ 2 +13๐ฅ10−4 = ๐ (๐ 2 +3๐ฅ10−4 ) = ๐ (๐ 2 +0๐ +0.017322 ) s (10000 s^2 + 3) (c) Use the residue theorem and shortcut for complex poles to get an equation for H1(t). 13๐ฅ10−4 0๐ก ๐ 0๐ก 3๐ 2 + 13๐ฅ10−4 ๐ป1 (๐ก) = ๐ + | | sin (0.01732๐ก + ∅) 3๐ฅ10−4 0.01732 ๐ ๐ =0+๐0.01732 | 3๐ 2 + 13๐ฅ10−4 3(๐0.01732)2 + 13๐ฅ10−4 | =| | = 0.023098 ๐ ๐0.01732 ๐ =0+๐0.01732 ∅ = −1.5708 Thus ๐ป1 (๐ก) = 4.333 + 1.333sin (0.01732๐ก − 1.5708) Checking at t = 0 ๐ป1 (0) = 4.333 + 1.333(−1) = 3 which is correct! (d) Use the ‘impulse’ command in MATLAB to get a plot of H1(t) and plot the equation found in part (c) on the same graph with red dots for comparison. >> [h1m,t]=impulse(h1,2000); >> plot(t,h1m,'k',t,4.333+1.333*sin(0.01732*t-1.5708),'r.') >> xlabel('time, sec.') >> ylabel('H1') >> title('Homework 5 comparing solutions to water tanks problem') >> legend('solution from impulse command','inverse Laplace solution','location',’best’) Homework 5 comparing solutions to water tanks problem 6 5.5 5 H1 solution from impulse command inverse Laplace solution 4.5 4 3.5 3 0 500 1000 1500 time, sec. 2000 2500 130 Homework 11 The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ + ๐ ๐ ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H1 H2 Q (a) Laplace transform each of these three equations and solve for the Laplace transform for H1 by hand; that is, you do the algebra. The answer will be in terms of R. (b) Repeat (a) only this time use symbolic math in MATLAB; confirm that you get the same equation for H1(s). (c) Determine the value of R that results in a damping ratio of 0.5 (or whatever I told you in class). Once you have determined the necessary value for R, use the ‘subs’ command to get the transfer function with the value of R needed for the desired damping ratio. (d) Use the impulse command in MATLAB to get plots of H1(t) using the value of R found in part (c); plot on the same graph, H1(t) for two other values of R, one 20% greater and one 20% smaller than the R that gives your desired damping ratio. In what ways are these plots of H1 the same? Different? Homework 11 Solution The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ + ๐ ๐ ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 131 H1 H2 Q (a) Laplace transform each of these three equations and solve for the Laplace transform for H1 by hand; that is, you do the algebra. The answer will be in terms of R. (b) Repeat (a) only this time use symbolic math in MATLAB; confirm that you get the same equation for H1(s). (c) Determine the value of R that results in a damping ratio of 0.5 (or whatever I told you in class). Once you have determined the necessary value for R, use the ‘subs’ command to get the transfer function with the value of R needed for the desired damping ratio. (d) Use the impulse command in MATLAB to get plots of H1(t) using the value of R found in part (c); plot on the same graph, H1(t) for two other values of R, one 20% greater and one 20% smaller than the R that gives your desired damping ratio. In what ways are these plots of H1 the same? Different? syms s R Q H1 H2 H=solve(-Q-20*(s*H1-3)==0,Q-40*(s*H2-5)==0,H1-H2==250*s*Q+R*Q,H1,H2,Q); pretty(H.H1) digits 4 %The value of R in the following statements obtained using the results of %the first three statements above. h1a=vpa(subs(H.H1,R,3.4641)); h1b=vpa(subs(H.H1,R,3.4641*1.2)); h1c=vpa(subs(H.H1,R,3.4641*0.8)); %The polynomials in the following statements obtained using the results of %the previous three statements above. %The symbolic polynomials in the commands below were copied from the output %of the previous three commands and then pasted into the ‘sym2poly’ command. h1aTF=tf(sym2poly(30000.0*s^2 + 415.7*s + 13.0),sym2poly(s*(10000.0*s^2 + 138.6*s + 3.0))); h1bTF=tf(sym2poly(30000.0*s^2 + 498.8*s + 13.0),sym2poly(s*(10000.0*s^2 + 166.3*s + 3.0))); h1cTF=tf(sym2poly(30000.0*s^2 + 332.6*s + 13.0),sym2poly(s*(10000.0*s^2 + 110.9*s + 3.0))); impulse(h1aTF,'k',h1bTF,'k.',h1cTF,'k-.',800) legend('R = 3.4641','R = 1.2*3.4641','R = 0.8*3.4641','location','best') title('Height H1 of water in the first tank following unequal height initial conditions') 132 Height H1 of w ater in the first tank follow ing unequal height initial conditions 4.8 4.6 4.4 Amplitude 4.2 4 R = 3.4641 R = 1.2*3.4641 3.8 R = 0.8*3.4641 3.6 3.4 3.2 3 0 100 200 300 400 500 600 700 800 Time (seconds) Adding friction associated with viscosity to the water flowing through the line between tanks causes the water levels to eventually quit oscillating and settle at the correct steady state height. Homework 12 It can be shown that the differential equation for the suspension system shown below is a follows: 1000๐งฬ + 7200๐งฬ + 36000๐ง = 7200๐ขฬ + 36000๐ข z M=1000 kg k=36000 N/m b=7200 Ns/m u 133 The solution to this differential equation is the displacement of the mass z(t) resulting from the nonsmooth road profile u(t) which represents a displacement input. (a) What is the transfer function G(s) for this system? (b) What are the eigenvalues, damping ratio, and time constant of this system? ๐ 4 (c) Assume that ๐ข(๐ก) = 1 − cos (2๐ก). If ๐ฟ{cos(๐๐ก)} = ๐ 2 +๐2 show that ๐(๐ ) = ๐ (๐ 2 +4) (d) For the u(t) in (c), obtain the expression for Z(s) assuming all initial conditions are zero, and then using the inverse Laplace transform, find an equation for z(t). After finding the equation for z(t), generate an array of values of t and z(t) in MATLAB using >> t=0:0.01:7; >> z=’your equation goes here’; Don’t forget, when multiplying two arrays, element by element, you must use ‘.*’ instead of ‘*’. Then, plot the results using: >> plot(t,z) Be sure to add a ‘title’, ‘xlabel’, and ‘ylabel’ to the plot. (e) We have learned in class that you can get a plot of z(t) by pretending that Z(s) is a transfer function with a unit impulse input and then using the command ‘impulse’ in MATLAB to generate a plot of z(t). Use the ‘impulse’ command on Z(s) and then add this plot to the plot in part (c) using the hold command. The plots should be identical so use dots for one of the functions and the command ‘legend’ to distinguish between the two. Note, when you multiply U(s) times the transfer function to get Z(s), use the command ‘series’ for multiplying two transfer functions; do not use g*h where g and h are the two transfer functions to be multiplied. Also, although not needed here, when adding two transfer functions, use ‘parrallel’; do not simply add them such as g + h. Note, instead of using the ‘hold’ command, you can use the following to get both plots of z(t) on the same plot: >> [zi]=impulse(Z,t); >> plot(t,z,’r.’,t,zi,’k’) Use this approach to generate a second combined plot. Be sure your plot has a ‘title’, ‘xlabel’, ‘ylabel’, and ‘legend’. Confirm that the plots are identical. (f) Another way to get a plot of z(t) is to use the command ‘lsim’. The commands will be as follows: >> t=0:0.01:7; Actually, you don’t need to generate t again if the values of t are still in memory. >> u=1-cos(2*t); >> [zLsim]=lsim(G,u,t); Generate a combined plot using >> plot(t,z,’k.’,t,zi,’r+’,t,zLsim,’k*’) Be sure your plot has a ‘title’, ‘xlabel’, ‘ylabel’, and ‘legend’. Confirm that all three plots are identical. 134 (g) Considering the equation for the input u(t), what can you say about the resulting displacement of the mass. For example, compare the input and output frequencies. Also, compare the input and output amplitudes. You might want to plot z(t) and u(t) on the same graph to answer these questions. Homework 12 Solution It can be shown that the differential equation for the suspension system shown below is a follows: 1000๐งฬ + 7200๐งฬ + 36000๐ง = 7200๐ขฬ + 36000๐ข z M=1000 kg k=36000 N/m b=7200 Ns/m u The solution to this differential equation is the displacement of the mass z(t) resulting from the nonsmooth road profile u(t) which represents a displacement input. (a) What is the transfer function G(s) for this system? 7200๐ +36000 ๐ป(๐ ) = 1000๐ 2 +7200๐ +36000 (b) What are the eigenvalues, damping ratio, and time constant of this system? -3.6±j4.8, 0.6, 0.278 (c) Assume that ๐ข(๐ก) = 1 − cos (2๐ก). If ๐ฟ{cos(๐๐ก)} = ๐ ๐ 2 +๐2 show that ๐(๐ ) = 4 ๐ (๐ 2 +4) 1 ๐ 4 − 2 = 2 ๐ ๐ + 4 ๐ (๐ + 4) (d) For the u(t) in (c), obtain the expression for Z(s) assuming all initial conditions are zero, and then using the inverse Laplace transform, find an equation for z(t). 7200๐ + 36000 4 ๐(๐ ) = ๐ป(๐ )๐(๐ ) = 2 2 1000๐ + 7200๐ + 36000 ๐ (๐ + 4) The following m-file was used to express Z(s) in partial fractions: ๐ฟ{1 − cos(2๐ก)} = G=tf([7.2 36],[1 7.2 36]); Z=series(G,tf([4],[1 0 4 0])); [num,den]=tfdata(Z,'v') pfract(num,den) ๐(๐ ) = 1 0.104๐ + 0.842 −1.104๐ − 0.9356 + + ๐ ๐ 2 + 7.2๐ + 36 (๐ + 0)2 + 22 135 ๐ −3.6๐ก |0.104๐ + 0.842|๐ =−3.6+๐4.8 sin(4.8๐ก + ∅) 4.8 ๐ 0๐ก |−1.104๐ − 0.9356|๐ =๐2 sin (2๐ก + ๐) + 2 = 1 + 0.14249๐ −3.6๐ก sin(4.8๐ก + 0.81765) + 1.1049sin (2๐ก − 1.6131) After finding the equation for z(t), generate an array of values of t and z(t) in MATLAB using >> t=0:0.01:7; >> z=’your equation goes here’; Don’t forget, when multiplying two arrays, element by element, you must use ‘.*’ instead of ‘*’. ๐ง(๐ก) = 1 + format shorte t=0:0.01:7; z=1+0.14249*exp(-3.6*t).*sin(4.8*t+0.81765)+1.1049*sin(2*t-1.6131); plot(t,z,'k') title('Homework 7 part(d)') xlabel('time, sec.') ylabel('z(t)') Homework 7 part(d) 2.5 2 z(t) 1.5 1 0.5 0 -0.5 0 1 2 3 4 time, sec. 5 6 7 (e) We have learned in class that you can get a plot of z(t) by pretending that Z(s) is a transfer function with a unit impulse input and then using the command ‘impulse’ in MATLAB to generate a plot of z(t). Use the ‘impulse’ command on Z(s) and then add this plot to the plot in part (d) using the hold command. The plots should be identical so use dots for one of the functions and the command ‘legend’ to distinguish between the two. Note, when you multiply U(s) times the transfer function to get Z(s), use the command ‘series’ for multiplying two transfer functions; do not use g*h where g and h are the two transfer functions to be multiplied. Also, although not needed here, when adding two transfer functions, use ‘parrallel’; do not simply add them such as g + h. G=tf([7.2 36],[1 7.2 36]); Z=series(G,tf([4],[1 0 4 0])); 136 [zi]=impulse(Z,t); plot(t,z,'k',t,zi,'r.') xlabel('time, sec.') ylabel('z(t)') title('Homework 7 part(e)') legend('from inverse Laplace','from impulse command','location','best') Homework 7 part(e) 2.5 2 z(t) 1.5 1 0.5 0 from impulse command from inverse Laplace -0.5 0 1 2 3 4 time, sec. 5 6 7 The plots are identical. (f) Another way to get a plot of z(t) is to use the command ‘lsim’ u=1-cos(2*t); [zLsim]=lsim(G,u,t); plot(t,z,'k',t,zi,'r.',t,zLsim,'k*') xlabel('time, sec.') ylabel('z(t)') title('Homework 7 part(f)') legend('from inverse Laplace','from impulse command','from lsim','location','best') Homework 7 part(f) 2.5 2 from inverse Laplace from impulse command from lsim z(t) 1.5 1 0.5 0 -0.5 0 1 2 3 4 time, sec. 5 6 7 All three plots are identical. 137 (g) Considering the equation for the input u(t), what can you say about the resulting displacement of the mass. For example, compare the input and output frequencies. Also, compare the input and output amplitudes. You might want to plot z(t) and u(t) on the same graph to answer these questions. The input and output frequencies are identical; this is always the case. In regard to the amplitude of the output, it will either be larger or smaller than the amplitude of the input depending on the magnitude of the transfer function at the input frequency. The input of 1-cos2t produces a wave from 0 to 2. From the graph, we see that z(t) goes from 0 to about 2.1. The value of 2.1 can also be determined from the inverse Laplace transform equation for z(t), i.e. ๐ง(๐ก) = 1 + 0 + 1.1049sin ( ) Note in the equation above, the peak value will be 1 + 1.1049 = 2.1049. The entire m-file used for this homework solution is given below: format shorte G=tf([7.2 36],[1 7.2 36]); Z=series(G,tf([4],[1 0 4 0])); [num,den]=tfdata(Z,'v') pfract(num,den) t=0:0.01:7; z=1+0.14249*exp(-3.6*t).*sin(4.8*t+0.81765)+1.1049*sin(2*t-1.6131); plot(t,z,'k') title('Homework 7 part(d)') xlabel('time, sec.') ylabel('z(t)') figure [zi]=impulse(Z,t); plot(t,z,'k',t,zi,'r.') xlabel('time, sec.') ylabel('z(t)') title('Homework 7 part(e)') legend('from inverse Laplace','from impulse command','location','best') figure u=1-cos(2*t); [zLsim]=lsim(G,u,t); plot(t,z,'k',t,zi,'r.',t,zLsim,'k*') xlabel('time, sec.') ylabel('z(t)') title('Homework 7 part(f)') legend('from inverse Laplace','from impulse command','from lsim','location','best') Homework 13 If a linear system has a sine wave input and all of the eigenvalues of the system have nonzero negative real parts, then after approximately five times the largest time constant, the output will be a sine wave at the same frequency with an amplitude equal to the input amplitude times the magnitude of the system transfer function evaluated with s = j๐I where ๐๐ is the input frequency, i.e. ๐(๐ ) = ๐ป(๐ )๐(๐ ) ๐ข(๐ก) = ๐ด๐ ๐๐(๐๐ ๐ก) ๐ง(๐ก) = ๐ด|๐ป(๐๐๐ )|sin (๐๐ ๐ก + ๐) ๐ = ๐๐๐๐๐[๐ป(๐๐๐ )] (a) In your own words and math, redo the proof of this result using the shortcut of the residue theorem applied to the complex poles of Z(s). 138 (b) Apply this expedited approach to getting an equation for y(t) for ๐ก → ∞ for the following system: ๐(๐ ) = [ ๐ + 10 ] X(s) ๐ +2 ๐ฅ(๐ก) = 5sin (4๐ก) (c) Apply this expedited approach to getting an equation for w(t) for ๐ก → ∞ for the following system: ๐(๐ ) = [ Homework 13 100๐ ] ๐(๐ ) (๐ + 2)2 + 32 ๐ฃ(๐ก) = 10sin (3๐ก) Solution If a linear system has a sine wave input and all of the eigenvalues of the system have nonzero negative real parts, then after approximately five times the largest time constant, the output will be a sine wave at the same frequency with an amplitude equal to the input amplitude times the magnitude of the system transfer function evaluated with s = j๐I where ๐๐ is the input frequency, i.e. ๐(๐ ) = ๐ป(๐ )๐(๐ ) ๐ข(๐ก) = ๐ด๐ ๐๐(๐๐ ๐ก) ๐ง(๐ก) = ๐ด|๐ป(๐๐๐ )|sin (๐๐ ๐ก + ๐) ๐ = ๐๐๐๐๐[๐ป(๐๐๐ )] (a) In your own words and math, redo the proof of this result using the shortcut of the residue theorem applied to the complex poles of Z(s). ๐ด๐๐ ๐(๐ ) = ๐ป(๐ ) 2 ๐ + ๐๐2 ๐ง(๐ก) = ∑ ๐๐๐ ๐๐๐ข๐๐ ๐๐๐ ๐๐๐๐๐ ๐๐ ๐ป(๐ ) + ∑ ๐๐๐ ๐๐๐ข๐๐ ๐๐ 0 ± ๐๐๐ After about five times the largest time constant assuming all poles of H(s) have non-zero negative real parts, ๐ง(๐ก) = 0 + ∑ ๐๐๐ ๐๐๐ข๐๐ ๐๐ 0 ± ๐๐๐ = 1 |๐ป(๐๐๐ )๐ด๐๐ | sin(๐๐ ๐ก + ๐๐๐๐๐[๐ป(๐๐๐ )๐ด๐๐ ]) ๐๐ = ๐ด|๐ป(๐๐๐ )| sin(๐๐ ๐ก + ๐๐๐๐๐[๐ป(๐๐๐ )]) (b) Apply this expedited approach to getting an equation for y(t) for ๐ก → ∞ for the following system: ๐ + 10 ๐(๐ ) = [ ๐ฅ(๐ก) = 5sin (4๐ก) ] X(s) ๐ +2 ๐4 + 10 ๐4 + 10 ๐ฆ(๐ก) = 5 | | sin (4๐ก + ๐๐๐๐๐ [ ]) ๐4 + 2 ๐4 + 2 4 4 √42 + 102 =5 sin (4๐ก + ๐ก๐๐−1 ( ) − ๐ก๐๐−1 ( )) 10 2 √42 + 22 = 12.0416sin (4๐ก − 0.7266) 139 Using MATLAB to check the result for ๐๐ = 4, >> s=j*4; >> H=(s+10)/(s+2); >> 5*abs(H)= 12.0416 >> angle(H)= -0.7266 These answers agree with the hand calculations. Using the command ‘bode’ to check all frequencies including ๐๐ = 4, >> H=tf([1 10],[1 2]); >> bode(H) Bode Diagram Magnitude (dB) 15 10 System: H Frequency (rad/s): 4 Magnitude (dB): 7.63 5 Phase (deg) 0 0 -30 -60 -1 10 0 10 System: H Frequency (rad/s): 4 Phase (deg): -41.4 1 10 2 3 10 10 Frequency (rad/s) 7.63 From the graph above 20๐ฟ๐๐10 |๐ป(๐4)| = 7.63 ๐๐ต Thus, 5|๐ป(๐4)| = 5 ∗ 10 20 = 12.04 and the phase angle is -41.4 deg = -0.7226. These results also agree with the hand calculations. Note, using ‘bode’, we can get the magnitude and phase of the transfer function at any input frequency. (c) Apply this expedited approach to getting an equation for w(t) for ๐ก → ∞ for the following system: 100๐ ๐(๐ ) = [ ๐ฃ(๐ก) = 10sin (3๐ก) ] ๐(๐ ) (๐ + 2)2 + 32 100 ∗ ๐3 100 ∗ ๐3 ๐ค(๐ก) = 10 | | sin (3๐ก + ๐๐๐๐๐ [ ]) 2 2 (๐3 + 2) + 3 (๐3 + 2)2 + 32 = 237.17sin (3๐ก + 0.3218) 140 Homework 14 Express the differential equations below in state variable format, i.e. ๐ฅฬ 1 = ๐1 (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) ๐ฅฬ 1 (0− ) ๐ฅฬ 2 = ๐2 (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) ๐ฅฬ 2 (0− ) … … … .. ๐ฅฬ ๐ = ๐๐ (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) ๐ฅฬ ๐ (0− ) ๐ฆ = ๐๐ฆ (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) (1) (2) (3) (4) (5) ๐งฬ + 2๐งฬ + 12๐ง = 4๐ข ๐ฆ=๐ง ๐ง(0− ) = 3 ๐งฬ (0− ) = 6 ๐งโ + ๐งฬ + 2๐งฬ + 12๐ง = 4๐ข ๐ฆ = ๐งฬ ๐ง(0− ) = 3 ๐งฬ (0− ) = 6 ๐งฬ (0− ) = 1 ๐งฬ + 2๐งฬ 3 + 12๐ง = 4๐ข ๐ฆ=๐ง ๐ง(0− ) = 3 ๐งฬ (0− ) = 6 −) ๐งฬ + 2๐งฬ + 12๐ง = 4๐ข ๐ฆ =๐ข−๐ง ๐ง(0 = 2 ๐งฬ (0− ) = 0.4 ๐ฬ + 0.2๐ฬ + 9 sin(๐) = 0.18๐ข ๐ฆ = ๐ ๐(0− ) = 0.1 ๐ฬ (0− ) = 0 Homework 14 Solution Express the differential equations below in state variable format, i.e. ๐ฅฬ 1 = ๐1 (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) ๐ฅฬ 1 (0− ) ๐ฅฬ 2 = ๐2 (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) ๐ฅฬ 2 (0− ) … … … .. ๐ฅฬ ๐ = ๐๐ (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) ๐ฅฬ ๐ (0− ) ๐ฆ = ๐๐ฆ (๐ฅ1 , ๐ฅ2 , … , ๐ฅ๐ , ๐ข) (1) ๐งฬ + 2๐งฬ + 12๐ง = 4๐ข ๐ฆ=๐ง ๐ง(0− ) = 3 ๐งฬ (0− ) = 6 ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = 4๐ข − 12๐ฅ1 − 2๐ฅ2 ๐ฅ1 (0− ) = 3 ๐ฅ2 (0− ) = 6 ๐ฆ = ๐ฅ1 (2) ๐งโ + ๐งฬ + 2๐งฬ + 12๐ง = 4๐ข ๐ฆ = ๐งฬ ๐ง(0− ) = 3 ๐งฬ (0− ) = 6 ๐งฬ (0− ) = 1 ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅ3 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = ๐ฅ3 ๐ฅฬ 3 = 4๐ข − 12๐ฅ1 − 2๐ฅ2 − ๐ฅ3 ๐ฅ1 (0− ) = 3 ๐ฅ2 (0− ) = 6 ๐ฅ3 (0− ) = 1 ๐ฆ = ๐ฅ2 (3) ๐งฬ + 2๐งฬ 3 + 12๐ง = 4๐ข ๐ฆ=๐ง ๐ง(0− ) = 3 ๐งฬ (0− ) = 6 ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = 4๐ข − 12๐ฅ1 − 2๐ฅ23 ๐ฅ1 (0− ) = 3 ๐ฅ2 (0− ) = 6 (4) ๐งฬ + 2๐งฬ + 12๐ง = 4๐ข ๐ฆ =๐ข−๐ง ๐ง(0− ) = 2 ๐งฬ (0− ) = 0.4 ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = 4๐ข − 12๐ฅ1 − 2๐ฅ2 ๐ฅ1 (0− ) = 2 ๐ฅ2 (0− ) = 0.4 ๐ฆ = ๐ฅ1 ๐ฆ = ๐ข − ๐ฅ1 (5) ๐ฬ + 0.2๐ฬ + 9 sin(๐) = 0.18๐ข ๐ฆ = ๐ ๐(0− ) = 0.1 ๐ฬ (0− ) = 0 ๐ฅ1 = ๐ ๐ฅ2 = ๐ฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = 0.18๐ข − 9sin (๐ฅ1 ) − 0.2๐ฅ2 ๐ฅ1 (0− ) = 0.1 ๐ฅ2 (0− ) = 0 ๐ฆ = ๐ฅ1 141 Homework 15 The differential equation for a suspension is given below. The output of interest is y = u – z where u is a displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters. 1000๐งฬ + 12,000๐งฬ + 144,000๐ง = 12,000๐ขฬ + 144,000๐ข ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 z M k b u (a) (b) (c) (d) Find the Laplace transform of y(t), Y(s). In MATLAB, use the impulse command to get a plot of y(t). Express the differential equation in state variable format. Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of y(t). Compare this plot with the plot in (b) and confirm that the plots are identical. Homework 15 Solution The differential equation for a suspension is given below. The output of interest is y = u – z where u is a displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters. 1000๐งฬ + 12,000๐งฬ + 144,000๐ง = 12,000๐ขฬ + 144,000๐ข ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 z M k b u 142 (a) Find the Laplace transform of y(t), Y(s). 12,000๐ + 144,000 ๐(๐ )] 1000๐ 2 + 12,000๐ + 144,000 1000๐ 2 0.05 50๐ = = 2 2 1000๐ + 12,000๐ + 144,000 ๐ 1000๐ + 12,000๐ + 144,000 (b) In MATLAB, use the impulse command to get a plot of y(t). >> G=tf([50 0],[1000 12000 144000]); >> impulse(G) >> title('Homework 10 inverse Laplace of Y(s)') >> ylabel('y=u-z, meters') ๐(๐ ) = ๐(๐ ) − ๐(๐ ) = [๐(๐ ) − Homew ork 10 inverse Laplace of Y(s) 0.05 0.04 y=u-z, meters 0.03 0.02 0.01 0 -0.01 -0.02 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (seconds) (c) Express the differential equation in state variable format. ๐ฅฬ 1 = ๐ฅ2 + 12๐ข ๐งฬ + 12๐งฬ + 144๐ง = 12๐ขฬ + 144๐ข ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ − 12๐ข ๐ฅฬ 2 = 144๐ข − 144๐ฅ1 − 12(๐ฅ2 + 12๐ข) = −144๐ฅ1 − 12๐ฅ2 ๐ฆ = ๐ข − ๐ฅ1 (d) Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of y(t). Compare this plot with the plot in (b) and confirm that the plots are identical. %m-file to start the simulation saved as Hmwk10Start [t,x]=ode45(@Hmwk10Eqns,[0 0.9],[0 0]); y=0.05-x(:,1); plot(t,y) title('Homework 10 numerical solution') ylabel('y = u - z, meters') xlabel('time, seconds') 143 %m-file containing the state variable differential equations named Hmwk10Eqns function dx=Hmwk10Eqns(t,x) dx=zeros(2,1); u=0.05; dx(1)=x(2)+12*u; dx(2)=-144*x(1)-12*x(2); end Homework 10 numerical solution 0.05 0.04 y = u - z, meters 0.03 0.02 0.01 0 -0.01 -0.02 0 0.1 0.2 0.3 0.4 0.5 time, seconds 0.6 0.7 0.8 0.9 Note, the solutions are identical. Homework 16 The differential equation for a suspension is given below. The output of interest is y = u – z where u is a displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters. 1000๐งฬ + 12,000๐งฬ + 144,000๐ง = 12,000๐ขฬ + 144,000๐ข ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 z M k b u (a) Find the Laplace transform of y(t), Y(s). 144 (b) In MATLAB, use the impulse command to get a plot of y(t). (c) Express the differential equation in state variable format. (d) Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of y(t). Compare this plot with the plot in (b) and confirm that the plots are identical. Homework 16 Solution The differential equation for a suspension is given below. The output of interest is y = u – z where u is a displacement input. Assume at time = 0, u(t) is a step with magnitude of 0.05 meters. ๐ง(0− ) = 0 1000๐งฬ + 12,000๐งฬ + 144,000๐ง = 12,000๐ขฬ + 144,000๐ข ๐งฬ (0− ) = 0 z M k b u (e) Find the Laplace transform of y(t), Y(s). 12,000๐ + 144,000 ๐(๐ )] 1000๐ 2 + 12,000๐ + 144,000 1000๐ 2 0.05 50๐ = = 2 2 1000๐ + 12,000๐ + 144,000 ๐ 1000๐ + 12,000๐ + 144,000 (f) In MATLAB, use the impulse command to get a plot of y(t). >> G=tf([50 0],[1000 12000 144000]); >> impulse(G) >> title('Homework 10 inverse Laplace of Y(s)') >> ylabel('y=u-z, meters') ๐(๐ ) = ๐(๐ ) − ๐(๐ ) = [๐(๐ ) − Homew ork 10 inverse Laplace of Y(s) 0.05 0.04 y=u-z, meters 0.03 0.02 0.01 0 -0.01 -0.02 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Time (seconds) 145 (g) Express the differential equation in state variable format. ๐ฅฬ 1 = ๐ฅ2 + 12๐ข ๐งฬ + 12๐งฬ + 144๐ง = 12๐ขฬ + 144๐ข ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ − 12๐ข ๐ฅฬ 2 = 144๐ข − 144๐ฅ1 − 12(๐ฅ2 + 12๐ข) = −144๐ฅ1 − 12๐ฅ2 ๐ฆ = ๐ข − ๐ฅ1 (h) Use ‘ode45’ in MATLAB to numerically solve this differential equation and generate a plot of y(t). Compare this plot with the plot in (b) and confirm that the plots are identical. %m-file to start the simulation saved as Hmwk10Start [t,x]=ode45(@Hmwk10Eqns,[0 0.9],[0 0]); y=0.05-x(:,1); plot(t,y) title('Homework 10 numerical solution') ylabel('y = u - z, meters') xlabel('time, seconds') %m-file containing the state variable differential equations named Hmwk10Eqns function dx=Hmwk10Eqns(t,x) dx=zeros(2,1); u=0.05; dx(1)=x(2)+12*u; dx(2)=-144*x(1)-12*x(2); end Homework 10 numerical solution 0.05 0.04 y = u - z, meters 0.03 0.02 0.01 0 -0.01 -0.02 0 0.1 0.2 0.3 0.4 0.5 time, seconds 0.6 0.7 0.8 0.9 Note, the solutions are identical. 146 Homework 17 The differential equation for a suspension is given below. The output of interest is y = u – z where u is a displacement input. 1000๐งฬ + 12,000๐งฬ + 144,000๐ง = 12,000๐ขฬ + 144,000๐ข ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 z M k b u (a) Find the transfer function for Y(s). That is, if Y(s)=H(s)U(s), what is H(s)? (b) Use the ‘phase variable’ method to express H(s) in state variable format. A=? B=? C=? D=? The phase variable method requires that the numerator polynomial be at least one less order than the denominator. (c) Create a transfer function using the ‘tf’ command for H(s). (d) Use the command ‘tf2ss’ in MATLAB to generate values of A, B, C, and D. Explain why some of these are different from those in (b). (e) Using the values found in (b) use the command ‘ss2tf’ to generate a transfer function. How does this transfer function compare with H(s) in (a)? (f) Use the ‘simulation diagram’ method to create values of A, B, C, and D for this differential equation and output of interest y=u-z. How do these values compare with those in (b) and those in (d)? Use ‘ss2tf’ with these values to generate a transfer fun. How does it compare with H(s) in (a)? Homework 17 Solution The differential equation for a suspension is given below. The output of interest is y = u – z where u is a displacement input. 1000๐งฬ + 12,000๐งฬ + 144,000๐ง = 12,000๐ขฬ + 144,000๐ข ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 147 z M k b u (a) Find the transfer function for Y(s). That is, if Y(s)=H(s)U(s), what is H(s)? 12,000๐ + 144,000 ๐(๐ )] 1000๐ 2 + 12,000๐ + 144,000 1000๐ 2 = ๐(๐ ) 1000๐ 2 + 12,000๐ + 144,000 1000๐ 2 ๐ 2 ๐ป(๐ ) = = 1000๐ 2 + 12,000๐ + 144,000 ๐ 2 + 12๐ + 144 ๐(๐ ) = ๐(๐ ) − ๐(๐ ) = [๐(๐ ) − (b) Use the ‘phase variable’ method to express H(s) in state variable format. A=? B=? C=? D=? The phase variable method requires that the numerator polynomial be at least one less order than the denominator. Using long division to divide ๐ 2 + 12๐ + 144 into ๐ 2 gives 12๐ + 144 ๐ป(๐ ) = 1 − 2 ๐ + 12๐ + 144 Thus, we can write 12๐ + 144 12๐ + 144 ๐(๐ ) = ๐ป(๐ )๐(๐ ) = [1 − 2 ๐(๐ ) ] ๐(๐ ) = ๐(๐ ) − 2 ๐ + 12๐ + 144 ๐ + 12๐ + 144 12๐ +144 all we had was Y(s)=- 2 ๐(๐ ), then the phase variable equations would be ๐ +12๐ +144 0 1 0 ๐ฬ = [ ๐ฆ = [144 12]๐ + [0]๐ข ]๐ + [ ]๐ข −144 −12 1 But, y equals u + [144 12]X. So, ๐ฆ = [144 12]๐ + [1]๐ข 0 1 0 So, ๐ด = [ ] ๐ต = [ ] ๐ถ = [144 12] ๐ท = [1] −144 −12 1 (c) Create a transfer function using the ‘tf’ command for H(s). >> H=tf([1 0 0],[1 12 144]) Transfer function: s^2 ---------------s^2 + 12 s + 144 148 (d) Use the command ‘tf2ss’ in MATLAB to generate values of A, B, C, and D. Explain why some of these are different from those in (b). >> num=[1 0 0]; >> den=[1 12 144]; >> [a,b,c,d]=tf2ss(num,den) a= -12 -144 1 0 b= 1 0 c= -12 -144 d=1 a, b, c, and d are not the same as A, B, C, D because the state variables are different. (e)Using the values found in (b) use the command ‘ss2tf’ to generate a transfer function. How does this transfer function compare with H(s) in (a)? >> [NUM,DEN]=ss2tf(a,b,c,d) NUM = 1 0 0 DEN = 1 12 144 This transfer function is identical to H(s) above which must be the case. (f) Use the ‘simulation diagram’ method to create values of A, B, C, and D for this differential equation and output of interest y=u-z. How do these values compare with those in (b) and those in (d)? ๐งฬ + 12๐งฬ + 144๐ง = 12๐ขฬ + 144๐ข ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ − 12๐ข ๐ฅฬ 1 = ๐ฅ2 + 12๐ข ๐ฅฬ 2 = 144๐ข − 144๐ฅ1 − 12(๐ฅ2 + 12๐ข) = −144๐ฅ1 − 12๐ฅ2 ๐ฆ = ๐ข − ๐ฅ1 0 1 12 ๐ด=[ ] ๐ต = [ ] ๐ถ = [−1 0] ๐ท = [1] −144 −12 0 B and C are not the same as B and C in (b) 149 A, B, and C are not the same as a, b, and c in (d) Use ‘ss2tf’ with these values to generate a transfer fun. How does it compare with H(s) in (a)? >> format short e >> A=[0 1;-144 -12]; >> B=[12;0]; >> C=[-1 0]; >> D=[1]; >> [num,den]=ss2tf(A,B,C,D) num = 1.0000e+000 -1.9540e-015 -8.8818e-015 den = 1 12 144 Realizing that two of the numerator terms are very small numbers (essentially zero) associated with computational errors, we see that we get the same transfer function. Homework 18 A cannon ball is fired at an initial angle of ๐ with an initial velocity of V=100 m/sec. The differential equations for the ball are as follows: 10๐งฬ + 0.2๐๐งฬ = 0 10๐ฆฬ + 0.2๐๐ฆฬ + 98 = 0 ๐ = √๐งฬ 2 + ๐ฆฬ 2. where the velocity of the ball V is defined by Use the 'ode45' numerical simulation algorithm in MATLAB with the 'event' function to generate plots of y versus z for initial values of ๐ equal to 25, 45, and 65 degrees. A typical plot of y v. z is shown below. All three plots for the three initial angles should be on the same graph for comparison. Assume y(0-) = 0 and use the 'event' function to stop the solution when y(t) returns to zero. Also, be sure to use the commands 'xlabel', 'ylabel', 'title', and 'legend' to make your graph more professional. y V ๏ฑ 0 Homework 18 z Solution 150 All equations, analysis, commands, results and conclusions are to either be typed on or pasted to this document as you would do in a professional report. A cannon ball is fired at an initial angle of ๐ with an initial velocity of V=100 m/sec. The differential equations for the ball are as follows: 10๐งฬ + 0.2๐๐งฬ = 0 10๐ฆฬ + 0.2๐๐ฆฬ + 98 = 0 where the velocity of the ball V is defined by ๐ = √๐งฬ 2 + ๐ฆฬ 2. Use the 'ode45' numerical simulation algorithm in MATLAB with the 'event' function to generate plots of y versus z for initial values of ๐ equal to 25, 45, and 65 degrees. A typical plot of y v. z is shown below. All three plots for the three initial angles should be on the same graph for comparison. Assume y(0-) = 0 and use the 'event' function to stop the solution when y(t) returns to zero. Also, be sure to use the commands 'xlabel', 'ylabel', 'title', and 'legend' to make your graph more professional. Cannonball Trajectory v. Firing Angle 70 25 degrees 45 degrees 65 degrees 60 50 Altitude, m 40 30 20 10 0 -10 0 20 40 60 80 Horizontal Distance, m 100 120 options=odeset('events',@HonProjStop); V=100;TH=25*pi/180; [t,x]=ode45(@HonProjEqns,[0 15],[0 V*cos(TH) 0 V*sin(TH)],options); TH=45*pi/180; [t,u]=ode45(@HonProjEqns,[0 15],[0 V*cos(TH) 0 V*sin(TH)],options); TH=65*pi/180; [t,w]=ode45(@HonProjEqns,[0 15],[0 V*cos(TH) 0 V*sin(TH)],options); plot(x(:,1),x(:,3),'r.') 151 hold plot(u(:,1),u(:,3),'bx') plot(w(:,1),w(:,3),'k-') hold off xlabel('Horizontal Distance, m') ylabel('Altitude, m') title('Cannonball Trajectory v. Firing Angle') legend('25 degrees','45 degrees','65 degrees') function dx=HonProjEqns(t,x) dx=zeros(4,1); V=sqrt(x(2)^2+x(4)^2); dx(1)=x(2); dx(2)=-0.02*V*x(2); dx(3)=x(4); dx(4)=-9.8-0.02*V*x(4); end function [Val,Ister,Dir] = HonProjStop(t,x) Val(1)=x(3); Ister(1)=1; Dir(1)=-1; end Homework 19 As shown below, two water tanks are connected by a long pipe. Initially, before the water is allowed to flow through the pipe, the height H1 of the water in tank #1 is greater than the height H2 of the water in tank #2. H1 H2 d L Q The equations for this system are as follows: Differential equation for height of water in tank #1: −๐ − 10๐ปฬ1 = 0 ๐ป1 (0− ) = 10 ๐ 152 Differential equation for height of water in tank #2: ๐ − 10๐ปฬ2 = 0 ๐ป2 (0− ) = 5 ๐ Approximate differential equation for turbulent flow ๐ (m3/s) through pipe: 9,800(๐ป1 − ๐ป2 ) = 795,625๐ฬ + 19,338๐ (1) Laplace transform these equations and solve for ๐ป1 (๐ ). Use the FVT and IVT to check ๐ป1 (๐ ). (2) Find the inverse Laplace of ๐ป1 (๐ ) to get an equation for ๐ป1 (๐ก). (3) In MATLAB, pretend that ๐ป1 (๐ ) is a transfer function with a unit impulse input. Use the command ‘impulse’ to get a plot of ๐ป1 (๐ก) and plot on the same graph ๐ป1 (๐ก) using the equation found in (2) above. Use the ‘legend’ command to confirm that the plots are identical. (4) Highlight, copy, and paste your MATLAB commands and results on this MS Word document as part of your solution to be submitted. Homework 19 Solution As shown below, two water tanks are connected by a long pipe. Initially, before the water is allowed to flow through the pipe, the height H1 of the water in tank #1 is greater than the height H2 of the water in tank #2. H1 H2 d L Q The equations for this system are as follows: Differential equation for height of water in tank #1: −๐ − 10๐ปฬ1 = 0 ๐ป1 (0− ) = 10 ๐ Differential equation for height of water in tank #2: ๐ − 10๐ปฬ2 = 0 ๐ป2 (0− ) = 5 ๐ Approximate differential equation for turbulent flow ๐ (m3/s) through pipe: 9,800(๐ป1 − ๐ป2 ) = 795,625๐ฬ + 19,338๐ (1) Laplace transform these equations and solve for ๐ป1 (๐ ). Use the FVT and IVT to check ๐ป1 (๐ ). See symbolic equations for the Laplace transform of the equations and solution for H1(s). Note, according to the problem statement: “Initially before the water is allowed to flow through the pipe”, tells us that Q(0-)=0. −๐(๐ ) − 10(๐ ๐ป1 (๐ ) − 10) = 0 ๐(๐ ) − 10(๐ ๐ป2 (๐ ) − 5) = 0 9800(๐ป1 (๐ ) − ๐ป2 (๐ )) = (795,625๐ + 19,338)๐(๐ ) Eliminating Q(s) and H2(s) and solving for H1(s) gives 10๐ 2 + 0.243055๐ + .018476 10๐ 2 + 0.243055๐ + .018476 = ๐ (๐ 2 + .0243055๐ + 0.00246348) ๐ [(๐ + 0.012153)2 + (0.048123)2 ] ๐น๐๐: ๐ป1 (๐ก)๐ก=∞ = ๐ ๐ป1 (๐ )๐ =0 = 7.5 ๐ผ๐๐: ๐ป1 (๐ก)๐ก=0 = ๐ ๐ป1 (๐ )๐ =∞ = 10 ๐ป1 (๐ ) = 153 (2) Find the inverse Laplace of ๐ป1 (๐ ) to get an equation for ๐ป1 (๐ก). ๐ −.0121153๐ก ๐ป1 (๐ก) = (๐ + 0)๐ป1 (๐ )๐ ๐ ๐ก ๐ =0 + ๐๐ ๐๐(0.048123๐ก + ∅) 0.048123 ๐ = |(๐ 2 + .0243055๐ + 0.00246348)๐ป1 (๐ )|๐ =−0.012153+๐0.048123 = 0.12409 ∅ = ๐๐๐๐๐[(๐ 2 + .0243055๐ + 0.00246348)๐ป1 (๐ )]๐ =−0.012153+๐0.048123 = 1.3235 ๐ป1 (๐ก) = 7.5 + 2.5738๐ −0.012153๐ก sin (.048123๐ก + 1.3235) (3) In MATLAB, pretend that ๐ป1 (๐ ) is a transfer function with a unit impulse input. Use the command ‘impulse’ to get a plot of ๐ป1 (๐ก) and plot on the same graph ๐ป1 (๐ก) using the equation found in (2) above. Use the ‘legend’ command to confirm that the plots are identical. (4) Highlight, copy, and paste your MATLAB commands and results on this MS Word document as part of your solution to be submitted. % Homework 3 MAE 3360 10-12-13 format short g syms s Q H1 H2 A=solve(-Q-10*(s*H1-10)==0,Q-10*(s*H2-5)==0,... 9800*(H1-H2)==795625*s*Q+19338*Q,H1,H2,Q); digits(5) h1=vpa(A.H1);%Converts H1(s) solution to floating point numbers pretty(h1) [num,den]=numden(h1);% Gets numerator and denominator of H1 Num=sym2poly(num);%Converts numerator from symbolic to polynomial Den=sym2poly(den);%converts denominator from symbolic to polynomial roots(Den)%Gets the poles of H1(s) H1Ptf=tf(Num,Den);%Creates a pretend transfer function assuming unit impulse input [H1impulse,t]=impulse(H1Ptf);%Generates impulse response and time array H1t=7.5+2.5738*exp(-0.012153*t).*sin(0.048123*t+1.3235); plot(t,H1impulse,'r',t,H1eqn,'k:','LineWidth',2) xlabel('time, sec.') ylabel('H1, m') title('Comparing analytical and numerical H1(t) solutions') legend('impulse command with pretend tf','inverse Laplace transform') Comparing analytical and numerical H1(t) solutions 10 impulse command with pretend tf inverse Laplace transform 9.5 9 H1, m 8.5 8 7.5 7 6.5 6 0 50 100 150 200 250 time, sec. 300 350 400 450 154 Homework 20 1. (a) Express the following differential equation with input u(t) in state variable format: 2๐ค โ + 24๐คฬ + 88๐คฬ + 96๐ค = 48๐ข ๐ค(0− ) = 2 (b) What is the DC gain of this differential equation? ๐คฬ (0− ) = 1 ๐คฬ (0− ) = 0 (c) What are the initial conditions for the state variables? (d) Express the state variable equations in (a) in matrix format assuming ๐ค(๐ก) is the output of interest, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข (e) Use the MATLAB command ‘eig’ to get the eigenvalues of this differential equation. (f) Enter the system found in (d) into MATLAB as a state space system and use the command ‘damp’ to get the damping ratio and natural frequency. Use the command ‘dcgain’ to confirm the answer to part (b). (g) Use the command ‘lsim’ to get a plot of the output of interest assuming u(t) is a step with magnitude 10. Note, considering your value for the DC gain and the fact that the input is a constant, what should be the final value of w(t)? (h) Find the Laplace transform ๐(๐ ) and use the ‘pretend’ transfer function concept with the ‘impulse’ command to get a plot of ๐ค(๐ก). Plot on the same graph as the answer to part (g) for comparison. Be sure to label the axes and insert a legend on the graph. 2. The equations for a vehicle suspension are shown below. The input is the displacement u(t). The output of interest is y = v – u. Express the equations for this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข 155 Homework 20 Solution 1. (a) Express the following differential equation with input u(t) in state variable format: 2๐ค โ + 24๐คฬ + 88๐คฬ + 96๐ค = 48๐ข ๐ค(0− ) = 2 ๐คฬ (0− ) = 1 ๐คฬ (0− ) = 0 ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐คฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = ๐ฅ3 ๐ฅฬ 3 = 24๐ข − 48๐ฅ1 − 44๐ฅ2 − 12๐ฅ3 (b) What is the DC gain of this differential equation? DC gain=48/96=0.5 (c) What are the initial conditions for the st. variables? ๐ฅ1 (0− ) = 2 ๐ฅ2 (0− ) = 1 ๐ฅ3 (0− ) = 0 (d) Express the state variable equations in (a) in matrix format assuming ๐ค(๐ก) is the output of interest, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ฅ1 ๐ฅ1 ๐ฅฬ 1 0 1 0 0 ๐ฅ ๐ฅ ๐ฅฬ [ ] [ 2] = [ 0 ๐ฆ = 1 0 0 [ 2 ] + [0]๐ข 0 1 ] [ 2] + [ 0 ] ๐ข ๐ฅ3 ๐ฅฬ 3 −48 −44 −12 ๐ฅ3 24 (e) Use the MATLAB command ‘eig’ to get the eigenvalues of this differential equation. Eigenvalues = -2, -4, -6 (f) Enter the system found in (d) into MATLAB as a state space system and use the command ‘damp’ to get the damping ratio and natural frequency. Use the command ‘dcgain’ to confirm the answer to part (b). DC gain =0.5 (g) Use the command ‘lsim’ to get a plot of the output of interest assuming u(t) is a step with magnitude 10. Note, considering your value for the DC gain and the fact that the input is a constant, what should be the final value of w(t)? See graph and code below. (h) Find the Laplace transform ๐(๐ ) and use the ‘pretend’ transfer function concept with the ‘impulse’ command to get a plot of ๐ค(๐ก). Plot on the same graph as the answer to part (g) for comparison. Be sure to label the axes and insert a legend on the graph. % Homework 4 Solution for ME3360 A=[0 1 0;0 0 1;-48 -44 -12]; B=[0;0;24]; C=[1 0 0]; D=[0]; EVS=eig(A) g=ss(A,B,C,D); DCgain=dcgain(g) t=0:0.01:2.5; u=10+0*t; w=lsim(g,u,t,[2;1;0]); G=tf([2 25 100 240],[1 12 44 48 0]); ws=impulse(G,t); plot(t,w,'r-.',t,ws,'k:','LineWidth',2) title('comparing lsim plot with inverse Laplace plot') xlabel('time, sec') ylabel('w') legend('using lsim','using impulse for inverse Laplace','Location','Best') >> homework4sol 156 EVS = -2 -4 -6 DCgain = 0.5 comparing lsim plot with inverse Laplace plot 5 4.5 w 4 3.5 3 2.5 using lsim using impulse for inverse Laplace 2 0 0.5 1 1.5 2 2.5 time, sec 2. The equations for a vehicle suspension are shown below. The input is the displacement u(t). The output of interest is y = v – u. Express the equations for this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข 157 ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ 0 ๐ − ๐ ๐ด= 0 ๐ [ ๐ 1 ๐ − ๐ 0 ๐ ๐ 0 ๐ ๐ 0 2๐ − ๐ 0 ๐ ๐ 1 2๐ − ] ๐ ๐ฅ4 = ๐ฃฬ − 0 ๐2 ๐๐ ๐ ๐ต= ๐ ๐ 2๐ 2 [๐ − ๐ 2 ] ๐ ๐ข ๐ ๐ถ = [0 0 1 0] ๐ท = [−1] Homework 21 The equations for a vehicle suspension are shown below. The input is the displacement u(t). The output of interest is ๐คฬ /๐ where g is gravity, 9.8 m/s2. Express the equations for this system in state variable format in terms of M, b, k, etc. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข 158 (1) Create a new m-file for this problem. The first statements are to assign values to the design ๐ ๐ ๐๐ ๐๐ parameters, i.e. ๐ = 36000 ๐ ๐พ = 100000 ๐ ๐ = 8400 ๐ ๐ = 10000 ๐ ๐ = 1000 ๐พ๐ ๐ = 250 ๐พ๐ (2) The next statements define the state variable matrices in terms of M, b, k, etc. ๐ ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ ๐ฅ4 = ๐ฃฬ − ๐ ๐ข ๐ฆ = ๐คฬ ๐ ๐ ๐ ๐ ๐ ๐๐ = − ๐๐ ๐ฅ1 − ๐๐ ๐ฅ2 + ๐๐ ๐ฅ3 + ๐๐ ๐ฅ4 + ๐๐๐ ๐ข (3) Use the ‘ss’ command to create a state space system. (4) Use the ‘damp’ command to get the eigenvalues and damping ratio(s) of the system. (5) Use the ‘dcgain’ command to get the DC gain. Does this value make sense? (6) Use the ‘step’ command to get and plot the step response of the system. (7) Use the ‘max’ command to find the maximum value of y. (8) Try a few different values for c and observe the difference in the maximum value of y. Comment on the significance of the choice of c in regard to ride comfort. Homework 21 Solution The equations for a vehicle suspension are shown below. The input is the displacement u(t). The output of interest is ๐คฬ /๐ where g is gravity, 9.8 m/s2. Express the equations for this system in state variable format in terms of M, b, k, etc. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข (1) Create a new m-file for this problem. The first statements are to assign values to the design ๐ ๐ ๐๐ ๐๐ parameters, i.e. ๐ = 36000 ๐ ๐พ = 100000 ๐ ๐ = 8400 ๐ ๐ = 10000 ๐ ๐ = 1000 ๐พ๐ ๐ = 250 ๐พ๐ See m-file below for MATLAD code. (2) The next statements define the state variable matrices in terms of M, b, k, etc. ๐ ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ ๐ฅ4 = ๐ฃฬ − ๐ ๐ข ๐ฆ = ๐คฬ ๐ ๐ ๐ ๐ ๐ ๐๐ = − ๐๐ ๐ฅ1 − ๐๐ ๐ฅ2 + ๐๐ ๐ฅ3 + ๐๐ ๐ฅ4 + ๐๐๐ ๐ข (3) Use the ‘ss’ command to create a state space system. (4) Use the ‘damp’ command to get the eigenvalues and damping ratio(s) of the system. (5) Eigenvalue Damping Frequency -2.60e+00 + 4.77e+00i 4.78e-01 5.43e+00 -2.60e+00 - 4.77e+00i 4.78e-01 5.43e+00 -6.98e+00 -6.98e+01 159 (6) Use the ‘dcgain’ command to get the DC gain. DC gain = 7.1054e-15 Does this value make sense? Yes, because the output of interest is normalized acceleration and for a constant input, the acceleration eventually goes to zero. Output = DC gain*input =0 (7) Use the ‘step’ command to get and plot the step response of the system. (8) Use the ‘max’ command to find the maximum value of y. For c=10000, the maximum acceleration is 34.286 g’s which would be totally unacceptable. This high value is caused by the ๐ขฬ in the differential equations which is an impulse if u is a step. Think about it; if you are moving forward in your car at a significant speed and hit a curb, the force would probably be great enough to knock the front axle and suspension off! For realist inputs (not pure steps), you would like to keep the peak accelerations under about 0.1 g. (9) Try a few different values for c and observe the difference in the maximum value of y. Comment on the significance of the choice of c in regard to ride comfort. See m-fle and graph. % Homework 5 MAE3360 Fall 2013 k=36000;K=100000;b=8400;c=10000;M=1000;m=250; g=9.8; A=[0 1 0 0;-k/M -b/M k/M b/M;0 0 0 1;k/m b/m -(K+k)/m -(b+c)/m]; B=[0;b*c/(m*M);c/m;K/m-(b+c)*c/m^2]; C=[-k/(M*g) -b/(M*g) k/(M*g) b/(M*g)]; D=[b*c/(M*m*g)]; Gss1=ss(A,B,C,D); damp(Gss1) DCgain=dcgain(Gss1) [y1,t]=step(Gss1,0.1);%Note, I've stopped the plot at time 0.1 sec. to get better resolution at beginning ymax=max(y1) c=7500; A=[0 1 0 0;-k/M -b/M k/M b/M;0 0 0 1;k/m b/m -(K+k)/m -(b+c)/m]; B=[0;b*c/(m*M);c/m;K/m-(b+c)*c/m^2]; C=[-k/(M*g) -b/(M*g) k/(M*g) b/(M*g)]; D=[b*c/(M*m*g)]; Gss2=ss(A,B,C,D); [y2]=step(Gss2,t);%uses the same values of t generated by previous step to avoid plotting probems with different t's c=12500; A=[0 1 0 0;-k/M -b/M k/M b/M;0 0 0 1;k/m b/m -(K+k)/m -(b+c)/m]; B=[0;b*c/(m*M);c/m;K/m-(b+c)*c/m^2]; C=[-k/(M*g) -b/(M*g) k/(M*g) b/(M*g)]; D=[b*c/(M*m*g)]; Gss3=ss(A,B,C,D); [y3]=step(Gss3,t);%uses the same values of t generated by previous step to avoid plotting probems with different t's plot(t,y2,'k',t,y1,'r-.',t,y3,'k:','LineWidth',2) title('comparing peak accelerations for various damping coefficients c for step inputs') xlabel('time, sec') ylabel('normalized acceleration w"/g') legend('c=7500 Ns/m','c=10000 Ns/m','c=12500 Ns/m','Location','Best') 160 comparing peak accelerations for various damping coefficients c for step inputs 45 40 normalized acceleration w"/g 35 30 c=7500 Ns/m c=10000 Ns/m c=12500 Ns/m 25 20 15 10 5 0 -5 0 0.01 0.02 0.03 0.04 0.05 0.06 time, sec 0.07 0.08 0.09 0.1 Homework 22 The schematic for an impact barrier for a car is shown below. Typically, these barriers are constructed of components that collapse storing and dissipating energy. For example, partially filled barrels of water; on impact, air in the barrels softens the impact by storing energy while the water being forced out of the crushed barrels dissipates energy. The objective is to stop a car with as small of a maximum deceleration as possible but yet not let the barrier totally collapse. Once a barrier totally collapses, it is equivalent to hitting an immoveable object. As shown in the schematic, the maximum this barrier can collapse is distance D. D K b Impact Barrier System The objective of this homework problem is to perform a series of ode45 simulations for different values of viscous damping b to determine a value that gives the lowest possible maximum value of deceleration without the displacement being greater than D. See section 3.6 in the notebook. Assuming that the car has just contacted the yellow bumper with initial velocity Vo, the differential equation for the forward displacement y of the car and bumper is as follows: ๐๐ฆฬ + ๐๐ฆฬ + ๐พ๐ฆ = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = ๐๐ 161 Specifically, determine the best damping coefficient b for the barrier assuming K=2000 N/m for the worse case scenario of the car mass M=1000 kg with an impact speed of Vo=24 m/s; The ๐ฆฬ maximum value of the deceleration, (๐), should not be greater than 4.0 g’s with a maximum collapse distance D = 10m . Note, use g=9.8 m/s2. (1) Formulate a state variable model for an ode45 simulation ๐ฆฬ (2) Your first simulation should generate plots of y and ๐ using b = 0. This will be one of the worst possible values but will give you insight regarding the total time needed for the simulation. Be sure to stop the simulation when ๐ฆฬ first becomes negative because this means the car and bumper have stopped moving forward and the car is bouncing back off of the bumper; the differential equation is not a valid model after this happens. (3) By trial and error, determine a value for b that meets the design specifications. Show plots of ๐ฆฬ ๐ for at least three values of b: your best value, a value greater, and a value smaller. Be sure to label and include a legend on all plots. Homework 22 Solution The schematic for an impact barrier for a car is shown below. Typically, these barriers are constructed of components that collapse storing and dissipating energy. For example, partially filled barrels of water; on impact, air in the barrels softens the impact by storing energy while the water being forced out of the crushed barrels dissipates energy. The objective is to stop a car with as small of a maximum deceleration as possible but yet not let the barrier totally collapse. Once a barrier totally collapses, it is equivalent to hitting an immoveable object. As shown in the schematic, the maximum this barrier can collapse is distance D. D K b Impact Barrier System The objective of this homework problem is to perform a series of ode45 simulations for different values of viscous damping b to determine a value that gives the lowest possible maximum value of deceleration without the displacement being greater than D. See section 3.6 in the notebook. Assuming that the car has just contacted the yellow bumper with initial velocity Vo, the differential equation for the forward displacement y of the car and bumper is as follows: ๐๐ฆฬ + ๐๐ฆฬ + ๐พ๐ฆ = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = ๐๐ 162 Specifically, determine the best damping coefficient b for the barrier assuming K=2000 N/m for the worse case scenario of the car mass M=1000 kg with an impact speed of Vo=24 m/s; The ๐ฆฬ maximum value of the deceleration, (๐), should not be greater than 4.0 g’s with a maximum collapse distance D = 10m . Note, use g=9.8 m/s2. (1) Formulate a state variable model for an ode45 simulation ๐พ๐ฅ1 ๐๐ฅ2 ๐ฅ1 = ๐ฆ ๐ฅ2 = ๐ฆฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = − − ๐ฅ1 (0− ) = 0 ๐ ๐ ๐ฅ2 (0− ) = 24 (2) Your first simulation should generate plots of y and ๐ฆฬ /๐ using b = 0. This will be one of the worst possible values but will give you insight regarding the total time needed for the simulation. Be sure to stop the simulation when ๐ฆฬ first becomes negative because this means the car and bumper have stopped moving forward and the car is bouncing back off of the bumper; the differential equation is not a valid model after this happens. %Homework 6, MAE3360 11-19-13 %Car crash barrier design global M K b D D=10;M=1000;Vo=24;K=2000;g=9.8; options=odeset('events',@Stop_3360_111913); dr=0;b=2*dr*sqrt(K*M); [t,x]=ode45(@Hmwk7Eqns_3360_111913,[0 3],[0 Vo],options); plot(t,x(:,1),'k','LineWidth',2) xlabel('time, sec.') ylabel('car displacement, m') title('barrier performance with zero damping') figure plot(t,x(:,2),'k','LineWidth',2) xlabel('time, sec.') ylabel('car velocity, m') title('barrier performance with zero damping') figure A=-K*x(:,1)/M-b*x(:,2)/M; plot(t,A,'k','LineWidth',2) xlabel('time, sec.') ylabel('car deceleration, g') title('barrier performance with zero damping') %Homework 6, MAE3360 111913 dx equations function dx=Hmwk7Eqns_3360_111913(t,x) global M K b D dx=zeros(2,1); dx(1)=x(2); dx(2)=-K*x(1)/M-b*x(2)/M; end %Homework 6 MAE3360 111913 events to stop simulation function [Val,Ister,Dir]=Stop_3360_111913(t,x) global M K b D Val(1)=x(2); Ister(1)=1; Dir(1)=-1; Val(2)=D-x(1); Ister(2)=1; Dir(2)=-1; end 163 barrier performance with zero damping 12 car displacement, m 10 8 6 4 2 0 0 0.05 0.1 0.15 0.2 0.25 time, sec. 0.3 0.35 0.4 0.45 barrier performance with zero damping 24 23.5 23 22 21.5 21 20.5 20 19.5 19 0 0.05 0.1 0.15 0.2 0.25 time, sec. 0.3 0.35 0.4 0.45 barrier performance with zero damping 0 -5 car deceleration, g car velocity, m/s 22.5 -10 -15 -20 -25 0 0.05 0.1 0.15 0.2 0.25 time, sec. 0.3 0.35 0.4 0.45 164 From these three plots above, we see that with zero damping, the car hits the end of barrier in about 0.45 sec still moving at 19.5 m/s. Also, without considering the extra impact deceleration associated with hitting the end of the barrier, the deceleration has still exceeded 20 g’s. (3) By trial and error, determine a value for b that meets the design specifications. Show plots of ๐ฆฬ ๐ for at least three values of b: your best value, a value greater, and a value smaller. Be sure to label and include a legend on all plots. %Homework 6, MAE3360 11-19-13 %Car crash barrier design clear all global M K b D D=10;M=1000;Vo=24;K=2000;g=9.8; options=odeset('events',@Stop_3360_111913); dr=0.5;b=2*dr*sqrt(K*M); [t,x5]=ode45(@Hmwk7Eqns_3360_111913,[0 2],[0 Vo],options); dr=0.45;b=2*dr*sqrt(K*M); [t,x45]=ode45(@Hmwk7Eqns_3360_111913,[t],[0 Vo],options);% Using previous time array so can plot on same graph dr=0.4;b=2*dr*sqrt(K*M); [t,x4]=ode45(@Hmwk7Eqns_3360_111913,[t],[0 Vo],options); plot(t,x4(:,1),'r',t,x45(:,1),'k:',t,x5(:,1),'r-.','LineWidth',2) xlabel('time, sec.') ylabel('car displacement, m') title('homework 6 MAE 3360 Nov. 19, 2013') legend('damping ratio =0.4','damping ratio=0.45','damping ratio=0.5','Location','Best') figure plot(t,x4(:,2),'r',t,x45(:,2),'k:',t,x5(:,2),'r-.','LineWidth',2) xlabel('time, sec.') ylabel('car velocity, m/sec') title('homework 6 MAE 3360 Nov. 19, 2013') legend('damping ratio =0.4','damping ratio=0.45','damping ratio=0.5','Location','Best') figure A4=-K*x4(:,1)/M-b*x4(:,2)/M; A45=-K*x45(:,1)/M-b*x45(:,2)/M; A5=-K*x5(:,1)/M-b*x5(:,2)/M; plot(t,A4/g,'r',t,A45/g,'k:',t,A5/g,'r-.','LineWidth',2) xlabel('time, sec.') ylabel('car deceleration, g') title('homework 6 MAE 3360 Nov. 19, 2013') legend('damping ratio =0.4','damping ratio=0.45','damping ratio=0.5','Location','Best') Examining the three graphs below, a damping ratio of 0.45 ( b=1273 Ns/m) keeps the displacement just under D and limits the deceleration to slightly under 2 g’s. 165 homework 6 MAE 3360 Nov. 19, 2013 12 car displacement, m 10 8 6 damping ratio =0.4 damping ratio=0.45 damping ratio=0.5 4 2 0 0 0.1 0.2 0.3 0.4 0.5 time, sec. 0.6 0.7 0.8 0.9 homework 6 MAE 3360 Nov. 19, 2013 25 damping ratio =0.4 damping ratio=0.45 damping ratio=0.5 car velocity, m/sec 20 15 10 5 0 -5 0 0.1 0.2 0.3 0.4 0.5 time, sec. 0.6 0.7 0.8 0.9 166 homework 6 MAE 3360 Nov. 19, 2013 -1.6 damping ratio =0.4 damping ratio=0.45 damping ratio=0.5 -1.8 car deceleration, g -2 -2.2 -2.4 -2.6 -2.8 -3 0 0.1 0.2 0.3 0.4 0.5 time, sec. 0.6 0.7 0.8 0.9 Note, using the ‘events’ function to end the simulation will cause problems if you intend to put more than one plot on a graph unless you make sure the simulation using the shortest time is run first and ‘t’ from the previous run is used in place of [start time final time]. See attached m-files. Homework 23 Two systems with the corresponding differential equations are shown below. 1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a bump defined by the surface roughness u(t). (a) What is the dependent variable? (b) What is the input variable? (3) What is the order of the differential equation? (4) How many initial conditions are required to solve the equation? What are the initial conditions? (5) Is the equation linear or nonlinear? (6) Sketch a reasonable estimate of z(t) following the bump which occurs at t = 0. 2. The second is water draining from a water tank where H is the height of the water. (1) What is the dependent variable? (2) What is the order of the differential equation? (3) Is the equation linear or nonlinear? (4) Since there is no input variable, there must be nonzero initial conditions otherwise there is no solution. What are the initial conditions? (5) Considering the initial conditions, draw a reasonable estimate of the height of the water H(t) starting at t = 0. 167 3. For systems with zero initial conditions, the ‘D’ operator can be used to convert the differential equation to an algebraic equation. Do this for the first system. Homework 23 Solution Two systems with the corresponding differential equations are shown below. 1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a bump defined by the surface roughness u(t). (a) What is the dependent variable? Z (b) What is the input variable? U (c) What is the order of the differential equation? 2 (d) How many initial conditions are required to solve the equation? 2 What are the initial conditions? ๐ง(0− ) = 0, ๐งฬ (0− ) = 0, ๐๐๐ ๐ข(0− ). (e) Is the equation linear or nonlinear? Linear (f) Sketch a reasonable estimate of z(t) following the bump which occurs at t = 0. 2. The second is water draining from a water tank where H is the height of the water. (a) What is the dependent variable? H(b) What is the order of the differential equation? 1(c) Is the equation linear or nonlinear? Linear(d) Since there is no input variable, there must be nonzero initial conditions otherwise there is no solution. What are the initial conditions?5 (e) Considering the initial conditions, draw a reasonable estimate of the height of the water H(t) starting at t = 0. 168 3. For systems with zero initial conditions, the ‘D’ operator can be used to convert the differential equation to an algebraic equation. Do this for the first system. (100๐ท2 + 1000๐ท + 10000)๐ง = (1000๐ท + 10000)๐ข Homework 24 Two systems with the corresponding differential equations are shown below. 1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a bump defined by the surface roughness u(t). (a) What is the transfer function for z? (b) What is the characteristic polynomial for this suspension system? (c) Manually factor, using the quadratic equation, the characteristic polynomial to compute the eigenvalues. (d) Use the ‘root’ command in MATLAB to get the eigenvalues. (e) Use the ‘tf’ command in MATLAB to enter the transfer function; note, MATLAB will express the answer in terms of ‘s’ instead of ‘D’. (f) Use the ‘damp’ command to get the eigenvalues of this transfer function. What is the damping ratio? What is the undamped natural frequency? What is the damped natural frequency? What is the time constant of this system? (g) After hitting a bump, how long will it take for the vibration to settle out within 1%? 169 (h) The original equations used to model this suspension consist of an equation for each component, i.e. ๐ ๐๐๐๐๐ ๐๐๐๐๐ ๐น๐ = 10000(๐ง − ๐ข) ๐๐๐๐๐๐ ๐๐๐๐๐ ๐น๐ = 1000(๐งฬ − ๐ขฬ ) ๐๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐ ๐๐๐ ๐ : 100๐งฬ + ๐น๐ + ๐น๐ = 0 Convert the 2nd and 3rd equations to algebraic equations using the ‘D’ operator. Re-write these algebraic equations in terms of ‘s’ instead of ‘D’; in symbolic math, the use of ‘D’ probably will not work for representing algebraic equations since the use of ‘D’ implies taking the derivative. Then, use the symbolic math command ‘solve’ in MATLAB to solve for z; the answer should be the transfer function times u. 2. The second is water draining from a water tank where H is the height of the water. It can be shown that the solution to this differential equation is ๐ป(๐ก) = 5๐ −0.02๐ก Create and execute an m-file with the following MATLAB commands to generate a plot of H(t). clear all t=0:1:250; H=5*exp(-0.02*t); plot(t,H,'r','LineWidth',2) title('Homework 2: Draining a water tank') xlabel('Time, sec.') ylabel('Height of water, m') Copy and paste your m-file and plot to a Word document to include with your solution to this homework assignment. 170 Homework 24 Solution Two systems with the corresponding differential equations are shown below. 1. The first is a forward moving vehicle and suspension system. At time t = 0, the wheel hits a bump defined by the surface roughness u(t). (a) What is the transfer function for z? 1000๐ + 10000 [ ] 100๐ 2 + 1000๐ + 10000 (b) What is the characteristic polynomial for this suspension system? 100๐ 2 + 1000๐ + 10000 (c) Manually factor, using the quadratic equation, the characteristic polynomial to compute the eigenvalues. ๐๐๐๐๐๐ฃ๐๐๐๐ข๐๐ = −5 ± ๐√75 = −5 ± ๐8.6603 (d) Use the ‘roots’ command in MATLAB to get the eigenvalues. >> roots([100 1000 10000]) ans = -5.0000 + 8.6603i -5.0000 - 8.6603i (e) Use the ‘tf’ command in MATLAB to enter the transfer function; note, MATLAB will express the answer in terms of ‘s’ instead of ‘D’. >> G=tf([1000 10000],[100 1000 10000]) G= 1000 s + 10000 -----------------------100 s^2 + 1000 s + 10000 Continuous-time transfer function. (f) Use the ‘damp’ command to get the eigenvalues of this transfer function. >> damp(G) Pole Damping Frequency Time Constant (rad/seconds) (seconds) -5.00e+00 + 8.66e+00i 5.00e-01 1.00e+01 2.00e-01 -5.00e+00 - 8.66e+00i 5.00e-01 1.00e+01 2.00e-01 What is the damping ratio? 0.5 What is the undamped natural frequency? 10 rad/sec. What is the damped natural frequency? 8.66 rad/sec. What is the time constant of this system? 0.2 sec (g) After hitting a bump, how long will it take for the vibration to settle out within 1%? 1 sec. (h) The original equations used to model this suspension consist of an equation for each component, i.e. ๐ ๐๐๐๐๐ ๐๐๐๐๐ ๐น๐ = 10000(๐ง − ๐ข) 171 ๐๐๐๐๐๐ ๐๐๐๐๐ ๐น๐ = 1000(๐งฬ − ๐ขฬ ) ๐๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐ ๐๐๐ ๐ : 100๐งฬ + ๐น๐ + ๐น๐ = 0 nd rd Convert the 2 and 3 equations to algebraic equations using the ‘D’ operator. Re-write these algebraic equations in terms of ‘s’ instead of ‘D’; in symbolic math, the use of ‘D’ probably will not work for representing algebraic equations since the use of ‘D’ implies taking the derivative. Then, use the symbolic math command ‘solve’ in MATLAB to solve for z; the answer should be the transfer function times u. Note, to understand what ‘collect’ and ‘pretty’ do, type just ‘H.z’. >> syms s u Fs z Fd >> H=solve(Fs==10000*(z-u),Fd==1000*s*(z-u),100*s^2*z+Fs+Fd==0,Fs,Fd,z); >> Z=collect(H.z,u); >> pretty(Z) 10(๐ +10) ๐ 2 +10๐ +100 The second system is water draining from a water tank where H is the height of the water. It can be shown that the solution to this differential equation is ๐ป(๐ก) = 5๐ −0.02๐ก Create and execute an m-file with the following MATLAB commands to generate a plot of H(t). clear all t=0:1:250; H=5*exp(-0.02*t); plot(t,H,'r','LineWidth',2) title('Homework 2: Draining a water tank') xlabel('Time, sec.') ylabel('Height of water, m') Copy and paste your m-file and plot to a Word document to include with your solution to this homework assignment. Homework 2: Draining a water tank 5 4.5 4 Height of water, m 3.5 3 2.5 2 1.5 1 0.5 0 0 50 100 150 200 250 Time, sec. 172 Homework 25 A sliding block system is shown below. A spring connects a swinging bar to the block. A force f is the input to the system. The differential equations that model the motion of this system resulting from a certain input f are also given below. (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) (k) (l) What are the unknowns? What is the order of each differential equation? Are the equations linear? Use the ‘D’ operator to convert the equations to algebraic equations. Manually solve for y by eliminating ๐. What is the transfer function for y? Repeat (e) but this time use symbolic math and the ‘solve’ command. What are the eigenvalues of this system? What are eigenvalue frequencies? Explain why this system does not have time constants. What are the ‘modes’ of this system? Use the MATLAB command ‘pfract’. Suppose the force f is a single blow with a hammer. Describe the motion of the system at each mode? Homework 25 Solution A sliding block system is shown below. A spring connects a swinging bar to the block. A force f is the input to the system. The differential equations that model the motion of this system resulting from a certain input f are also given below. (a) (b) (c) (d) What are the unknowns? ๐ฆ ๐๐๐ ๐ What is the order of each differential equation? 2 Are the equations linear? yes Use the ‘D’ operator to convert the equations to algebraic equations. (๐๐ + ๐๐๐)๐ฒ − ๐๐๐ = ๐. ๐๐ (๐๐ + ๐๐)๐ − ๐๐๐ฒ = ๐ 173 (e) Manually solve for y by eliminating ๐. ๐๐ From 2nd equations: ๐ฝ = ๐ซ๐ +๐๐ ๐ ๐๐ Into 1st equation gives: (๐ซ๐ + ๐๐๐)๐ − ๐๐ ๐ซ๐ +๐๐ ๐ = ๐. ๐๐ ๐.๐(๐ซ๐ +๐๐) Or ๐ = ๐ซ๐ +๐๐๐๐ซ๐ +๐๐๐๐ ๐ (f) What is the transfer function for y? ๐.๐(๐๐ +๐๐) ๐๐ +๐๐๐๐๐ +๐๐๐๐ (g) Repeat (e) but this time use symbolic math and the ‘solve’ command. syms s f yT H=solve((s^2+100)*y-50*T==0.1*f,(s^2+64)*T-75*y==0,T,y); A=H.y/f; pretty(A) (s2 + 64.0) 0.1 ---------------------- S4 + 164.0 s2 + 2650.0 (h) What are the eigenvalues of this system? >> roots([1 0 164 0 2650]) ans = 0.0000 +12.0759i 0.0000 -12.0759i -0.0000 + 4.2629i -0.0000 - 4.2629i (i) What are eigenvalue frequencies? 12.08 and 4.26 rad/sec (j) Explain why this system does not have time constants. The time constants are infinity since the real parts of the eigenvalues are zero. (k) What are the ‘modes’ of this system? Use the MATLAB command ‘pfract’. >> pfract([1 0 64],[1 0 164 0 2650]) Second Mode: 0.641 -----------------s^2 + 145.8 174 0.359 First Mode: ------------------------s^2 + 18.17 Note, I have removed the small terms that should be zero but aren’t because of round-off errors. (l) Suppose the force f is a single blow with a hammer. Describe the motion of the system at each mode? During the first mode, the mass and bar are moving exactly in phase. During the second mode, the movement of the mass and bar are exactly 180 degrees out of phase. The motion transitions back and forth between the modes. Homework 26 Use the Laplace transform to solve each of the following differential equations for v(t); show all of your steps in getting the solution. Note, before solving for each v(t), draw a sketch of your estimate of v(t). For each case, use the FVT and the IVT to check your V(s) before finding the inverse Laplace transform. Then, once you get each v(t), check the solution at t=0 and t=∞ to confirm your answer.s=-3+j (1) ๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 0 (2) ๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 100 (3) 2๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 0 (4) 2๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 100 ๐ฃ(0− ) = 10 ๐ฃ(0− ) = 10 ๐ฃ(0− ) = 10 ๐ฃ(0− ) = 10 ๐ฃฬ (0− ) = 0 ๐ฃฬ (0− ) = 0 ๐ฃฬ (0− ) = 0 ๐ฃฬ (0− ) = 0 Homework 26 Solution Use the Laplace transform to solve each of the following differential equations for v(t); show all of your steps in getting the solution. Note, before solving for each v(t), draw a sketch of your estimate of v(t). For each case, use the FVT and the IVT to check your V(s) before finding the inverse Laplace transform. Then, once you get each v(t), check the solution at t=0 and t=∞ to confirm your answer. Note, all of the Laplace transforms below confirm the initial and final values. Also, all of the inverse Laplace transforms confirm the initial and final values. 175 ๐ฏ(๐− ) = ๐๐ (1) ๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐ ๐(๐ ) = (2) ๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐๐๐ ๐(๐ ) = 10๐ + 120 (๐ + 2)(๐ + 10) ๐ฏ(๐− ) = ๐๐ 10๐ 2 + 120๐ + 100 ๐ (๐ + 2)(๐ + 10) ๐(๐ ) = ๐ฃ(๐ก) = 100๐ −2๐ก 20๐ −10๐ก − 8 8 ๐ฏฬ (๐− ) = ๐ ๐ฏ(๐− ) = ๐๐ (3) ๐๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐ ๐ฃ(๐ก) = ๐ฏฬ (๐− ) = ๐ ๐ฃ(๐ก) = 5 + 50๐ −2๐ก 10๐ −10๐ก − 8 8 ๐ฏฬ (๐− ) = ๐ 10๐ + 60 (๐ + 3)2 + 12 ๐ −3๐ก |10๐ + 60|๐ =−3+๐ sin (1๐ก + ๐๐๐๐๐(10๐ + 60)๐ =−3+๐ ) 1 ๐ฃ(๐ก) = 31.62๐ −3๐ก sin (๐ก + 0.32175) (4) ๐๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐๐๐ ๐ฏ(๐− ) = ๐๐ ๐(๐ ) = ๐ฃ(๐ก) = 5๐ 0๐ก ๐ฏฬ (๐− ) = ๐ 10๐ 2 + 60๐ + 50 ๐ [(๐ + 3)2 + 11 ] ๐ −3๐ก 10๐ 2 + 60๐ + 50 10๐ 2 + 60๐ + 50 + | | sin (1๐ก + ๐๐๐๐๐ ( ) ) 1 ๐ ๐ ๐ =−3+๐ ๐ =−3+๐ ๐ฃ(๐ก) = 5 + 15.811๐ −3๐ก sin (๐ก + 2.8198) Homework 27 The solutions to the following differential equations were obtained in Homework 4. For Homework 5, you are to use the MATLAB command ‘impulse’ to get plots of the solutions to the same equations. In each case, plot the analytical solution on the same graph to confirm they are identical. (1) (2) (3) (4) ๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 0 ๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 100 2๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 0 2๐ฃฬ + 12๐ฃฬ + 20๐ฃ = 100 ๐ฃ(0− ) = 10 ๐ฃฬ (0− ) = 0 ๐ฃ(0− ) = 10 ๐ฃฬ (0− ) = 0 −) ๐ฃ(0 = 10 ๐ฃฬ (0− ) = 0 ๐ฃ(0− ) = 10 ๐ฃฬ (0− ) = 0 176 Homework 27 Solution Use the Laplace transform to solve each of the following differential equations for v(t); show all of your steps in getting the solution. Note, before solving for each v(t), draw a sketch of your estimate of v(t). For each case, use the FVT and the IVT to check your V(s) before finding the inverse Laplace transform. Then, once you get each v(t), check the solution at t=0 and t=∞ to confirm your answer. Note, all of the Laplace transforms below confirm the initial and final values. Also, all of the inverse Laplace transforms confirm the initial and final values. ๐ฏ(๐− ) = ๐๐ (1) ๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐ ๐(๐ ) = ๐ฏฬ (๐− ) = ๐ 10๐ + 120 (๐ + 2)(๐ + 10) ๐ฃ(๐ก) = 100๐ −2๐ก 20๐ −10๐ก − 8 8 10 using inverse Laplace using impulse command 9 8 7 v(t) 6 5 4 3 2 1 0 0 0.5 (2) ๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐๐๐ 1 1.5 time, sec. ๐ฏ(๐− ) = ๐๐ 10๐ 2 + 120๐ + 100 ๐(๐ ) = ๐ (๐ + 2)(๐ + 10) 2 2.5 3 ๐ฏฬ (๐− ) = ๐ 50๐ −2๐ก 10๐ −10๐ก ๐ฃ(๐ก) = 5 + − 8 8 177 11 using inverse Laplace using impulse command 10 v(t) 9 8 7 6 5 0 0.5 1 2 2.5 3 ๐ฏ(๐− ) = ๐๐ ๐ฏฬ (๐− ) = ๐ 10๐ + 60 ๐(๐ ) = (๐ + 3)2 + 12 (3) ๐๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐ ๐ฃ(๐ก) = 1.5 time, sec. ๐ −3๐ก |10๐ + 60|๐ =−3+๐ sin (1๐ก + ๐๐๐๐๐(10๐ + 60)๐ =−3+๐ ) 1 ๐ฃ(๐ก) = 31.62๐ −3๐ก sin (๐ก + 0.32175) 10 using inverse Laplace using impulse command 9 8 7 v(t) 6 5 4 3 2 1 0 0 0.5 1 1.5 2 2.5 time, sec. (4) ๐๐ฏฬ + ๐๐๐ฏฬ + ๐๐๐ฏ = ๐๐๐ ๐ฏ(๐− ) = ๐๐ ๐ฏฬ (๐− ) = ๐ 10๐ 2 + 60๐ + 50 ๐(๐ ) = ๐ [(๐ + 3)2 + 11 ] 178 ๐ฃ(๐ก) = 5๐ 0๐ก + ๐ −3๐ก 10๐ 2 + 60๐ + 50 10๐ 2 + 60๐ + 50 | | sin (1๐ก + ๐๐๐๐๐ ( ) ) 1 ๐ ๐ ๐ =−3+๐ ๐ =−3+๐ ๐ฃ(๐ก) = 5 + 15.811๐ −3๐ก sin (๐ก + 0.3218) 11 using inverse Laplace using impulse command 10 v(t) 9 8 7 6 5 0 0.5 1 1.5 2 2.5 time, sec. clear all G=tf([10 120],[1 12 20]); [V,t]=impulse(G); v=100*exp(-2*t)/8-20*exp(-10*t)/8; plot(t,v,'r',t,V,'k.','LineWidth',2) xlabel('time, sec.') ylabel('v(t)') legend('using inverse Laplace','using figure clear all G=tf([10 120 100],[1 12 20 0]); [V,t]=impulse(G); v=5+50*exp(-2*t)/8-10*exp(-10*t)/8; plot(t,v,'r',t,V,'k.','LineWidth',2) xlabel('time, sec.') ylabel('v(t)') legend('using inverse Laplace','using figure clear all G=tf([10 60],[1 6 10]); [V,t]=impulse(G); v=31.62*exp(-3*t).*sin(t+0.32175); plot(t,v,'r',t,V,'k.','LineWidth',2) xlabel('time, sec.') ylabel('v(t)') legend('using inverse Laplace','using figure clear all G=tf([10 60 50],[1 6 10 0]); [V,t]=impulse(G); v=5+15.81*exp(-3*t).*sin(t+0.3218); plot(t,v,'r',t,V,'k.','LineWidth',2) xlabel('time, sec.') ylabel('v(t)') legend('using inverse Laplace','using impulse command') impulse command') impulse command') impulse command') 179 Homework 28 A pile driver is used to drive the pile shown below into the ground. This is a study to determine the significance of the pounding frequency of input force Fi on the amplitude of the force at the ground Fg. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L = 1.5e8 N/m where the pile length is L=15 m. Although a 5 or more lumped mass would be preferred for the study, for simplicity, only 3 lumped masses was used. b = 50,000 Ns/m for the viscous damping coefficient. Fi M/3 b 3K M/3 L M K b 3K AE M/3 b 3K Fg For the three-lumped mass model, it can be shown that the transfer function relating the ground force Fg to the input pounding force Fi is as follows: ๐น๐ (๐ ) = [ 1000๐ 3 + 2.7๐07๐ 2 + 2.43๐11๐ + 7.29๐14 ] ๐น (๐ ) ๐ 6 + 50๐ 5 + 4.506๐5๐ 4 + 1.08๐07๐ 3 + 4.863๐10๐ 2 + 2.43๐11๐ + 7.29๐14 ๐ Note, the total ground force will include the constant weight of the beam but we are only considering the additional force due to the pounding. (1) What is the DC gain of this transfer function? What does this mean? (2) What are the eigenvalues of this transfer function? What are the resonant frequencies of the beam (damped natural frequencies)? (3) Use the MATLAB command ‘bode’ to determine the magnitudes of this transfer function at the resonant frequencies. Which resonant frequency produces the greatest transfer function magnitude? What is this magnitude (convert it from dB)? (4) If the input force is ๐น๐ (๐ก) = 1 sin(๐1 ๐ก) ๐คโ๐๐๐ ๐1 ๐๐ ๐กโ๐ ๐๐๐ค๐๐ ๐ก ๐๐๐ ๐๐๐๐๐ก ๐๐๐๐๐ข๐๐๐๐ฆ, we know that Fg(t) will become a sine wave at the same frequency. What will be the amplitude of the Fg sine wave? 180 Homework 28 Solution A pile driver is used to drive the pile shown below into the ground. This is a study to determine the significance of the pounding frequency of input force Fi on the amplitude of the force at the ground Fg. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L = 1.5e8 N/m where the pile length is L=15 m. Although a 5 or more lumped mass would be preferred for the study, for simplicity, only 3 lumped masses was used. b = 50,000 Ns/m for the viscous damping coefficient. Fi M/3 b 3K M/3 L M K b 3K AE M/3 b 3K Fg For the three-lumped mass model, it can be shown that the transfer function relating the ground force Fg to the input pounding force Fi is as follows: ๐น๐ (๐ ) = [ 1000๐ 3 + 2.7๐07๐ 2 + 2.43๐11๐ + 7.29๐14 ] ๐น (๐ ) ๐ 6 + 50๐ 5 + 4.506๐5๐ 4 + 1.08๐07๐ 3 + 4.863๐10๐ 2 + 2.43๐11๐ + 7.29๐14 ๐ Note, the total ground force will include the constant weight of the beam but we are only considering the additional force due to the pounding. (1) What is the DC gain of this transfer function? What does this mean? DC gain = 1 This means if Fi is a constant C, then the final value of Fi will also be a constant equal to DC gain*C = C. (2) What are the eigenvalues of this transfer function? What are the resonant frequencies of the beam (damped natural frequencies)? Resonant frequencies = 134, 374, and 540 rad/sec. Pole Damping Frequency Time Constant (rad/seconds) (seconds) -9.91e-01 + 1.34e+02i -9.91e-01 - 1.34e+02i -7.77e+00 + 3.74e+02i -7.77e+00 - 3.74e+02i -1.62e+01 + 5.40e+02i -1.62e+01 - 5.40e+02i 7.42e-03 7.42e-03 2.08e-02 2.08e-02 3.00e-02 3.00e-02 1.34e+02 1.34e+02 3.74e+02 3.74e+02 5.41e+02 5.41e+02 1.01e+00 1.01e+00 1.29e-01 1.29e-01 6.16e-02 6.16e-02 181 (3) Use the MATLAB command ‘bode’ to determine the magnitudes of this transfer function at the resonant frequencies. 37.8 dB (77.6), 16.5 dB (6.7), and 0.0868 dB (1.01). Which resonant frequency produces the greatest transfer function magnitude? 134 rad/sec. What is this magnitude (convert it from dB)? The amplitude of Fg will be 77.6 times greater than the amplitude of Fi. Bode Diagram 40 System: G Frequency (rad/s): 134 Magnitude (dB): 37.8 30 20 System: G Frequency (rad/s): 374 Magnitude (dB): 16.5 Magnitude (dB) 10 0 System: G Frequency (rad/s): 535 Magnitude (dB): 0.0868 -10 -20 -30 -40 -50 -60 0 Phase (deg) -180 -360 -540 10 2 10 3 Frequency (rad/s) (4) If the input force is ๐น๐ (๐ก) = 1 sin(๐1 ๐ก) ๐คโ๐๐๐ ๐1 ๐๐ ๐กโ๐ ๐๐๐ค๐๐ ๐ก ๐๐๐ ๐๐๐๐๐ก ๐๐๐๐๐ข๐๐๐๐ฆ, we know that Fg(t) will become a sine wave at the same frequency. What will be the amplitude of the Fg sine wave? Fg(t)=77.6sin(134t+๐ฝ) Homework 29 An impact barrier for a car is shown below. The objective is to stop a car with as small of a maximum deceleration as possible but yet not let the barrier totally collapse; as shown, the maximum the barrier can collapse is distance D. The specific design process is to select a spring constant K and damping coefficient b for the barrier for the worse-case scenario of M=1000 kg car with an impact speed of Vo=24 m/s; The maximum deceleration should not exceed -4.0 g’s with a maximum collapse distance D = 10m . D K b Impact Barrier System 182 The differential equation for the displacement z of the car is given below ๐๐๐๐๐ฬ + ๐๐ฬ + ๐ฒ๐ = ๐ Assume t = 0 at the instant the car contacts the yellow bumper and at this instant, ๐(๐− ) = ๐ and ๐ฬ (๐− ) = ๐๐ ๐/๐. (a) Express the differential equation in matrix state variable format. Note, every matrix term in ๐ฉ ๐๐๐ ๐ซ will be zero since there is no input (u=0). We have two outputs-of-interest, i.e. ๐๐ = ๐ ๐๐๐ ๐๐ = ๐ฬ . ๐ฬ ? [ ๐] = [ ๐ฬ ๐ ? ๐ ? ๐๐ ] [๐ ] + [ ] ๐ ๐ ? ๐ ๐๐ ๐ ? ? ๐๐ [๐ ] = [ ] [๐ ] + [ ] ๐ ๐ ๐ ? ? ๐ (b) Assume K = 2131 N/m and b = 1139Ns/m. Use MATLAB with your state variable equations and the command ‘initial’ to get plots of ๐(๐) ๐๐๐ ๐ฬ (๐). Do these values for K and b satisfy the design specification? Note, once the barrier stops the forward motion of the car, the car will bounce back. The differential equation is not valid once the bounce back is initiated. Homework 29 Solution An impact barrier for a car is shown below. The objective is to stop a car with as small of a maximum deceleration as possible but yet not let the barrier totally collapse; as shown, the maximum the barrier can collapse is distance D. The specific design process is to select a spring constant K and damping coefficient b for the barrier for the worse-case scenario of M=1000 kg car with an impact speed of Vo=24 m/s; The maximum deceleration should not exceed -4.0 g’s with a maximum collapse distance D = 10m . D K b Impact Barrier System The differential equation for the displacement z of the car is given below ๐๐๐๐๐ฬ + ๐๐ฬ + ๐ฒ๐ = ๐ Assume t = 0 at the instant the car contacts the yellow bumper and at this instant, 183 ๐(๐− ) = ๐ and ๐ฬ (๐− ) = ๐๐ ๐/๐. (a) Express the differential equation in matrix state variable format. Note, every matrix term in ๐ฉ ๐๐๐ ๐ซ will be zero since there is no input (u=0). We have two outputs-of-interest, i.e. ๐๐ = ๐ ๐๐๐ ๐๐ = ๐ฬ . [ ๐ฬ ๐ ๐ ]=[ ๐ฬ ๐ −๐. ๐๐๐ ๐ ๐๐ [๐ ] = [−๐. ๐๐๐⁄ ๐ ๐. ๐ ๐๐ ๐ ๐ ] [๐ ] + [ ] ๐ −๐. ๐๐๐ ๐ ๐ ๐ ๐๐ ๐ −๐. ๐๐๐⁄ ] [๐๐ ] + [๐] ๐ ๐. ๐ Note, y2 has been divided by 9.8 to normalized the deceleration by gravity to get g’s. (b) Assume K = 2131 N/m and b = 1139Ns/m. Use MATLAB with your state variable equations and the command ‘initial’ to get plots of ๐(๐) ๐๐๐ ๐ฬ (๐). Do these values for K and b satisfy the design specification? Note, once the barrier stops the forward motion of the car, the car will bounce back. The differential equation is not valid once the bounce back is initiated. clear all format shortg A=[0 1;-2131/1000 -1139/1000];B=[0;0]; C=[1 0;-(2131/1000)/9.8 -(1139/1000)/9.8];D=[0;0]; G=ss(A,B,C,D); [Y,t]=initial(G,[0;24],1); plot(t,Y(:,1),'k','LineWidth',2) xlabel('time, sec.') ylabel('z, m') title('displacement of car into barrier') figure plot(t,Y(:,2),'k','LineWidth',2) xlabel('time, sec.') ylabel('deceleration, g') title('deceleration of car after hitting barrier') In the plots below, the simulation has been stopped at 1 sec since the displacement has peaked and the car starting to bounce back. Note that the maximum displacement is about 10 m and the maximum deceleration is slightly greater than 3 g’s , which are within the design specification, 184 displacement of car into barrier 12 10 z, m 8 6 4 2 0 0 0.2 0.4 0.6 0.8 1 0.8 1 time, sec. deceleration of car after hitting barrier -1.8 -2 deceleration, g -2.2 -2.4 -2.6 -2.8 -3 -3.2 0 0.2 0.4 0.6 time, sec. 185 Homework 30 An impact barrier for a car is shown below. When the car contacts the gray bumper, the yellow piston starts moving forward compressing the fluid in the cylinder due to the movement of the piston to the left. Also, the rise in pressure forces the fluid through the orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a rubber ball or balloon filled with air has been placed in the water in the cylinder to increase the compressibility of the fluid in the cylinder. y Q 10 water air The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow rate Q m3/s are as follows: ๐ฬ + (๐๐๐๐−๐ )๐ท = ๐ (๐๐ − ๐)๐ทฬ = (๐๐๐๐๐ )(๐. ๐๐๐ฬ − ๐ธ) ๐ธ = (๐. ๐๐๐๐−๐ )√|๐ท| ∗ ๐๐๐๐(๐ท) ๐(๐− ) = ๐ ๐ ๐ฬ (๐− ) = ๐๐ ๐/๐ ๐ท(๐− ) = ๐ ๐ต/๐๐ In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1 if P<0. Thus, Q can be positive or negative without calculating the square root of negative numbers. (a) What are the unknowns in these equations? (b) Define state variables and write the derivative equations for your state variables. (c) Create a MATLAB ode45 numerical simulation of these equations and plot on the same graph ๐(๐), ๐ฬ (๐), ๐๐๐ ๐ฬ (๐)/๐. The solution should not take more than 1 sec. (d) From examination of your plots, what can you conclude about the performance of this barrier system? Note, if you have any MATLAB questions regarding this assignment, please consult only with Professor Hullender. 186 Homework 30 Solution An impact barrier for a car is shown below. When the car contacts the gray bumper, the yellow piston starts moving forward compressing the fluid in the cylinder due to the movement of the piston to the left. Also, the rise in pressure forces the fluid through the orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a rubber ball or balloon filled with air has been placed in the water in the cylinder to increase the compressibility of the fluid in the cylinder. y Q 10 water air The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow rate Q m3/s are as follows: ๐ฬ + (๐๐๐๐−๐ )๐ท = ๐ (๐๐ − ๐)๐ทฬ = (๐๐๐๐๐ )(๐. ๐๐๐ฬ − ๐ธ) ๐ธ = (๐. ๐๐๐๐−๐ )√|๐ท| ∗ ๐๐๐๐(๐ท) ๐(๐− ) = ๐ ๐ ๐ฬ (๐− ) = ๐๐ ๐/๐ ๐ท(๐− ) = ๐ ๐ต/๐๐ In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1 if P<0. Thus, Q can be positive or negative without calculating the square root of negative numbers. (a) What are the unknowns in these equations? y, P, and Q (b) Define state variables and write the derivative equations for your state variables. ๐๐ = ๐ ๐๐ = ๐ฬ ๐๐ = ๐ท ๐ฬ ๐ = ๐๐ ๐ฬ ๐ = −๐๐๐๐−๐ ๐๐ ๐ธ = (๐. ๐๐๐๐−๐ )√|๐๐ | ∗ ๐๐๐๐(๐๐ ) ๐ฬ ๐ = (๐๐๐๐๐ )(๐. ๐๐๐๐ − ๐ธ)/(๐๐ − ๐๐ ) (c) Create a MATLAB ode45 numerical simulation of these equations and plot on the same graph ๐(๐), ๐ฬ (๐), ๐๐๐ ๐ฬ (๐)/๐. The solution should not take more than 1 sec. (d) From examination of your plots, what can you conclude about the performance of this barrier system? (e) Examination of the plots below reveals that the performance of the barrier would be unacceptable since the barrier completely collapses (y = 10 m) with the car still moving approximately 5 m/s. Note, however, that the maximum deceleration is close to the 5 g limit. 187 clear all format shortg options=odeset('events',@StopSim8); [t,X]=ode45(@barrier3360,[0 2],[0 24 0],options); plot(t,X(:,1),'r',t,X(:,2),'k.',t,(5e-5)*X(:,3)/9.8,'k--','LineWidth',2) xlabel('time, sec.') ylabel('outputs of interest') title('Homework 8, Crash Barrier Simulation') legend('displacement, m','velocity,m/s','deceleration/g','Location','Best') function dx=barrier3360(t,x) y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P dx=zeros(3,1); dx(1)=x(2); dx(2)=-(5e-5)*P; Q=(8.9e-4)*sqrt(abs(P))*sign(P); dx(3)=2e8*(.05*yd-Q)/(10-y); end function[Val,Ister,Dir]=StopSim8(t,x) Val(1)=x(1)-10;Ister(1)=1;Dir(1)=0;%stops simulation if y=10 Val(2)=x(2);Ister(2)=1;Dir(2)=0;%stops simulation if velocity=0 end Homework 8, Crash Barrier Simulation 25 outputs of interest 20 displacement, m velocity, m/s deceleration/g 15 10 5 0 0 0.1 0.2 0.3 0.4 0.5 time, sec. 0.6 0.7 0.8 0.9 188 Homework 31 Homework 30 pertained to the simulation of the dynamics of a car impacting a crash barrier composed of a piston and cylinder filled with water with a hole (orifice) for water to escape from the cylinder. Flow through the orifice provides energy dissipation. The solution to the equations revealed that the design of the barrier was ineffective at preventing a car from collapsing the barrier even though the peak deceleration was only slightly greater than 5 g’s. This assignment pertains to the simulation of the same barrier but this time with a series of holes staggered along the top of the cylinder as shown in the figure below. Q y a b c air water The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow rate Q m3/s are as follows: ๐ฬ + (๐๐๐๐−๐ )๐ท = ๐ (๐๐ − ๐)๐ทฬ = (๐๐๐๐๐ )(๐. ๐๐๐ฬ − ๐ธ) ๐ธ = ๐(๐. ๐๐๐๐−๐ )√|๐ท| ∗ ๐๐๐๐(๐ท) ๐(๐− ) = ๐ ๐ ๐ฬ (๐− ) = ๐๐ ๐/๐ ๐ท(๐− ) = ๐ ๐ต/๐๐ where the MATLAB equations for n, the number of holes, in relation to the hole locations a, b, and c are as follows: a=?; b=?;c=?; n=4; if y>a; n=3; if y>b; n=2; if y>c; n=1; end; end; end; Note, c < 10, b < c, and a < b. These equations should be inserted in your m-file prior to the new equation for Q. See the m-file listings on the solution to Homework 8. You are to modify your simulation equations for Homework 8 to include the staggered holes and experiment with different values of a, b, and c in an attempt to prevent y from exceeding 10 m before ๐ฬ becomes zero and without the deceleration exceeding a peak value of 5 g’s. Show a plot with ๐(๐), ๐ฬ(๐), ๐๐๐ ๐ฬ (๐)/๐ corresponding to your best design values for a, b, and c. Does your design meet the specifications? 189 Homework 31 Solution Homework 8 pertained to the simulation of the dynamics of a car impacting a crash barrier composed of a piston and cylinder filled with water with a hole (orifice) for water to escape from the cylinder. Flow through the orifice provides energy dissipation. The solution to the equations revealed that the design of the barrier was ineffective at preventing a car from collapsing the barrier even though the peak deceleration was only slightly greater than 5 g’s. This assignment pertains to the simulation of the same barrier but this time with a series of holes staggered along the top of the cylinder as shown in the figure below. Q y a b c air water The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow rate Q m3/s are as follows: ๐ฬ + (๐๐๐๐−๐ )๐ท = ๐ (๐๐ − ๐)๐ทฬ = (๐๐๐๐๐ )(๐. ๐๐๐ฬ − ๐ธ) ๐ธ = ๐(๐. ๐๐๐๐−๐ )√|๐ท| ∗ ๐๐๐๐(๐ท) ๐(๐− ) = ๐ ๐ ๐ฬ (๐− ) = ๐๐ ๐/๐ ๐ท(๐− ) = ๐ ๐ต/๐๐ where the MATLAB equations for n, the number of holes, in relation to the hole locations a, b, and c are as follows: a=?;b=?;c=?; n=4; if y>a; n=3; if y>b; n=2; if y>c; n=1; end; end; end; Note, c < 10, b < c, and a < b. These equations should be inserted in your m-file prior to the new equation for Q. See the m-file listings on the solution to Homework 8. You are to modify your simulation equations for Homework 8 to include the staggered holes and experiment with different values of a, b, and c in an attempt to prevent y from exceeding 10 m before ๐ฬ becomes zero and without the deceleration exceeding a peak value of 5 g’s. Show a plot with ๐(๐), ๐ฬ(๐), ๐๐๐ ๐ฬ (๐)/๐ corresponding to your best design values for a, b, and c. Does your design meet the specifications? The design meet specifications as shown below. clear all format shortg options=odeset('events',@StopSim8); [t,X]=ode45(@barrier9,[0 2],[0 24 0],options); plot(t,X(:,1),'r',t,X(:,2),'k.',t,(5e-5)*X(:,3)/9.8,'k--','LineWidth',2) xlabel('time, sec.') ylabel('outputs of interest') 190 title('Homework 8, Crash Barrier Simulation') legend('displacement, m','velocity, m/s','deceleration/g','Location','Best') function dx=barrier9(t,x) y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P dx=zeros(3,1); dx(1)=x(2); dx(2)=-(5e-5)*P; a=5;b=7;c=8.5; n=4; if y>a;n=3;end; if y>b;n=2;end; if y>c;n=1;end; Q=n*(2.4e-4)*sqrt(abs(P))*sign(P); dx(3)=2e8*(.05*yd-Q)/(10-y); end function[Val,Ister,Dir]=StopSim8(t,x) Val(1)=x(1)-10;Ister(1)=1;Dir(1)=0;%stops simulation if y=10 Val(2)=x(2);Ister(2)=1;Dir(2)=0;%stops simulation if velocity=0 end Homework 8, Crash Barrier Simulation 25 outputs of interest 20 displacement, m velocity, m/s deceleration/g 15 10 5 0 0 0.5 1 time, sec. 1.5 2 191 Homework 32 Roll control of an airplane is achieved by moving the ailerons. The simulation diagram for the roll control of an airplane is shown below where ∅ is the roll angle of the airplane and ∅๐ is the desired roll angle. The input to the hydraulic actuator is u(t); the actuator adjusts the aileron angle ๐ฝ which causes the plane to roll. A control engineer has designed the controller Gc(s) to improve the speed and damping of the roll response following a roll angle input command from the pilot. ๐. ๐๐๐๐๐๐ + ๐. ๐๐๐ + ๐ ๐ฎ๐ (๐) = ๐. ๐๐๐๐๐๐ + ๐. ๐๐๐ + ๐ Create a Simulink diagram of this roll control system. We would like to generate plots (on the same graph) of ∅(๐) with and without the controller; without the controller means Gc(s) = 1. The desired roll angle is a step input of 5 degrees. Also generate plots of ๐ฝ(๐) with and without the controller. Do you think the control engineer has done a good job of designing Gc(s)? What is the maximum aileron angle with and without the controller? Is the maximum aileron angle with the controller realistic? 192 Homework 32 Solution Do you think the control engineer has done a good job of designing Gc(s)? The roll of the airplane is lightly damped without the controller; with the controller, the overshoot and settling time to the desired roll angle are reduced significantly. What is the maximum aileron angle with and without the controller? About 53 degrees which is too big. Is the maximum aileron angle with the controller realistic? Unlikely. >> >> >> >> >> >> >> >> >> >> >> plot(y(:,3),y(:,2),'r--',y(:,3),y(:,5),'k','Linewidth',2) title('Homework 32 - airplane roll control') ylabel('roll angle, \phi degrees') xlabel('time, sec.') legend('PID controller','unity gain controller','Location','Best') figure plot(y(:,3),y(:,1),'r--',y(:,3),y(:,4),'k','Linewidth',2) title('Homework 32 - airplane roll control') ylabel('aileron angle, \theta degrees') xlabel('time, sec.') legend('PID controller','unity gain controller','Location','Best') 193 Homework 32 - airplane roll control 9 8 7 roll angle, ๏ฑ degrees 6 5 4 3 PID controller unity gain controller 2 1 0 0 0.5 1 1.5 time, sec. 2 2.5 3 Homework 32 - airplane roll control 60 50 40 aileron angle, ๏ฆ degrees PID controller unity gain controller 30 20 10 0 -10 -20 -30 0 0.5 1 1.5 time, sec. 2 2.5 3 194 Homework 33 1. Express the following polynomials in factored format. In each case, check your work by multiplying the factored components to determine if they give the correct original polynomial. For example 2๐ท2 + 10๐ท + 12 in factored format is 2(๐ท + 2)(๐ท + 3). Checking: 2(๐ท + 2)(๐ท + 3) = 2(๐ท2 + 2๐ท + 3๐ท + 2 ∗ 3) = 2๐ท2 + 10๐ท + 12 which checks. Also, in each case: What are the roots? Are the roots real or complex. factored format roots real or complex (a) ๐ท 2 + 7๐ท + 10 ______________ _____ ___________ (b) 3๐ท 2 + 21๐ท + 30 ______________ _____ ___________ (c) ๐ 2 + 6๐ + 25 ______________ _____ ___________ (d) 2๐ 2 + 12๐ + 50 ______________ _____ ___________ (e) (๐ + 3)2 + 42 ______________ _____ ___________ 2. Assume that a polynomial has been factored and some of the roots have been found to be the following complex pair: −2 ± ๐4. (a) (b) (c) (d) What is the time constant associated with this complex pair? ________________ What is the damped natural frequency associated with this complex pair? ______ What is the undamped natural frequency associated with this complex pair? _____ What is the damping ratio associated with this complex pair? ___________ 3. Use a calculator or computer to find the roots of the following polynomial. Determine time constants, damping ratios, undamped natural frequencies, and damped natural frequencies. 2๐ 5 + 58๐ 4 + 736๐ 3 + 4720๐ 2 + 15200๐ + 20000 Roots: _____________________________________________________________ Time Constants: _____________________________________________ Undamped natural frequencies: ___________________________________________ Damped natural frequencies: ___________________________________________ Homework 33 Solution 1. Express the following polynomials in factored format. In each case, check your work by multiplying the factored components to determine if they give the correct original polynomial. For example 2๐ท2 + 10๐ท + 12 in factored format is 2(๐ท + 2)(๐ท + 3). 195 Checking: 2(๐ท + 2)(๐ท + 3) = 2(๐ท2 + 2๐ท + 3๐ท + 2 ∗ 3) = 2๐ท2 + 10๐ท + 12 which checks. Also, in each case: What are the roots? Are the roots real or complex. factored format roots real or complex (a) ๐ท2 + 7๐ท + 10 (๐ท + 2)(๐ท + 5) -2, -5 both are real (b) 3๐ท2 + 21๐ท + 30 3(๐ท + 2)(๐ท + 5) -2, -5 both are real (c) ๐ 2 + 6๐ + 25 (s+3+j4)(s+3-j4) −3 ± ๐4 complex pair (d) 2๐ 2 + 12๐ + 50 2(s+3+j4)(s+3-j4) −3 ± ๐4 complex pair (e) (๐ + 3)2 + 42 (s+3+j4)(s+3-j4) −3 ± ๐4 complex pair 2. Assume that a polynomial has been factored and some of the roots have been found to be the following complex pair: −2 ± ๐4. (e) (f) (g) (h) What is the time constant associated with this complex pair? 0.5 sec. What is the damped natural freq. associated with this complex pair? 4 rad/sec What is the undamped natural freq. associated with this complex pair? √20 = 4.472 What is the damping ratio associated with this complex pair? 0.4472 3. Use a calculator or computer to find the roots of the following polynomial. Determine time constants, damping ratios, undamped natural frequencies, and damped natural frequencies. 2๐ 5 + 58๐ 4 + 736๐ 3 + 4720๐ 2 + 15200๐ + 20000 Roots: −8 ± ๐6, − 5, − 4 ± ๐2 Time Constants: 0.125 sec. 0.2 sec. 0.25 sec. Undamped natural frequencies: 10 rad/sec 4.472 rad/sec Damped natural frequencies: 6 rad/sec 2 rad/sec Homework 34 Exercise to learn some MATLAB basics There is a difference in lower case and upper case letters. All commands are lower case. Type help 'command name' to understand how to use a particular command. Note, for some reason in the help write ups, the command names are shown with upper case letters. For example, you can have MATLAB format numbers in many ways. To see the possibilities: >> help format format SHORT Scaled fixed point format with 5 digits. format LONG Scaled fixed point format with 15 digits for double and 7 digits for single. format SHORTE Floating point format with 5 digits. format LONGE Floating point format with 15 digits for double and 7 digits for single. format SHORTG Best of fixed or floating point format with 5 digits. 196 format LONGG Best of fixed or floating point format with 15 digits for double and 7 digits for single. format SHORTENG Engineering format that has at least 5 digits and a power that is a multiple of three format LONGENG Engineering format that has exactly 16 significant digits and a power that is a multiple of three. Type: >> format shortg (What I recommend in general) Enter different values for the variable ‘a’ and observe how MATLAB displays the number for different formats: >> a=123456 >> a=123456789123456789 2. Enter a polynomial. For example: 8๐ 3 + 3๐ 2 + 12๐ + 16 >> n=[8 3 12 16]; Without the ‘; ‘ at the end, the result will echo back. Leave off the ; and see what happens. 3. Find the roots of a polynomial. >> roots(n) If you want use the roots or have access to them, >> [R]=roots(n) R(1) will be the first root, R(2) will be the 2nd root, etc. 4. Multiply two polynomials using the command ‘conv’: (2s+3)(s+4) = 2s2 +11s + 12 >> n1=[2 3]; >> n2=[1 4]; >> conv(n1,n2) 5. Enter the ratio of two polynomials such as a transfer function. For example: 8๐ 3 +3๐ 2 +12๐ +16 ๐บ(๐ ) = ๐ 4 +22๐ 3 +164๐ 2 +488๐ +480 (note, the numerator is from part 2 above) >> d=[1 22 164 488 480]; >> G=tf(n,d) 6. We can also enter a transfer function if the numerator and denominator are factored: (๐ + 2)(๐ + 3) ๐ป = 4.078 (๐ + 5)(๐ + 6 + ๐7)(๐ + 6 − ๐7) The numerator roots are called ‘zeros’: -2 and -3 The denominator roots are called ‘poles’: - 5 and -6 - j7 and -6 + j7 The number 4.078 in front is called the gain. >>H=zpk([-2 -3],[-5 -6 – j*7 -6 +j*7],4.078) Note, we can change the format to the polynomial format using ‘tf’: >>H=tf(H) 7. We know that the denominator of a transfer function is called the characteristic polynomial and its roots are the eigenvalues. The eigenvalues give us damping ratios and natural frequencies. 197 >> damp(H) This command gives us the eigenvalues for a transfer function. 8. Suppose you have several commands that may need to be repeated more than once and you don’t want to have to keep typing them over and over; this can be done by creating an M-file. To create a new M-file with a series of commands, under the ‘home’ tab and then ‘new’ tab, select ‘script’; if the series of commands require inputs and outputs, select ‘function’. Type in the commands and save it with a name and location you can find. You will probably need to change the path to this location so MATLAB can find it; use ‘set path’ under the ‘home’ tab. Note, when creating an M-file, it is wise to add comment statements to help you remember the purpose of the M-file and how to use it. The % notes the beginning of a comment. Also, comments at the beginning will be displayed following the command help ‘name of M-file’. Sample M-file: Suppose we want an M-file to plot y = 2sin(๐t) and x = 2sin(๐t+0.75) for 0≤ ๐ก ≤ 8 every 0.1 sec. %The following M-file is to be saved with the name ‘plot demo’ % plotting sine functions y = 2sin(๐ t) and x = 2sin(๐ t +0.75) for 0≤t≤8 every 0.1 sec t=0:0.1:8; %Generates values of t from 0 to 8 every 0.1 sec. y=2*sin(pi*t); %Generates a value for y for each value of t. x=2*sin(pi*t+0.75); % Generates a value for x for each value of t. % >> help plot to see possible data patterns and colors plot(t,y,'r',t,x,'k-.','Linewidth',2) %Plots y and x on the same plot as a functions of time %Avoid using blue; black and red copy best for black and white only copies. title('plot demo for two functions') xlabel('time,sec.') ylabel('sine functions y and ') legend('y(t)','x(t)','Location','Best') %Type ‘help legend’ to see the options You need to save this file under the name ‘plot_demos’ To execute this M-file, >> plot_demos in the command window. 9. Now let's create an M-file to solve simultaneous symbolic algebraic equations. Suppose we have the following equations in terms of the symbolic letter ‘a’ and we want to get the solution for x in terms of ‘a’ and then get the solution for x after assigning a value to ‘a’ corresponding to the input variable ‘A’. 2๐ฅ + ๐๐ฆ = 4 −3๐ฅ + 5๐ฆ = 2 Under ‘new’ select New Function % Symbolic math demo % Using symbolic math to solve simultaneous equations function [X]=SolveSymEqns(A) syms a y x % declare a to be symbolic so we can substitute a value for it H=solve(2*x+a*y==4,-3*x+5*y==2,x,y); x=H.x % this gives the symbolic solution for x x=subs(H.x,a,A) % this substitutes the input value A for a digits(5) % this specifies the number of floating point digits to be displayed 198 X=vpa(x) % this displays x as a floating point number end % this designates the end of the function To execute this M-file for A=4 type the following in the command window: >> SolveSymEqns; 10. Using your calculator, find the magnitude and phase angle of Z below; also do it using MATLAB to check your answers: (๐ + 2)(๐ + 10) ๐ = [0.1 2 ] (๐ + 4๐ + 16) ๐ =−3+๐5 >> s=-3+j*5; >> Z=0.1*(s+2)*(s+10)/(s^2+4*s+16); >> MagZ=abs(Z) >> AngleZ=angle(Z) Homework 34 Solution 8. %The following M-file is to be saved with the name ‘plot demo’ % plotting sine functions y = 2sin(?t) and x = 2sin(?t +0.75) for 0?t?8 every 0.1 sec t=0:0.1:8; %Generates values of t from 0 to 8 every 0.1 sec. y=2*sin(pi*t); %Generates a value for y for each value of t. x=2*sin(pi*t+0.75); % the same function shifted in phase plot(t,y,'r',t,x,'k-.','Linewidth',2) %Plots y and x on the same plot as a functions of time %Avoid using blue; black and red copy best. title('plot demo for two functions') xlabel('time,sec.') ylabel('sine functions') legend('y(t)','x(t)','Location','Best') %Type ‘help legend’ to see the options You need to save this file under the name ‘plot_demos’ To execute this M-file, >> plot_demos in the command window. 199 plot demo for two functions 2 1.5 1 sine functions 0.5 y(t) x(t) 0 -0.5 -1 -1.5 -2 0 1 2 3 4 time,sec. 5 6 7 8 9. % Symbolic math demo % Using symbolic math to solve simultaneous equations function [X]=SolveSymEqns(A) syms a x y% declare a to be symbolic so we can substitute a value for it H=solve(2*x+a*y==4,-3*x+5*y==2,x,y); x=H.x x=subs(H.x,a,A) digits(5) X=vpa(x) end % this designates the end of the function To execute this M-file for A=4 type the following in the command window: >> SolveSymEqns(4); % assigns A=4 to be used in the M-file x = -(2*(a - 10))/(3*a + 10) x = 6/11 X = 0.54545 ans = 0.54545 10. Using your calculator, find the magnitude and phase angle of Z below; also do it using MATLAB to check your answers: (๐ + 2)(๐ + 10) ๐ = [0.1 2 ] (๐ + 4๐ + 16) ๐ =−3+๐5 Using calculator: ๐ = 0.1 |−1+๐5|๐ ๐๐๐๐๐๐(−1+๐5) |7+๐5|๐ ๐๐๐๐๐๐(7+๐5) 2 |(−3+๐5)2 +4(−3+๐5)+16|๐ ๐๐๐๐๐๐((−3+๐5) +4(−3+๐5)+16) = 0.1 |−1 + ๐5|๐ ๐๐๐๐๐(−1+๐5) |7 + ๐5|๐ ๐๐๐๐๐(7+๐5) |−12 − ๐10|๐ ๐๐๐๐๐๐(−12−๐10) 5.099๐ ๐1.7682 8.6023๐ ๐0.62025 0.1 15.62๐ −๐2.4469 200 = 0.1 5.099 ∗ 8.6023 ๐(1.7682+0.62025+2.4469) ๐ 15.62 = 0.28081๐ ๐4.8354 = 0.28081๐ −๐1.4479 Using MATLAB: >> s= -3+j*5; >> Z=0.1*(s+2)*(s+10)/(s^2+4*s+16); >> MagZ=abs(Z) >> AngleZ=angle(Z) MagZ = 0.28081 AngleZ = -1.4479 Homework 35 1. Obtain a linear approximation for the following differential equation by first finding a straight line approximation for y3. Hint: y(t) will eventually become constant at which time ๐ฆฬ ๐๐๐ ๐ฆฬ will be zero; solve the equation for the final value of y(t). The straight line approximation needs to pass through the initial and final values of y. ๐ฆฬ + 2๐ฆฬ + 3๐ฆ 3 = 24 ๐ฆ(0− ) = 1 ๐ฆฬ (0− ) = 0 2. Consider the following differential equation for y with input u. 3๐ฆโ + 36๐ฆฬ + 183๐ฆฬ + 246๐ฆ = 6๐ขฬ + 54๐ขฬ + 1476๐ข (a) What is the transfer function? (b) What are the eigenvalues? (c) What is the damping ratio? (d) What is the damped natural frequency? (e) What are the time constants? (f) It can be shown that if u(t) is a constant, then y(t) will eventually become a constant. Approximately how long will take for y(t) to be within 1% of its final value? Homework 35 Solution 1. Obtain a linear approximation for the following differential equation by first finding a straight line approximation for y3. Hint: y(t) will eventually become constant at which time ๐ฆฬ ๐๐๐ ๐ฆฬ will be zero; solve the equation for the final value of y(t). The straight line approximation needs to pass through the initial and final values of y. 201 ๐ฆฬ + 2๐ฆฬ + 3๐ฆ 3 = 24 ๐ฆ(0− ) = 1 ๐ฆฬ (0− ) = 0 Setting derivatives of y to zero to get the final value gives: 0 + 0+3y3=24. Final value of y = 2. So, we need the equation for a line that passes through (y,y3)=(1,1) and (2,8). ๐ฆ 3 ≈ 7๐ฆ − 6. Thus, ๐ฆฬ + 2๐ฆฬ + 3(7๐ฆ − 6) = 24 or ๐ฆฬ + 2๐ฆฬ + 21๐ฆ = 42 2. Consider the following differential equation for y with input u. 3๐ฆโ + 36๐ฆฬ + 183๐ฆฬ + 246๐ฆ = 6๐ขฬ + 54๐ขฬ + 1476๐ข (a) What is the transfer function? 6๐ 2 +54๐ +1476 3๐ 3 +36๐ 2 +183๐ +246 (b) What are the eigenvalues? -2, -5+j4, -5-j4 (c) What is the damping ratio? 0.781 (d) What is the damped natural frequency?4 rad/sec (e) What are the time constants? 0.5 and 0.2 sec (f) It can be shown that if u(t) is a constant, then y(t) will eventually become a constant. Approximately how long will take for y(t) to be within 1% of its final value? 5x0.5 = 2.5 sec Homework 36 Consider the following three lumped mass approximation model for a pile being driven into the ground with input force F(t); the output of interest is the force f(t) exerted on the ground resulting from the input force F(t). F(t) F(t) M k z b v M k b M w b k f m=10 kg b=5 Ns/m k=1000 N/m f It can be shown that the equations representing this model for displacements z, v, and w defined to be zero at equilibrium and assuming zero displacement at the bottom end of the pile are as shown below. The ground force ๐ is the force that forces the bottom end of the pile into the ground. The output of interest to us is the ground force. ๐๐งฬ + ๐๐งฬ + ๐๐ง = ๐๐ฃฬ + ๐๐ฃ + ๐น 202 ๐๐ฃฬ + 2๐๐ฃฬ + 2๐๐ฃ = ๐๐งฬ + ๐๐ง + ๐๐คฬ + ๐๐ค ๐๐คฬ + 2๐๐คฬ + 2๐๐ค = ๐๐ฃฬ + ๐๐ฃ ๐ = 3๐๐ + ๐๐คฬ + ๐๐ค A symbolic math M-file is shown in the notebook for obtaining the transfer function relating the output to the input. (a) Type or paste this M-file into your computer and demonstrate you can get this transfer function; use ‘s’ instead of ‘d’. Be prepared to explain (for instance on an exam) the purpose of each of the command lines in the M-file. The transfer function H(s) relating the ground force f to the input force F is shown below. Did you M-file give the same result? ๐(๐ ) = ๐ป(๐ )๐น(๐ ) 6.25๐ 3 + 3750๐ 2 + 750,000๐ + 50,000,000 ๐ป(๐ ) = 50๐ 6 + 125๐ 5 + 25,088๐ 4 + 30,011๐ 3 + 3,004,000๐ 2 + 750,000๐ + 50,000,000 (b) Suppose the input F(t) is a step with magnitude Fo. Use the final value theorem to compute the final value of the ground force (note we are neglecting the weight 3Mg of the beam). Explain why this value makes sense. (c) An important property of a transfer function is its ‘DC gain’ where ๐ท๐ถ ๐๐๐๐ = ๐๐๐๐๐ ๐ฃ๐๐๐ข๐ ๐๐ ๐๐ข๐ก๐๐ข๐ก ๐๐๐๐๐๐ก๐ข๐๐ ๐๐ ๐ ๐๐๐๐ ๐ก๐๐๐ก ๐๐๐๐ข๐ก The DC gain can be computed by setting s in a transfer function to zero. What is the DC gain of H(s) above? The MATLAB command is dcgain(H). Enter this transfer function H into MATLAB and use the ‘dcgain’ command. What is the answer? Does it make sense? Why? (d) We know that the partial fractions of a transfer function are called the ‘modes’ of the transfer function or the modes of the system. The sum of the mode responses makeup the total system response. Use the MATLAB command ‘pfract’ to get the modes of this system. What are the time constants, damping ratios, and frequencies of the different modes? If the input F(t) is an impulse, which mode will be the most important? Why? (e) Enter each mode as a separate transfer function into MATLAB: H1(s), H2(s), and H3(s). Use the ‘impulse’ command to compare the impulse response of the modes, i.e. >> impulse(H,’r’,H1,’k--‘,H2,’r*’,H3,’k-.’,5) % The ‘5’ limits the time to 5 sec >> legend(‘all 3 modes together’,’first mode’,’second mode’,third mode’,’Location’,’Best’) (f) Which mode response most closely resembles the total system response? Why? Homework 36 Solution Homework 37 In each case below, check your Laplace transform and final equation for y(t) using the initial and final value theorems and calculating y(t)t=0 and ๐ฆ(๐ก)๐ก=∞ . 203 1. Use the residue method to solve the following differential equation for y(t). ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 10 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 10 2. Use the residue method to solve the following differential equation for y(t). ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 20๐ข + 14๐ขฬ ๐ฆ(0− ) = 10 ๐ฆฬ (0− ) = 0 u(t) 0.5 0 3. ๐(๐ ) = t 25 ๐ (๐ 2 +6๐ +25) Solve for y(t) Homework 37 Solution In each case below, check your Laplace transform and final equation for y(t) using the initial and final value theorems and calculating y(t)t=0 and ๐ฆ(๐ก)๐ก=∞ . 1. Use the residue method to solve the following differential equation for y(t). ๐ฆฬ (0− ) = 10 10 ๐ 2 ๐ − 10 + 7๐ ๐ + 10๐ = ๐ 10 + 10๐ ๐(๐ ) = ๐น๐๐: ๐ฆ(∞) = 1 ๐ผ๐๐: ๐ฆ(0+ ) = 0 ๐ (๐ + 2)(๐ + 5) ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 10 ๐ฆ(0− ) = 0 ๐ฆ(๐ก) = 1 + 1.666๐ −2๐ก − 2.666๐ −5๐ก ๐ฆ(๐ก)๐ก=∞ = 1 + 0 + 0 = 1 ๐ฆ(๐ก)๐ก=0 = 1 + 1.666 − 2.666 = 0 2. Use the residue method to solve the following differential equation for y(t). ๐ฆ(0− ) = 10 ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 20๐ข + 14๐ขฬ ๐ฆฬ (0− ) = 0 u(t) 0.5 0 t ๐ 2 ๐ − 10๐ + 7(๐ ๐ − 10) + 10๐ = (14๐ + 20) 0.5 ๐ 10๐ 2 + 77๐ + 10 ๐น๐๐: 1 ๐ผ๐๐: 10 ๐ (๐ + 5)(๐ + 2) ๐ฆ(๐ก) = 1 + 17.333๐ −2๐ก − 8.333๐ −5๐ก ๐ฆ(∞) = 1 ๐ฆ(0) = 1 + 17.333 − 8.333 = 10 ๐(๐ ) = 204 3. FVT: ๐(๐ ) = 25 ๐ (๐ 2 +6๐ +25) Solve for y(t). ๐ผ๐๐: ๐ฆ(0+ ) = 0 ๐ฆ(∞) = 1 ๐ฆ(๐ก) = 1๐ 0๐ก + ๐ −3๐ก 25 25 )) | | sin (4๐ก + ๐๐๐๐๐ ( 4 −3 + ๐4 −3 + ๐4 ๐ฆ(๐ก) = 1 + 1.25๐ −3๐ก sin(4๐ก − 2.2143) ๐ฆ(∞) = 1 + 0 = 1 ๐ฆ(0) = 1 + 1.25 sin(−2.2143) = 0 Homework 38 The purpose of this assignment is to demonstrate the power of being able to generate a plot of an inverse Laplace transform without having to first generate the equation for the inverse Laplace; this is done by pretending that the Laplace transform is a transfer function with a unit impulse input. We can do this because the Laplace transform of a unit impulse is 1. In Homework 37, for each problem below, you found the equation for Y(s) and then found y(t) using the inverse Laplace transform. In this assignment, you are to use the MATLAB command ‘impulse’ to get a plot of y(t) without having to first get the equation for y(t) as you did in Homework 37. For each problem below, generate two plots for y(t) for comparison on a single graph, one plot using the equation for y(t) and the other plot generated using the ‘impulse’ command. 1. ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 10 ๐ฆ(0− ) = 0 ๐(๐ ) = 10 + 10๐ ๐ (๐ + 2)(๐ + 5) ๐ฆฬ (0− ) = 10 ๐ฆ(๐ก) = 1 + 1.666๐ −2๐ก − 2.666๐ −5๐ก ๐ฆ(0− ) = 10 2. ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 20๐ข + 14๐ขฬ ๐ฆฬ (0− ) = 0 u(t) 0.5 0 t ๐(๐ ) = 10๐ 2 + 77๐ + 10 ๐ (๐ + 5)(๐ + 2) ๐ฆ(๐ก) = 1 + 17.333๐ −2๐ก − 8.333๐ −5๐ก 205 3. ๐(๐ ) = 25 ๐ (๐ 2 +6๐ +25) ๐ฆ(๐ก) = 1 + 1.25๐ −3๐ก sin(4๐ก − 2.2143) Homework 38 Solution The purpose of this assignment is to demonstrate the power of being able to generate a plot of an inverse Laplace transform without having to first generate the equation for the inverse Laplace; this is done by pretending that the Laplace transform is a transfer function with a unit impulse input. We can do this because the Laplace transform of a unit impulse is 1. In Homework 37, for each problem below, you found the equation for Y(s) and then found y(t) using the inverse Laplace transform. In this assignment, you are to use the MATLAB command ‘impulse’ to get a plot of y(t) without having to first get the equation for y(t) as you did in Homework 37. For each problem below, generate two plots for y(t) for comparison on a single graph, one plot using the equation for y(t) and the other plot generated using the ‘impulse’ command. 1. ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 10 ๐ฆ(0− ) = 0 ๐(๐ ) = 10 + 10๐ ๐ (๐ + 2)(๐ + 5) ๐ฆฬ (0− ) = 10 ๐ฆ(๐ก) = 1 + 1.666๐ −2๐ก − 2.666๐ −5๐ก 206 Homework 7.1 1.4 using impulse using inverse Laplace 1.2 1 y 0.8 0.6 0.4 0.2 0 0 0.5 1 1.5 2 2.5 time, sec ๐ฆ(0− ) = 10 2. ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 20๐ข + 14๐ขฬ 3 3.5 4 4.5 ๐ฆฬ (0− ) = 0 u(t) 0.5 0 t ๐(๐ ) = 10๐ 2 + 77๐ + 10 ๐ (๐ + 5)(๐ + 2) ๐ฆ(๐ก) = 1 + 17.333๐ −2๐ก − 8.333๐ −5๐ก 207 Homework 7.2 11 using impulse using inverse Laplace 10 9 8 y 7 6 5 4 3 2 1 3. 0 0.5 ๐(๐ ) = 1 1.5 2 2.5 time, sec 3 3.5 4 4.5 25 ๐ (๐ 2 +6๐ +25) ๐ฆ(๐ก) = 1 + 1.25๐ −3๐ก sin(4๐ก − 2.2143) Homework 7.3 1.4 using impulse using inverse Laplace 1.2 1 y 0.8 0.6 0.4 0.2 0 0 0.2 0.4 0.6 0.8 1 time, sec 1.2 1.4 1.6 1.8 Y1=tf([10 10],[1 7 10 0]); 208 [y1i,t]=impulse(Y1); y1=1+1.666*exp(-2*t)-2.666*exp(-5*t); plot(t,y1i,'r',t,y1,'k.','Linewidth',2) xlabel('time, sec') ylabel('y') legend('using impulse','using inverse Laplace') title('Homework 7.1') figure clear t Y2=tf([10 77 10],[1 7 10 0]); [y2i,t]=impulse(Y2); y2=1+17.333*exp(-2*t)-8.333*exp(-5*t); plot(t,y2i,'r',t,y2,'k.','Linewidth',2) xlabel('time, sec') ylabel('y') legend('using impulse','using inverse Laplace') title('Homework 7.2') figure clear t Y3=tf(25,[1 6 25 0]); [y3i,t]=impulse(Y3); y3=1+1.25*exp(-3*t).*sin(4*t-2.2143); plot(t,y3i,'r',t,y3,'k.','Linewidth',2) xlabel('time, sec') ylabel('y') legend('using impulse','using inverse Laplace') title('Homework 7.3') Homework 39 The schematic for a vehicle suspension is shown below. The differential equation for the upward displacement y of the vehicle mass in terms of the road profile u is also shown below. The frequency ๐ of the road profile is a function of the vehicle speed. (a) Solve the differential equation for y(t) using Laplace transforms for ๐ = 10 ๐๐๐/๐ . 209 (b) Show that the equation for y(t) as ๐ก → ∞ is a sine function. What is the amplitude of the y(t) sine function? How much larger or smaller is this amplitude compared to the amplitude of the road sine function? (c) Using MATLAB, plot y(t) and show that y(t) does eventually become a constant amplitude sine function. Confirm from your plot that the amplitude in (b) is correct. (d) Use the MATLAB command ‘bode’ to generate the frequency response of the transfer function for this suspension and confirm that the amplitude at ๐ = 10 ๐๐๐/๐ is correct. Homework 39 Solution The schematic for a vehicle suspension is shown below. The differential equation for the upward displacement y of the vehicle mass in terms of the road profile u is also shown below. The frequency ๐ of the road profile is a function of the vehicle speed. (a) Solve the differential equation for y(t) using Laplace transforms for ๐ = 10 ๐๐๐/๐ . Since we are interested in the steady state solution, it doesn’t matter what the initial conditions are. The point of the problem is to observe how the solution converges to the steady state sinusoidal function. ๐๐ฌ๐ฌ๐ฎ๐ฆ๐ข๐ง๐ ๐ณ๐๐ซ๐จ ๐ข๐ง๐ข๐ญ๐ข๐๐ฅ ๐๐จ๐ง๐๐ข๐ญ๐ข๐จ๐ง๐ฌ: ๐(๐ฌ) = [ ๐๐๐๐ฌ + ๐๐๐๐๐ ๐. ๐(๐๐) ] ๐๐๐๐ฌ๐ + ๐๐๐๐ฌ + ๐๐๐๐๐ ๐ฌ ๐ + ๐๐๐ ๐๐ฌ + ๐๐๐ ๐. ๐๐๐๐ฌ ๐ − ๐. ๐๐๐๐ฌ = ๐ + ๐ ๐ + + ๐๐๐๐ฌ + ๐๐๐๐ฌ + ๐๐๐๐๐ ๐ฌ + ๐๐ฌ + ๐๐๐ ๐ฌ + ๐๐๐ ๐ฒ(๐ญ) = ๐. ๐๐๐๐๐−๐๐ญ ๐ฌ๐ข๐ง(๐. ๐๐๐๐๐ญ + ๐. ๐๐๐๐) + ๐. ๐๐๐๐ ๐ฌ๐ข๐ง(๐๐๐ญ − ๐. ๐๐๐๐) Assuming the initial value of z is 0.3, z(0-) = 0.3: ๐(๐ฌ) = ๐ฌ๐ ๐๐ฌ๐ ๐.๐๐๐ +๐.๐๐๐ +๐๐๐+๐๐๐ ๐.๐๐๐๐ฌ+๐.๐ ๐−๐.๐๐๐๐ฌ ๐(๐) = ๐ฌ๐ +๐๐ฌ๐ +๐๐๐๐ฌ๐ +๐๐๐๐ฌ+๐๐๐๐๐ = ๐ฌ๐ +๐๐ฌ+๐๐๐ + ๐ฌ๐ +๐๐๐ ๐ฒ(๐ญ) = ๐. ๐๐๐๐๐−๐๐ญ ๐ฌ๐ข๐ง(๐. ๐๐๐๐๐ญ + ๐. ๐๐๐) + ๐. ๐๐๐๐ ๐ฌ๐ข๐ง(๐๐๐ญ − ๐. ๐๐๐๐) Show that the equation for y(t) as ๐ก → ∞ is a sine function. What is the amplitude of the y(t) sine function? How much larger or smaller is this amplitude compared to the amplitude of the road sine function? Regardless of the initial conditions: As ๐ก → ∞, ๐ฆ(๐ก) = 0.1601 sin(10๐ก − 0.8961) ๐โ๐ ๐๐๐๐๐๐ก๐ข๐๐ ๐๐ 1.6 ๐ก๐๐๐๐ ๐๐๐๐๐ก๐๐. (b) Using MATLAB, plot y(t) and show that y(t) does eventually become a constant amplitude sine function. It will take about 1.25 seconds for y(t) to reach steady state behavior. So, we will run the simulation for 3 seconds to see enough of the steady behavior to get the steady state sine wave 210 amplitude. Also, the largest pole magnitude is 10; so, we need a time increment no greater than 1/(10*10) = 0.01. >> t=0:0.01:3; >> y=0.1364*exp(-4*t).*sin(9.1652*t+1.9823)+0.1601*sin(10*t-0.8961); >> Y=0.4318*exp(-4*t).*sin(9.1652*t+1.393)+0.1601*sin(10*t-0.8961); >> plot(t,y,'r',t,Y,'k.','Linewidth',2) >> xlabel('time, sec.') >> ylabel('y(t)') >> title('plots of y(t) for different initial conditions') >> legend('initial value of y = 0','initial value of y=0.3','Location','best') plots of y(t) for different initial conditions 0.3 initial value of y = 0 initial value of y=0.3 0.25 0.2 X: 2.76 Y: 0.1601 0.15 y(t) 0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 0 0.5 1 1.5 time, sec. 2 2.5 3 Confirm from your plot that the amplitude in (b) is correct. As shown above, the amplitude is correct. (c) Use the MATLAB command ‘bode’ to generate the frequency response of the transfer function for this suspension and confirm that the amplitude at ๐ = 10 ๐๐๐/๐ is correct. >> g=tf([8 100],[1 8 100]); >> bode(g,{2 20}) >> 10^(4.06/20) = 1.5959 As shown in the frequency response plot below, the amplitude at 10 rad/s is 4.06 dB which is equivalent to a gain of 1.5959 ≈ 1.6 which agrees with the time domain solution. Also note that the phase on the frequency response plot is -51.8 degrees which is -0.9041 rad which is also approximately which is approximately equal to -0.8961 rad obtained using the inverse Laplace transform. 211 Bode Diagram 6 Magnitude (dB) 4 2 System: g Frequency (rad/s): 10 Magnitude (dB): 4.06 0 -2 -4 Phase (deg) -6 0 -45 System: g Frequency (rad/s): 10 Phase (deg): -51.8 -90 -135 10 1 Frequency (rad/s) 212 Homework 40 The schematic for a vehicle suspension is shown below. The differential equation for the upward displacement y of the vehicle mass in terms of the road profile u is also shown below. Assume the road profile input is a step of 0.1 m at time zero and assume the initial conditions are all zero. (a) Draw an estimate of y(t). Be sure to show the initial and final values and the approximate time to steady state. y 0 time (b) Define state variables for this differential equation and write the derivative equations, i.e. ๐ฅฬ 1 =? ๐ฅฬ 2 =? (c) Use ode45 to generate a numerical solution and a plot of y. Does your plot match your estimate in part (a)? (d) Also generate a plot of the suspension stroke = u – y. 213 Homework 40 Solution The schematic for a vehicle suspension is shown below. The differential equation for the upward displacement y of the vehicle mass in terms of the road profile u is also shown below. Assume the road profile input is a step of 0.1 m at time zero and assume the initial conditions are all zero. (a) (15%) Draw an estimate of y(t). Be sure to show the initial and final values and the approximate time to steady state. y, m 0.1 0 1.25 time, sec (b) (25%) Define state variables for this differential equation and write the derivative equations, i.e. ๐๐ = ๐ ๐๐ = ๐ฬ − ๐๐ ๐ฬ ๐ = ๐๐ + ๐๐ ๐ฬ ๐ = −๐๐๐๐๐ − ๐๐๐ + ๐๐๐ (c) (40%) Use ode45 to generate a numerical solution and a plot of y. Does your plot match your estimate in part (a)? Yes, the initial and final values match as well as the time to steady state. clear all [t,x]=ode45(@hmwk9eqns3360,[0 1.25],[0 0]); y=x(:,1); plot(t,y,'r','Linewidth',2) xlabel('time, sec.') ylabel('y(t), m') title('Homework 9 Vehicle Mass Displacement') figure y2=0.1-x(:,1); plot(t,y2,'r','Linewidth',2) xlabel('time, sec.') ylabel('u-y(t), m') title('Homework 9 Variation in Suspension Stroke') 214 function dx = hmwk9eqns3360( t,x ) dx=zeros(2,1); u=0.1; dx(1)=x(2)+8*u; dx(2)=-100*x(1)-8*x(2)+36*u; end Homework 9 Vehicle Mass Displacement 0.14 0.12 0.1 y(t), m 0.08 0.06 0.04 0.02 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 time, sec. (d) (20%) Also generate a plot of the suspension stroke = u – y. Homework 9 Variation in Suspension Stroke 0.1 0.08 u-y(t), m 0.06 0.04 0.02 0 -0.02 -0.04 0 0.2 0.4 0.6 0.8 1 1.2 1.4 time, sec. 215 Homework 41 A cannon ball is fired at an initial angle of ๐ = 60๐๐๐ with an initial velocity of V=100 m/sec. The differential equations for the trajectory of the ball can be shown to be: ๐ = √๐งฬ 2 + ๐ฆฬ 2 10๐งฬ + 0.2๐งฬ ๐ = 0 10๐ฆฬ + 0.2๐ฆฬ ๐ + 98 = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 100 ๐ ๐๐( 60 ๐๐๐) = 86.6๐/๐ ๐ง(0− ) = 0 ๐งฬ (0− ) = 100 ๐๐๐ ( 60 ๐๐๐) = 50๐/๐ y V(0)=100 ๏ฑ (0) = 60 deg 0 (a) (b) (c) (d) (e) z On the graph above, draw an estimate of the trajectory of the ball. Define state variables for the two differential equations above. What are the initial conditions for your state variables? Find the derivative equations for the state variables. Create M-files for obtaining a plot of the trajectory, with y and z coordinates as shown above, using ode45. Use an event function to end the simulation when the ball hits the ground on its descent. Use common sense to determine if your simulation is probably correct. Homework 41 Solution A cannon ball is fired at an initial angle of ๐ = 60๐๐๐ with an initial velocity of V=100 m/sec. The differential equations for the trajectory of the ball can be shown to be: ๐ = √๐งฬ 2 + ๐ฆฬ 2 10๐งฬ + 0.2๐งฬ ๐ = 0 10๐ฆฬ + 0.2๐ฆฬ ๐ + 98 = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 100 ๐ ๐๐( 60 ๐๐๐) = 86.6๐/๐ ๐ง(0− ) = 0 ๐งฬ (0− ) = 100 ๐๐๐ ( 60 ๐๐๐) = 50๐/๐ 216 y V(0)=100 ๏ฑ (0) = 60 deg 0 z (a) On the graph above, draw an estimate of the trajectory of the ball. (b) Define state variables for the two differential equations above. ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅ3 = ๐ฆ ๐ฅ4 = ๐ฆฬ (c) What are the initial conditions for your state variables? ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 50 ๐ฅ3 (0− ) = 0 ๐ฅ4 (0− ) = 86.6 (d) Find the derivative equations for the state variables. ๐ = √๐ฅ22 + ๐ฅ42 ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −0.02๐๐ฅ2 ๐ฅฬ 3 = ๐ฅ4 ๐ฅฬ 4 = −9.8 − 0.02๐๐ฅ4 (e) Create M-files for obtaining a plot of the trajectory, with y and z coordinates as shown above, using ode45. Use an event function to end the simulation when the ball hits the ground on its descent. Use common sense to determine if your simulation is probably correct. The graph below makes sense. function trajectory options=odeset('events',@SimStop); V=100;TH=60*pi/180; [t,x]=ode45(@TrajectoryEqns,[0 15],[0 V*cos(TH) 0 V*sin(TH)],options); plot(x(:,1),x(:,3),'r.') xlabel('Horizontal Distance, m') ylabel('Altitude, m') title('Homework 10 Cannonball Trajectory - 60 deg. firing angle') function dx = TrajectoryEqns( t,x ) dx=zeros(4,1); V=sqrt(x(2)^2+x(4)^2); dx(1)=x(2); dx(2)=-0.02*V*x(2); dx(3)=x(4); dx(4)=-9.8-0.02*V*x(4); end 217 function [Val,Ister,Dir] = SimStop(t,x) Val(1)=x(3); Ister(1)=1; Dir(1)=-1; end end From >> doc odset value(i) is the value of the ith event function. isterminal(i) = 1 if the integration is to terminate at a zero of this event function, otherwise, 0. direction(i) = 0 if all zeros are to be located (the default), +1 if only zeros where the event function is increasing, and -1 if only zeros where the event function is decreasing. Homework 10 Cannonball Trajectory - 60 deg. firing angle 70 60 50 Altitude, m 40 30 20 10 0 -10 0 10 20 30 40 50 Horizontal Distance, m 60 70 80 Homework 42 Repeat problem 41 but this time using SIMULINK to get the plot. Note, I suggest you first draw a simulation diagram starting by solving for ๐งฬ ๐๐๐ ๐ฆฬ and then putting these terms through integrators. You will need to use ‘Sqrt’ and ‘Product’ from ‘Math Operations’ in the library. Don’t forget to add initial conditions to the appropriate integrators. Also, use the solution to Homework 41 to get the final simulation time or guess long to get it. Homework 42 Solution Repeat problem 10 but this time using SIMULINK to get the plot. Note, I suggest you first draw a simulation diagram starting by solving for ๐งฬ ๐๐๐ ๐ฆฬ and then putting these terms through integrators. You will need to use ‘Sqrt’ and ‘Product’ from ‘Math Operations’ in the library. Don’t forget to add initial conditions to the appropriate integrators. Also, use the solution to Homework 10 to get the final simulation time or guess long to get it. 218 Simulink Diagram Plotting Commands (20%) >> plot(y(:,2),y(:,1),'r','linewidth',2) >> title('Homework 11: Simulink solution to cannonball trajectory') >> ylabel('height of ball, m') >> xlabel('horizontal travel distance of ball, m') Graph with labels 219 Homework 11: Simulink solution to cannonball trajectory 70 60 height of ball, m 50 40 30 20 10 0 0 10 20 30 40 50 horizontal travel distance of ball, m 60 70 80 Homework 43 The radar dish system shown below is used to track airplane targets as they pass overhead. The input to the system is the true angle to the target ∅๐ (degrees) which is a ramp defined by 10t. In other words, the targets typically pass over at a rate of 10 deg./sec. The pointing angle of the dish is denoted by ∅ also in degrees. (a) The input to the controller is e. Show that the differential equation for the controller is 0.0234๐ขฬ + ๐ข = 0.4758๐ฬ + ๐ (b) The input to the hydraulic positioner is u. Show that the differential equation for the hydraulic positioner is 5∅ฬ + ∅ฬ = 100๐ข 220 (c) Assign the three state variables for this system and express the state variable equations in matrix format where the output of interest is ∅, i.e. ๐ฬ = ๐ด๐ + ๐ต∅๐ ๐ฆ = ๐ถ๐ + ๐ท∅๐ (d) Use ‘damp’ to compute the eigenvalues of this system. Based on the time constants, about how long does it take to acquire the target? (e) Assume that the initial pointing angle ∅(0− ) of the dish is 90 degrees (vertical) at the time that the control system becomes aware of a passing target which at that instant is at an angle of 30 degrees above the horizon. Use ‘lsim’ to generate and then plot the time response of the pointing angle of the dish. Homework 43 Solution The radar dish system shown below is used to track airplane targets as they pass overhead. The input to the system is the true angle to the target ∅๐ (degrees) which is a ramp defined by 10t. In other words, the targets typically pass over at a rate of 10 deg./sec. The pointing angle of the dish is denoted by ∅ also in degrees. (a) (10%) The input to the controller is e. Show that the differential equation for the controller is 0.0234๐ขฬ + ๐ข = 0.4758๐ฬ + ๐ (b) (10%) The input to the hydraulic positioner is u. Show that the differential equation for the hydraulic positioner is 5∅ฬ + ∅ฬ = 100๐ข 221 (c) (40%) Assign the three state variables for this system and express the state variable equations in matrix format where the output of interest is ∅, i.e. ๐ฬ = ๐ด๐ + ๐ต∅๐ ๐ฆ = ๐ถ๐ + ๐ท∅๐ The equations for this system are: 0.0234๐ขฬ + ๐ข = 0.4758๐ฬ + ๐, ๐ = ∅๐ − ∅ and 5∅ฬ + ∅ฬ + 0∅ = 100๐ข. The unknowns are ๐ข, ๐, ๐๐๐ ∅. We have a first order differential equation for u, an algebraic equation for e, and a 2nd order differential equation for ∅. We will need 3 state variables: 0.4758 ๐ฅ1 = ∅ ๐ฅ2 = ∅ฬ ๐ฅ3 = ๐ข − ๐ = ๐ข − 20.333๐ 0.0234 ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −406.667๐ฅ1 − 0.2๐ฅ2 + 20๐ฅ3 + 406.667∅๐ ๐ฅฬ 3 = 826.1966๐ฅ1 − 42.735๐ฅ3 − 826.1966∅๐ 0 1 0 0 ๐ด = [−406.667 −0.2 ๐ต = [ 406.667 ] 20 ] 826.1966 0 −42.735 −826.1966 ๐ฆ = ∅ ๐โ๐ข๐ ๐ถ = [1 0 0] ๐ท = [0] (d) (10%) Use ‘damp’ to compute the eigenvalues of this system. Based on the time constants, about how long does it take to acquire the target? Time required is 5/2.84 ≈ 1.75 ๐ ๐๐. >> A=[0 1 0;-406.667 -0.2 20;826.1966 0 -42.735];B=[0;406.667;-826.1966]; >> C=[1 0 0];D=0; >> G=ss(A,B,C,D); >> damp(G) Pole Damping Frequency Time Constant (rad/seconds) (seconds) -2.84e+00 NA NA 3.53e-01 -1.00e+01 NA NA 9.97e-02 -3.01e+01 NA NA 3.33e-02 Note, real eigenvalues do not have a damping ratio or frequency; so, MATLAB listing is incorrect. (e) (30%) Assume that the initial pointing angle ∅(0− ) of the dish is 90 degrees (vertical) at the time that the control system becomes aware of a passing target which at that instant is at an angle of 30 degrees above the horizon. Use ‘lsim’ to generate and then plot the time response of the pointing angle of the dish. >> t=0:1/300:2; >> PhiTar=30+10*t; >> Xi=[90;0;0]; >> Phi=lsim(G,PhiTar,t,Xi); >> plot(t,PhiTar,'r',t,Phi,'k-.','Linewidth',2) >> xlabel('time, sec') >> ylabel('angle, deg') >> legend('angle to target','angle of radar antenna') 222 >> title('Homeowrk 12: state variable version of radar antenna control') Homeowrk 12: state variable version of radar antenna control 90 angle to target angle of radar antenna 80 angle, deg 70 60 50 40 30 20 0 0.2 0.4 0.6 0.8 1 time, sec 1.2 1.4 1.6 1.8 2 Homework 44 The schematic for a suspension system is shown below. The stochastic input is the road profile r(t) which has irregularities consistent with a path through a cow pasture. w z r ๐บฬ๐ฆ๐ฆ (๐) = No. 1 3 4 5 6 ๐บฬ๐ฆ๐ฆ (๐ ) ๐ด ๐ด๐ ๐−1 = ๐ = ๐ ๐ ๐ ๐๐ Description Smooth runway Smooth highway Highway with gravel Pasture Plowed field N 3.8 2.1 2.1 1.6 1.6 A 4.3 x 10-11 4.8 x 10-7 4.4 x 10-6 3.0 x 10-4 6.5 x 10-4 The maximum allowable decrease in the gap size between the two masses in the suspension is called the suspension stroke. If the gap decreases as much as the stroke, the suspension is said to 223 bottom out. The transfer function for the decrease in the gap size, y = z – w, is shown in the following equation ๐(๐ ) = [ 1200๐ 2 ] ๐ (๐ ) ๐ 4 + 48๐ 3 + 1776๐ 2 + 14400๐ + 172800 We are interested in simulating y(t) and then computing its mean and standard deviation. This information will be used to determine the necessary design value for the stroke such that there is a high probability (95%) that the suspension will not bottom out when the vehicle is moving through a pasture at 10 m/s. For the suspension to bottom out y(t) ≥ stroke. (a) (5%) What is the DC gain of this transfer function? _______ (5%) Explain the significance of the DC gain. What does it mean specifically for this suspension? ________________________________________________ (b) (10%) What are the eigenvalues of this system? ___________________ (c) (10%) Considering the eigenvalues, what is the largest time increment H that should be used to create r(t)? Hint: Watch the lecture and see lecture notes on picking N and H. _____ (d) (10%) What is the minimum N that should be used when creating r(t)? _________ Be sure to explain your answer. (e) (15%) Using N = 8192 and H = 0.0025 (not the answers to (c) and (d)), use StochInput to generate values for r(t) if the vehicle is moving 10 m/s. Plot the values of r(t) and use the function comppsd to generate and plot the PSD of r(t); use the axis command to limit the frequency axis of the plot to 5 hz in order to get good resolution at the low frequencies. Note, StochInput and comppsd are files that you must copy and paste into MATLAB. (f) (20%) Using r(t) from (e), use lsim to generate values for y(t). Plot y(t). Also, plot only the first 5 seconds of y(t) for better observation resolution. (g) (5%) Comparing r(t) and y(t), what can you say about the frequency content of each; why is there such a difference? You may want to put both on the same graph for comparison. (h) (10%) Use commands std and mean to get the standard deviation and mean of y(t). 224 (i) (10%) Based on the PSD for the pasture and the vehicle speed, what size stroke is needed for there to be a 95% probability of the suspension not bottoming out? _________ Be sure to show and explain all calculations. Homework 44 Solution The schematic for a suspension system is shown below. The stochastic input is the road profile r(t) which has irregularities consistent with a path through a cow pasture. w z r ๐บฬ๐ฆ๐ฆ (๐) = No. 1 3 4 5 6 ๐บฬ๐ฆ๐ฆ (๐ ) ๐ด ๐ด๐ ๐−1 = ๐ = ๐ ๐ ๐ ๐๐ Description Smooth runway Smooth highway Highway with gravel Pasture Plowed field N 3.8 2.1 2.1 1.6 1.6 A 4.3 x 10-11 4.8 x 10-7 4.4 x 10-6 3.0 x 10-4 6.5 x 10-4 The maximum allowable decrease in the gap size between the two masses in the suspension is called the suspension stroke. If the gap decreases as much as the stroke, the suspension is said to bottom out. The transfer function for the decrease in the gap size, y = z – w, is shown in the following equation ๐(๐ ) = [ 1200๐ 2 ] ๐ (๐ ) ๐ 4 + 48๐ 3 + 1776๐ 2 + 14400๐ + 172800 We are interested in simulating y(t) and then computing its mean and standard deviation. This information will be used to determine the necessary design value for the stroke such that there is a high probability (95%) that the suspension will not bottom out when the vehicle is moving through a pasture at 10 m/s. For the suspension to bottom out y(t) ≥ stroke. (j) (5%) What is the DC gain of this transfer function? DC gain = 0 225 (5%) Explain the significance of the DC gain. What does it mean specifically for this suspension? If the input r(t) is a step, the gap between the masses will collapse to some degree but then eventually return to its original size. So, the gap size change will end up being zero. (k) (10%) What are the eigenvalues of this system? ? −3.35 ± ๐1.07 ๐๐๐ − 20.6 ± ๐30.8 >> damp(G) (l) (10%) Considering the eigenvalues, what is the largest time increment H that should be used to create r(t)? Hint: Watch the lecture and see lecture notes on picking N and H. For M being the largest eigenvalue magnitude for real and complex eigenvalues 1 ๐ป≤ 10๐ 1 = = 0.002699 10√20. 62 + 30.82 Rounding down, I would use H = 0.0025 s. If there was a maximum frequency fmax hz specified in the desired input PSD, then we 1 would need to check and determine if H needs to be even smaller to satisfy ๐ป ≤ 10๐ ๐๐๐ฅ . This problem does not have an fmax specified for the input PSD. (m) (10%) What is the minimum N that should be used when creating r(t)? N = 2048 Be sure to explain your answer. The value of N must be big enough so that the final simulation time = NH is at least twice the transient period associated with the eigenvalue time constants which are 1/3.35 = 0.299 and 1/20.6 = 0.0485. So, 5 times the largest time constant is 1.49 which will just get us through the startup transient period. Assuming we want to observe some of the stationary steady state behavior, the final time needs to be at least 3 or 4 times 1.49 s. So, if the final time is 4.5 s, then the number of points N must be greater than 4.5/H, i.e. ๐ ≥ 4.5/0.0025 = 1800 Since N must be a power of 2 and 210 = 1024 and 211 = 2048 then N = 2048 is the minimum number of points that can be used. (n) (15%) Using N = 8192 and H = 0.0025 (not the answers to (c) and (d)), use StochInput to generate values for r(t) if the vehicle is moving 10 m/s. Plot the values of r(t) and use the function comppsd to generate and plot the PSD of r(t); use the axis command to limit the frequency axis of the plot to 5 hz in order to get good resolution at the low frequencies. StochInput and comppsd are files that you must copy and paste into MATLAB. Note in the PSD plot below that the PSD at f = 0 is zero which means the mean value of r(t) is zero. 226 Plot of r(t) for entire range of time t Plot of PSD of r(t) for limited range of f 0.5 0.16 0.4 0.14 0.3 0.12 PSD of r(t) r(t) 0.2 0.1 0 -0.1 0.08 0.06 0.04 -0.2 0.02 -0.3 -0.4 0.1 0 5 10 15 20 0 25 0 0.5 1 1.5 time, s 2 2.5 3 3.5 4 4.5 5 Frequency hz (o) (20%) Using r(t) from (e), use lsim to generate values for y(t). Plot y(t). Also, plot only the first 5 seconds of y(t) for better observation resolution. Vehicle speed 10 m/s in pasture Vehicle speed 10 m/s in pasture 0.15 Change in gap size, y, m Change in gap size, y, m 0.15 0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 0 5 10 15 20 0.1 0.05 0 -0.05 -0.1 25 0 0.5 1 Time, s 1.5 2 2.5 3 3.5 4 4.5 5 Time, s (p) (5%) Comparing r(t) and y(t), what can you say about the frequency content of each; why is there such a difference? You may want to put both on the same graph for comparison. Both plots have the same lower frequency trends exhibited by the major ups and downs; but, the high frequencies in r(t) are essentially filtered out by the suspension. Vehicle speed 10 m/s in pasture 0.2 Decrease in gap size y, m Input r, m Change in gap size, y, m 0.15 0.1 0.05 0 -0.05 -0.1 -0.15 -0.2 -0.25 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time, s 227 (q) (10%) Use commands std and mean to get the standard deviation and mean of y(t). ๐๐ฆ = 0.04479 ๐ ๐๐ฆ = −0.00027 ≈ 0 Of course, we know the mean of y(t) must be zero since the mean value of the input r(t) is zero. We know that the mean of r(t) is zero since there is no impulse in the input PSD at zero frequency which means the mean is zero (see lecture notes). Since the mean of r(t) is zero, the mean value of y(t) also has to be zero. But then, the mean of y(t) would be zero even if there was a non-zero mean input since the DC gain of the transfer function is zero. (r) (10%) Based on the PSD for the pasture and the vehicle speed, what size stroke is needed for there to be a 95% probability of the suspension not bottoming out? 0.074 m Be sure to show and explain all calculations. Based on the Central Limit Theorem, the distribution of y is assumed to be normal. Using disttool, the probability distribution function shows that the stroke must be 0.074 m in order for 95% of gap decreases to be less than 0.074 m. See the figure below. 1 0.8 0.6 0.4 0.2 0 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 Using the probability table in the notes, there is a 90% probability of y being between -1.64๐๐ฆ and +1.64๐๐ฆ . Thus, there is %5 probability of y being greater than 1.64๐๐ฆ . So, there is a 95% probability of y being less than 1.64๐๐ฆ = 1.64(0.04479) = 0.074 which agrees with the disttool method. ๐๐๐ ๐. ๐๐๐๐๐ ๐. ๐๐๐๐ ๐. ๐๐๐๐ ๐. ๐๐๐๐ Confidence Factor ๐ท๐๐๐๐๐๐๐๐๐๐ ๐๐ |๐ − ๐๐ | ≤ ๐๐๐ 0.50 0.90 0.95 0.99 228 1 0.8 0.6 0.4 0.2 0 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 function Homework_12_3360_11_17_20 num=[1200 0 0]; den=[1 48 1776 14400 172800]; G=tf(num,den) N=8192;H=0.0025; [r,t]=pasture(N,H); figure(3) y=lsim(G,r,t); plot(t,y,'r','linewidth',2) xlabel('Time, s','fontsize',18) ylabel('Change in gap size, y, m','fontsize',18) title('Vehicle speed 10 m/s in pasture','fontsize',18) grid figure(4) plot(t,y,'r','linewidth',2) xlabel('Time, s','fontsize',18) ylabel('Change in gap size, y, m','fontsize',18) title('Vehicle speed 10 m/s in pasture','fontsize',18) axis([0 5 -0.15 0.15]) grid figure(5) plot(t,y,'r',t,r,'k:','linewidth',2) xlabel('Time, s','fontsize',18) ylabel('Change in gap size, y, m','fontsize',18) title('Vehicle speed 10 m/s in pasture','fontsize',18) legend('Decrease in gap size y, m','Input r, m') axis([0 5 -0.3 0.2]) grid SDEV=std(y) MEAN=mean(y) % This function generates the input for Homework 12 MAE 3360 Nov 2020 function [r,t]=pasture(N,H) [r,t]=StochInput(N,H); 229 figure(1) plot(t,r,'r') xlabel('time, s','fontsize',16) ylabel('r(t)','fontsize',16) title('Plot of r(t) for entire range of time t','fontsize',16) figure(2) [PSD,f]=comppsd(r,N,H); plot(f,PSD,'r','linewidth',3) xlabel('Frequency hz','fontsize',16) ylabel('PSD of r(t)','fontsize',16) title('Plot of PSD of r(t) for limited range of f','fontsize',16) axis([0 5 0 0.16]) end % -----------------------------------------------------------------% function [Y,t]=StochInput(N,H) % Generates N points in time Y(t) at a time interval of H with zero mean. % N must be a power of 2! The N points will be generated % so as to have a desired one-sided PSD defined in the function % dpsd(f) at the end of this file. f is the frequency in Hertz. % The frequency resolution will be 1/NH. % The smallest frequency will be 0 Hz. % The largest frequency will be 1/2H Hz. Note, the frequency 1/2H % is referred to as the folding or Nyquist frequency. % % If you don't want this m-file to automatically plot y(t) and the % desired PSD, you need to add "%" signs to all plot commands % in this function. % % The time span for y(t) will be from 0 to NH. function[Y,t]=StochInput(N,H) no2=N/2; % Step 1: Generate frequencies and PSD values at each frequency f=0:1/(N*H):1/(2*H);%Note, the first frequency is zero but we don't %compute GY at f=0 to avoid potential computational problems. GY at f=0 %should be zero for a zero mean process. GY(1)=0; % The desired PSD is defined in function dpsd at the end of this file for m1=2:no2+1; GY(m1)=dpsd(f(m1)); end % Step 1: Generate N/2 random phase angles with uniform denisty % between 0 and 2pi TH=random('unif',0,2*pi,no2,1); % Step 2: Generate the appropriate amplitude at each frequency using % the random phase angles. for m=2:no2; C=sqrt(GY(m)*N*H/2); CTH=cos(TH(m-1))*C; STH=sin(TH(m-1))*C; Y(m)=CTH+j*STH; k=N+2-m; Y(k)=CTH-j*STH; end % Step 3: Make sure the N/2+1 value is real that the negative frequency % values will be the mirror image of the positive frequency values. no2p1=no2+1; 230 C=sqrt(GY(no2p1)*N*H/2); CTH=cos(TH(no2))*C; Y(no2p1)=CTH+j*0.e0; % Make sure the zero frequency value is zero to achieve % a zero mean time series. Y(1)=0.e0+j*0.e0; % Generate Y(t), the inverse transform of the N Fourier Transform % values Y(f). [Y]=ifft(Y); % Rescale to get the correct time series corresponding to this desired PSD. for m=1:N; Y(m)=real(Y(m)/H); end t=0:H:(N-1)*H;t=t'; Y=Y'; % Plot the PSD and time series %figure %plot(t,Y,'r','linewidth',2); %xlabel('Time (sec)') %ylabel('Output variable with the desired PSD') %figure %plot(f,GY,'r','linewidth',2)% Used to confirm desired PSD %xlabel('Frequency (Hertz)') %ylabel('Desired PSD, (units of output)^2/hz') end %------------------------------------% This function will be called for each value of f % You need equations or logic for GY describing the desired PSD. % The logic below is for a bandlimited white noise with one-sided PSD % with magnitude 900 over the frequency range 1.995 < f < 2.005 hz. % Note, the frequency resolution 1/NH must be <= 0.001 hz to get % at least 10 values in this narrow frequency range. function [GY]=dpsd(f) GY=(3e-4)*10^0.6/f^1.6;%PSD for pasture at 10 m/s end %-----------------------------------------------------------% function[PSD,f]=comppsd(Y,N,H) % This function generates N/2 unique values for the % PSD of Y(t) at a frequency resolution of 1/NH. The % zero frequency value represents the mean value squared times 2NH. % Note, the PSD is plotted for all values of frequency. % After generating the plot, for better resolution, you can change % the scales of the plot using the command axis([XMIN XMAX YMIN YMAX]). function[PSD,f]=comppsd(Y,N,H) [Y]=fft(Y); NO2=N/2; for m=1:NO2 PSD(m)=2*H*abs(Y(m))^2/N; end f=0:1/(N*H):(N-2)/(2*N*H); %plot(f,PSD) %xlabel('Frequency (Hertz)') %ylabel('PSD (units of y^2)/(cycles/sec)') end end 231 Homework 45 The electrical circuit shown below consists of resistances R1 and R2, inductors L1 and L2, and capacitors C. The circuit is used to filter the input voltage V1(t). The output V4(t) represents V1(t) after being filtered. R1 L1 C + V1 C _ R2 L2 V4 It can be shown that the equation for V4(s) is ๐ฝ๐ (๐) = [ ๐ช๐ ๐ณ๐ ๐ณ๐ ๐๐ + ๐ช๐ (๐ณ๐ ๐น๐ ๐ช๐ณ๐ ๐๐ (๐ช๐น๐ ๐ + ๐) ] ๐ฝ (๐) + ๐ณ๐ ๐น๐ + ๐ณ๐ ๐น๐ )๐๐ + ๐ช(๐๐ณ๐ + ๐ณ๐ + ๐ช๐น๐ ๐น๐ )๐๐ + ๐ช(๐๐น๐ + ๐น๐ )๐ + ๐ ๐ (a) (10%) What is the low frequency gain (D.C. gain) of this filter? That is, as the input frequency approaches zero, what is the gain? (b) (10%) If L2 = 2L1, what is the high frequency gain of the filter? That is, as the input frequency approaches infinity, what is the gain. (c) (10%) Considering what happens to low input frequencies and what happens to high input frequencies, what kind of a filter is this? For example, low pass or band pass or high pass or what? (d) (12%) Assume the following parameters and generate the frequency response plot of the transfer function using the MATLAB command ‘bode’. L1 = 1e-3 h L2 = 2L1 C = 1e-6 f R1=15.8 ๐บ R2=2R1 (e) (5%) Does the frequency response plot confirm you answer in (c)? Explain. Yes. (f) (10%) Assuming that transfer function magnitudes below -3 dB are filtered, what range of frequencies are not filtered? (g) (5%) What are the eigenvalues of this filter? (h) (8%) If V1(t) = 1sin(5000t), what is V4(t)? That is, what is V1(t) after being filtered? (i) (8%) If V1(t) = 1sin(75000t), what is V4(t)? That is, what is V1(t) after being filtered? (j) (4%) What can you conclude about the effects of the filter considering your answers in (g) and (h)? For an input with frequency of 5000 rad/s, the amplitude is attenuated by a factor of 0.067; for 75000 rad/s, the amplitude is attenuated by 0.464. (k) (6%) Generate a time array for an lsim simulation of this transfer function for the input in (h); explain how you picked the final time and time increment. (l) (6%) Using your time array and lsim to simulate your transfer function with the input in (h), plot V4(t). 232 (m) (6%) Does the steady state amplitude of V4(t) from your simulation agree with your answer in (h)? Homework 45 Solution The electrical circuit shown below consists of resistances R1 and R2, inductors L1 and L2, and capacitors C. The circuit is used to filter the input voltage V1(t). The output V4(t) represents V1(t) after being filtered. R1 L1 C + V1 C _ R2 L2 V4 It can be shown that the equation for V4(s) is ๐ฝ๐ (๐) = [ ๐ช๐ณ๐ ๐๐ (๐ช๐น๐ ๐ + ๐) ] ๐ฝ (๐) ๐ช๐ ๐ณ๐ ๐ณ๐ ๐๐ + ๐ช๐ (๐ณ๐ ๐น๐ + ๐ณ๐ ๐น๐ + ๐ณ๐ ๐น๐ )๐๐ + ๐ช(๐๐ณ๐ + ๐ณ๐ + ๐ช๐น๐ ๐น๐ )๐๐ + ๐ช(๐๐น๐ + ๐น๐ )๐ + ๐ ๐ (a) (10%) What is the low frequency gain (D.C. gain) of this filter? That is, as the input frequency approaches zero, what is the gain? Setting s = 0 in the transfer function gives zero (b) (10%) If L2 = 2L1, what is the high frequency gain of the filter? That is, as the input frequency approaches infinity, what is the gain. Setting s = infinity in the transfer function gives zero. (c) (10%) Considering what happens to low input frequencies and what happens to high input frequencies, what kind of a filter is this? For example, low pass or band pass or high pass or what? It is a band pass filter. (d) (12%) Assume the following parameters and generate the frequency response plot of the transfer function using the MATLAB command ‘bode’. L1 = 1e-3 h L2 = 2L1 C = 1e-6 f R1=15.8 ๐บ R2=2R1 % Homework 11 3360 Nov 2020 >> L1=1e-3;L2=2*L1;C=1e-6;R1=15.8;R2=2*R1; >> G=tf([C^2*L2*R2 C*L2 0 0],[C^2*L2*L1 C^2*(L1*R2+L2*R1+L2*R2) C*(2*L1+L2+C*R1*R2) C*(2*R1+R2) 1]) bode(G) ... 233 G= 31600 s^3 + 1e09 s^2 -----------------------------------------------s^4 + 63200 s^3 + 2.25e09 s^2 + 3.16e13 s + 5e17 Bode Diagram 20 System: G Frequency (rad/s): 1.38e+04 Magnitude (dB): -2.97 10 Magnitude (dB) 0 System: G Frequency (rad/s): 5.15e+04 Magnitude (dB): -3.04 -10 -20 -30 -40 -50 Phase (deg) -60 180 90 0 -90 3 10 4 5 10 10 6 10 Frequency (rad/s) (e) (5%) Does the frequency response plot confirm you answer in (c)? Explain. Yes. There is midrange of frequencies that do not get filtered whereas low and high frequencies do get filtered. (f) (10%) Assuming that transfer function magnitudes below -3 dB are filtered, what range of frequencies are not filtered? Approximately 13,800 to 51,500 rad/s are not filtered. (g) (5%) What are the eigenvalues of this filter? >> damp(G) Eigenvalue Damping Frequency -4.38e+03 + 1.82e+04i 2.33e-01 1.88e+04 -4.38e+03 - 1.82e+04i 2.33e-01 1.88e+04 -2.72e+04 + 2.61e+04i 7.22e-01 3.77e+04 -2.72e+04 - 2.61e+04i 7.22e-01 3.77e+04 (h) (8%) If V1(t) = 1sin(5000t), what is V4(t)? That is, what is V1(t) after being filtered? Getting magnitude and angle from the frequency response plot below at 5000 rad/s: 170 ๐4 (๐ก) = 1(10)−25.3/20 ๐ ๐๐(5000๐ก + 2๐) = 0.067๐ ๐๐(5000๐ก + 5.93) 180 234 Bode Diagram Magnitude (dB) 20 0 System: g Frequency (rad/s): 7.51e+04 Magnitude (dB): -6.67 System: g Frequency (rad/s): 5.01e+03 Magnitude (dB): -25.3 -20 -40 -60 180 Phase (deg) System: g Frequency (rad/s): 5e+03 Phase (deg): 170 90 0 System: g Frequency (rad/s): 7.5e+04 Phase (deg): -61.5 -90 3 10 4 10 Frequency (rad/s) 5 10 (i) (8%) If V1(t) = 1sin(75000t), what is V4(t)? That is, what is V1(t) after being filtered? 61.5 ๐4 (๐ก) = 1(10)−6.67/20 ๐ ๐๐(75000๐ก − 2๐) = 0.464๐ ๐๐(75000๐ก − 2.15) 180 (j) (4%) What can you conclude about the effects of the filter considering your answers in (g) and (h)? For an input with frequency of 5000 rad/s, the amplitude is attenuated by a factor of 0.067; for 75000 rad/s, the amplitude is attenuated by 0.464. (k) (6%) Generate a time array for an lsim simulation of this transfer function for the input in (h); explain how you picked the final time and time increment. The largest time constant is 1/4380. So, the final time needs to be larger that 5/4380 = 0.0011. The output will be oscillating with a frequency of 5000 rad/s; so, to get at least 50 points per cycle of ๐๐ oscillation, we need a time increment of ๐๐๐๐(๐๐) = ๐. ๐๐(−๐); to get about 5 cycles after reaching steady state, the final time needs to be 0.0011 + ๐๐ ๐ ๐๐๐๐ = ๐. ๐๐๐๐. So, t = 0 : 2.5e-5 : 0.0074; (l) (6%) Using your time array and lsim to simulate your transfer function with the input in (h), plot V4(t). >> t=0:2.5e-5:0.0074; >> V4=lsim(G,V1,t); >> plot(t,V4) >> plot(t,V4,'r','linewidth',3) >> xlabel('Time, s','fontsize',16) >> ylabel('V_4(t), volts') >> grid 235 0.15 0.1 X: 0.006 Y: 0.05387 4 V (t), volts 0.05 0 -0.05 -0.1 -0.15 -0.2 0 1 2 3 4 5 6 7 Time, s 8 -3 x 10 (m) (6%) Does the steady state amplitude of V4(t) from your simulation agree with your answer in (h)? The prediction from the frequency response plot was 0.067 at approximately 5000 rad/s and the simulation steady state amplitude is very close at 0.05387. Also, abs(G(s))s=j5000 = 0.05396 which matches exactly the time response amplitude. The accuracy of reading the bode plot is the difference; increasing the resolution (not shown), at exactly 5000, 10^(-25.4/20) = 0.0537. Homework 46 The schematic of a block of iron with length L, width L/2 and height L/2 is shown below. A constant heat source qi is shown on the schematic entering the block at a central location towards the right end. Initially, the block is at the same temperature of the air Ta which is constant. As the block heats up, convection heat transfer occurs at all surfaces and conduction heat transfer occurs withing the block. A simple lumped parameter model for approximating the temperature distribution in the block is based on dividing the block into right and left halves and assuming the temperatures TL and TR are uniform in each half. Obviously, a more accurate model would be one divided into 3 or 4 or more parts. The equations for the heat transfer rates (๐๐ฟ๐ , ๐๐ ๐ , ๐๐ ๐ฟ ) and temperatures (๐๐ , ๐๐ฟ ) for this thermal model are given below. The constants a, b, and c are defined by the length L, specific heat Cp, thermal conductivity k and density ๐ of the mass and by the convection heat transfer coefficient h which are all known values. 1 1 1 (1) ๐๐ฟ − ๐๐ = ๐๐ฟ๐ (2) ๐๐ − ๐๐ = ๐๐ ๐ (3) ๐๐ − ๐๐ฟ = ๐๐ ๐ฟ ๐ ๐ ๐ (4) ๐๐ − ๐๐ ๐ฟ − ๐๐ ๐ = 1 ๐ฬ ๐ ๐ (5) ๐๐ ๐ฟ − ๐๐ฟ๐ = 1 ๐ฬ ๐ ๐ฟ qi 3L/4 L/4 L/4 236 Ta TL TR L/2 L/2 L/2 L/2 (a) (10%) Which of the 5 equations are algebraic and which are differential?_________________ (b) (30%) Defining x1 to be TR and x2 to be TL, express these equations in matrix state variable format shown below. Note, the format assumes there are three outputs of interest TR, TL and qRL and two inputs Ta and qi. ๐ฬ = ๐ด๐ + ๐ต๐ ๐ฅฬ ? ? ๐ฅ1 ? ? ๐๐ [ 1] = [ ] [๐ฅ ] + [ ][ ] ๐ฅฬ 2 ? ? 2 ? ? ๐๐ ๐ = ๐ถ๐ + ๐ท๐ ๐๐ ? ? ๐ฅ ? ? ๐ 1 [ ๐๐ฟ ] = [? ?] [๐ฅ ] + [? ?] [ ๐ ] ๐๐ 2 ๐๐ ๐ฟ ? ? ? ? (c) (20%) Using a = 1.7991e(-5) b = 21 and c = 62.5, enter these state variable equations in MATLAB and find the eigenvalues. ______________________ (d) (10%) Based on the eigenvalues and assuming the inputs are constant, how long would a simulation need to run for the solution to reach steady state? ______________________ (e) (20%) Use the command ss2f to get the transfer functions for the outputs of interest. For example, ๐๐ (๐ ) = [? ]๐๐ (๐ ) + [? ]๐๐ (๐ ) (f) (10%) Considering that the initial temperature of the block is 300 °K, Ta = 300 °K, and qi = 2000 W/s, draw estimates of the plots of TR(t) and TL(t). Hint: Use the DC gains of the transfer functions to get the final values. 237 Homework 46 Solution The schematic of a block of iron with length L, width L/2 and height L/2 is shown below. A constant heat source qi is shown on the schematic entering the block at a central location towards the right end. Initially, the block is at the same temperature of the air T a which is constant. As the block heats up, convection heat transfer occurs at all surfaces and conduction heat transfer occurs withing the block. A simple lumped parameter model for approximating the temperature distribution in the block is based on dividing the block into right and left halves and assuming the temperatures TL and TR are uniform in each half. Obviously, a more accurate model would be one divided into 3 or 4 or more parts. The equations for the heat transfer rates (๐๐ฟ๐ , ๐๐ ๐ , ๐๐ ๐ฟ ) and temperatures (๐๐ , ๐๐ฟ ) for this thermal model are given below. The constants a, b, and c are defined by the length L, specific heat Cp, thermal conductivity k and density ๐ of the mass and by the convection heat transfer coefficient h which are all known values. 1 (1) ๐๐ฟ − ๐๐ = ๐๐ฟ๐ ๐ 1 1 (2) ๐๐ − ๐๐ = ๐๐ ๐ (3) ๐๐ − ๐๐ฟ = ๐๐ ๐ฟ ๐ ๐ (4) ๐๐ − ๐๐ ๐ฟ − ๐๐ ๐ = 1 ๐ฬ ๐ ๐ (5) ๐๐ ๐ฟ − ๐๐ฟ๐ = 1 ๐ฬ ๐ ๐ฟ qi 3L/4 L/4 L/4 Ta TL TR L/2 L/2 L/2 L/2 (a) (10%) Which of the 5 equations are algebraic and which are differential? 1,2, 3 algebraic; 4,5 diff (b) (30%) Defining x1 to be TR and x2 to be TL, express these equations in matrix state variable format shown below. Note, the format assumes there are three outputs of interest TR, TL and qRL and two inputs Ta and qi. ๐ฬ = ๐ด๐ + ๐ต๐ ๐ฅ1 −๐(๐ + ๐) ๐๐ ๐ฅฬ ๐๐ ๐ ๐๐ [ 1] = [ ][ ] +[ ][ ] ๐๐ 0 ๐๐ ๐ฅฬ 2 ๐๐ −๐(๐ + ๐) ๐ฅ2 ๐ = ๐ถ๐ + ๐ท๐ 238 ๐๐ 1 0 ๐ฅ 0 0 ๐ 1 [ ๐๐ฟ ] = [0 1 ] [๐ฅ ] + [0 0] [ ๐ ] ๐๐ 2 ๐๐ ๐ฟ ๐ −๐ 0 0 (c) (20%) Using a = 1.7991e(-5) b = 21 and c = 62.5, enter these state variable equations in MATLAB and find the eigenvalues. -0.0018801 -0.0011245 A= -0.0015023 0.00037782 0.00037782 -0.0015023 eig(A) ans = -0.0018801 -0.0011245 (d) (10%) Based on the eigenvalues and assuming the inputs are constant, how long would a simulation need to run for the solution to reach steady state? 5/0.0011245 = 4446 s (e) (20%) Use the command ss2f to get the transfer functions for the outputs of interest. For example, [num,den]=ss2tf(A,B,C,D,1) [num,den]=ss2tf(A,B,C,D,2) num = 0 0.0011245 2.1141e-06 0 0.0011245 2.1141e-06 0 0 0 den = 1 0.0030046 2.1141e-06 num = 0 1.7991e-05 2.7028e-08 0 0 6.7976e-09 0 0.00037782 4.2485e-07 den = 1 0.0030046 2.1141e-06 ๐๐ (๐ ) = [ 0.0011245๐ + 2.1141๐ − 6 1.7991๐(−5)๐ + 2.7028๐ − 8 ] ๐๐ (๐ ) ] ๐๐ (๐ ) + [ 2 2 ๐ + 0.003๐ + 2.1141๐ − 6 ๐ + 0.003๐ + 2.1141๐ − 6 ๐๐ฟ (๐ ) = [ 0.0011245๐ + 2.1141๐ − 6 6.7976๐ − 9 ] ๐๐ (๐ ) + [ 2 ] ๐ (๐ ) 2 ๐ + 0.003๐ + 2.1141๐ − 6 ๐ + 0.003๐ + 2.1141๐ − 6 ๐ ๐๐ ๐ฟ (๐ ) = [0]๐๐ (๐ ) + [ 0.00037782๐ + 4.2485๐ − 7 ] ๐ (๐ ) ๐ 2 + 0.003๐ + 2.1141๐ − 6 ๐ 239 (f) (10%) Considering that the initial temperature of the block is 300 °K, Ta = 300 °K, and qi = 2000 W/s, draw estimates of the plots of TR(t) and TL(t). Hint: Use the DC gains of the transfer functions to get the final values. TR 326 TL 306 300 400 qRL 0 4446 t, s G=ss(A,B,C,D); DCgain=dcgain(G) DCgain = 1 0.012785 1 0.0032153 3.5527e-15 0.20096 thus, final value of TR =1*Ta + 0.012785*qi = 300 + 25.57 = 326 thus, final value of TL =1*Ta + 0.0032153*qi = 300 + 6.43 = 306 thus, final value of qRL =0*Ta + 0.2*qi = 400 % homework 10 3360 Fall 2020 format shortg K=84;Cp=452;h=200;L=0.5;den=7870; M=L^3*den/4; c=5*h*L^2/4 a=2/(Cp*M) b=K*L/2 A=[-a*(b+c) a*b;a*b -a*(b+c)] B=[a*c a;a*c 0] eig(A) C=[1 0;0 1;b -b] D=[0 0;0 0;0 0]; t=0:5:5000; Ta=300+0*t; qi=2000+0*t; G=ss(A,B,C,D); DCgain=dcgain(G) [num,den]=ss2tf(A,B,C,D,1) [num,den]=ss2tf(A,B,C,D,2) 240 Homework 47 In order to keep the inverted pendulum shown below vertical, the pendulum is attached to a cart that moves laterally with displacement z. The lateral movement results from a feedback control force Fi acting on the cart; the pendulum angle ๐ is measured with a sensor. The output from this sensor is ๐๐ = ๐ + ๐ where n is high frequency sensor noise that adds to the true angle ๐. The sensor output ๐๐ is the input to a control transfer function that generates the force Fi to move the cart. Since we are trying to keep the pendulum vertical (๐ = 0), the small angle assumption for ๐ is sufficiently accurate since ๐ should always be near zero. Ms ๏ฑ L z Fi Mc The small angle approximation differential equations for the pendulum and cart are (1) ๐ฬ = 8.1๐ − 0.5๐งฬ equation for pendulum considering the cart movement (2) ๐งฬ = −0.2๐ฬ − 0.09๐น๐ equation for the cart displacement considering the pendulum The desired equation for the control force consists of a proportional plus derivative transfer function, i.e. ๐น๐ (๐ ) = −⌈377 + 75.4๐ ⌉๐๐ (๐ ) However, since ๐๐ contains high frequency noise, the equation for the control force is modified to be a proportional plus bandlimited derivative transfer function, i.e. ๐น๐ (๐ ) = − ⌈377 + 75.4๐ ๐ +1 30 ⌉ ๐๐ (๐ ) which simplifies to (3) ๐น๐ (๐ ) = − [ 2639๐ +11310 ] [๐(๐ ) + ๐ +30 ๐(๐ )] Define G4(s) to be ๐บ4 (๐ ) = − [ 2639๐ + 11310 ] ๐ + 30 So, we have three equations (1), (2), and (3) with unknowns ๐, z, and Fi; the input to the system is n(t). 241 (a) (5%) The third equation contains a bandlimited differentiator. At what frequency does the filter theoretically begin to filter sensor noise in the bandlimited differentiator? ___________ (b) (10%) Laplace transform (1) assuming all initial conditions are zero; solve (1) for the transfer function relating ๐(๐ ) to Z(s), i.e. (4) ๐(๐ ) = ๐บ1 (๐ )๐(๐ ) ๐บ1 (๐ ) =? (c) (10%) Laplace transform (2) for all initial conditions zero and solve for Z(s), i.e. (5) ๐(๐ ) = −๐บ2 (๐ )๐(๐ ) − ๐บ3 (๐ )๐น๐ (๐ ) ๐บ2 (๐ ) =? ๐บ3 (๐ ) =? (d) (25%) Using the approach explained in the SIMULINK lecture, complete the block diagram below which links (3), (4), and (5) together; that is, insert the correct transfer functions in each box. ๐๐ฆ n Fi ๐ Z − + + G4 G3 − G1 G2 (e) (30%) Construct this diagram in SIMULINK with n(t) = 0.001sin(100t) and generate a 2.5 s plot of ๐(๐ก). Note, without noise, the pendulum would remain vertical. However, the noise will continually keep causing the pendulum to move off vertical and start to fall; but, the control force will cause the cart to move so as to hopefully keep bringing the pendulum back to vertical. (Copy and paste plot and MATLAB code here. Also, copy and paste your SIMULINK diagram here also.) (f) (10%) The results in (e) should be a steady state oscillation about vertical. What is the amplitude of this steady state oscillation? _________ What is the frequency of this oscillation? ________ (g) (10%) It can be shown that the dominate eigenvalues of the system with the feedback force to move the cart are −2.37 ± ๐2.73. Considering that the frequency of the noise is 100 rad/s, explain the rational for picking the filter frequency in (a). 242 Homework 47 Solution In order to keep the inverted pendulum shown below vertical, the pendulum is attached to a cart that moves laterally with displacement z. The lateral movement results from a feedback control force Fi acting on the cart; the pendulum angle ๐ is measured with a sensor. The output from this sensor is ๐๐ = ๐ + ๐ where n is high frequency sensor noise that adds to the true angle ๐. The sensor output ๐๐ is the input to a control transfer function that generates the force Fi to move the cart. Since we are trying to keep the pendulum vertical (๐ = 0), the small angle assumption for ๐ is sufficiently accurate since ๐ should always be near zero. Ms ๏ฑ L z Fi Mc The small angle approximation differential equations for the pendulum and cart are (1) ๐ฬ = 8.1๐ − 0.5๐งฬ equation for pendulum considering the cart movement (2) ๐งฬ = −0.2๐ฬ − 0.09๐น๐ equation for the cart displacement considering the pendulum The desired equation for the control force consists of a proportional plus derivative transfer function, i.e. ๐น๐ (๐ ) = −⌈377 + 75.4๐ ⌉๐๐ (๐ ) However, since ๐๐ contains high frequency noise, the equation for the control force is modified to be a proportional plus bandlimited derivative transfer function, i.e. ๐น๐ (๐ ) = − ⌈377 + 75.4๐ ๐ +1 30 ⌉ ๐๐ (๐ ) which simplifies to (3) ๐น๐ (๐ ) = − [ 2639๐ +11310 ] [๐(๐ ) + ๐ +30 ๐(๐ )] Define G4(s) to be ๐บ4 (๐ ) = − [ 2639๐ + 11310 ] ๐ + 30 So, we have three equations (1), (2), and (3) with unknowns ๐, z, and Fi; the input to the system is n(t). 243 (a) (5%) The third equation contains a bandlimited differentiator. At what frequency does the filter theoretically begin to filter sensor noise in the bandlimited differentiator? 30 rad/s (b) (10%) Laplace transform (1) assuming all initial conditions are zero; solve (1) for the transfer function relating ๐(๐ ) to Z(s), i.e. −0.5๐ 2 (4) ๐(๐ ) = ๐บ1 (๐ )๐(๐ ) ๐บ1 (๐ ) = 2 ๐ − 8.1 (c) (10%) Laplace transform (2) for all initial conditions zero and solve for Z(s), i.e. (5) ๐(๐ ) = −๐บ2 (๐ )๐(๐ ) − ๐บ3 (๐ )๐น๐ (๐ ) ๐บ2 (๐ ) = 0.2 ๐บ3 (๐ ) = 0.09 ๐ 2 (d) (25%) Using the approach explained in the SIMULINK lecture, complete the block diagram below which links (3), (4), and (5) together; that is, insert the correct transfer functions in each box. ๐๐ฆ n Fi ๐ Z − + + G4 G3 − G1 G2 (e) (30%) Construct this diagram in SIMULINK with n(t) = 0.001sin(100t) and generate a 2.5 s plot of ๐(๐ก). Note, without noise, the pendulum would remain vertical. However, the noise will continually keep causing the pendulum to move off vertical and start to fall; but, the control force will cause the cart to move so as to hopefully keep bringing the pendulum back to vertical. (Copy and paste plot and MATLAB code here. Also, copy and paste your SIMULINK diagram here also.) >> plot(out.Y(:,1),out.Y(:,2),'r','linewidth',3) >> ylabel('theta, rad','fontsize',20) >> xlabel('time, s','fontsize',20) 244 Plot generated using the default variable-step integration. Note, the sharpness in the peaks at steady state telling us that the step size is not small enough to accurately plot the solution associated with the input frequency of 100 rad/s. 245 Solution plot after changing to a fixed step solution method specifying that the step size be small enough to give at least 100 points every input cycle, i.e. [2๐ /๐๐๐]/๐๐๐ ≈ ๐. ๐๐๐. Note how the steady state solution now has an essentially constant amplitude with a frequency of [2๐ /(๐. ๐๐๐ − ๐. ๐๐)] ≈ ๐๐๐ which is the input frequency. (f) (10%) The results in (e) should be a steady state oscillation about vertical. What is the amplitude of this steady state oscillation? ≈ ๐. ๐๐(−๐) What is the frequency of this oscillation? ≈ 100 ๐๐๐/๐ (g) (10%) It can be shown that the dominate eigenvalues of the system with the feedback force to move the cart are −2.37 ± ๐2.73. Considering that the frequency of the noise is 100 rad/s, explain the rational for picking the filter frequency in (a). The filter frequency must be greater than the eigenvalue frequency or else the filter will prevent the control force from effectively stabilizing the pendulum. On the other hand, the filter frequency must be less than the noise frequency otherwise the noise will not be filtered. The filter frequency of 30 is at least 10 times the eigenvalue frequency and about 1/3 of the noise frequency. 246 Homework 48 A transfer function does not always represent the model of some engineering system. Instead, some transfer functions may have been designed to filter some measured signal. For example, consider all the radio station broadcast frequencies in the space around you. A radio has a bandpass filter transfer function that filters out all radio station frequencies except the frequency of the radio station that you want to listen to; the width of the frequency band in this case is very small so as to let only that one particular frequency pass for you to hear; the width of the band of frequencies passed through could be large however depending on the application. A low pass filter is designed to filter signals with high frequencies and only allow signals with low frequencies to pass through. A high pass filter is designed to filter signals with low frequencies and only allow signals with high frequencies to pass through. Example filter design problem It is usually very important to use a low pass filter on a signal containing high frequency noise before differentiating the signal since differentiating a high frequency signal produces very large values. For example, suppose a signal y(t) = 1sin(10t) is measured with a sensor. Suppose the output of the sensor, ys(t), however, contains low amplitude high frequency noise n(t), i.e. ๐๐ (๐) = ๐(๐) + ๐(๐) = ๐๐๐๐(๐๐๐) + ๐. ๐๐๐๐๐(๐๐๐๐๐) (a) (16%) What is the equation for ๐ฬ ๐ (๐) ? ________________ (b) (10%) What is the amplitude ๐ฬ (๐)? _________ (c) (10%) What is the amplitude ๐ฬ (๐)? ____________ (d) (10%) Even though the amplitude of n(t) is small compared to the amplitude of y(t), how do the amplitudes of their derivatives compare? ________________________________________________________________ ____________________________________________________________________ (e) (10%) Why is the presence of the noise a problem when differentiating a signal containing noise? _______________________________________________________________________ (f) The transfer function for differentiating ๐๐ (๐) to get ๐ฬ ๐ (๐) is [s]; that is ๐ฬ๐ (๐) = ๐ณ{๐ฬ ๐ } = [๐]๐๐ (๐) 247 A simple transfer function for low pass filtering and differentiating ๐๐ (๐) to minimize the effects of the high frequency noise is called a bandlimited differentiator and is shown below. ๐ฌ ๐๐ฌ ๐ฬ๐ฌ๐ (๐ฌ) = [ ๐ฌ ] ๐๐ (๐ฌ) = [ ] ๐ (๐ฌ) ๐ฌ+๐ ๐ + ๐ ๐ where ๐ is conventionally called the bandwidth frequency where the filtering begins. (20%) Generate the frequency responses for three bandlimited differentiators using values of ๐ equal to 100, 300, and 1000 rad/s; use the MATLAB command bode with all three plots on the same graph for comparison. (g) Suppose ๐(๐) = ๐. ๐๐๐๐๐(๐๐๐๐๐). Click with the mouse on the bode plots in part (f) and determine the amplitude of the filtered ๐ฬ (๐) if each of the bandlimited differentiators had been used to differentiate the filtered n(t). (g.1) (6%) ๐ = ๐๐๐ amplitude of ๐ฬ (๐) =? (g.2) (6%) ๐ = ๐๐๐ amplitude of ๐ฬ (๐) =? (g.3) (6%) ๐ = ๐๐๐๐ amplitude of ๐ฬ (๐) =? ๐=∞ ๐๐๐๐๐๐๐๐ ๐ ๐๐ ๐ฬ (๐) = ๐๐ ๐๐๐๐ ๐๐ ๐๐ ๐๐๐๐๐๐๐๐๐ (h) (6%) After reviewing the results obtained in part (g), what filter frequency,๐,would you suggest be used if the frequency of the noise is 1000 rad/s? Homework 48 Solution A transfer function does not always represent the model of some engineering system. Instead, some transfer functions may have been designed to filter some measured signal. For example, consider all the radio station broadcast frequencies in the space around you. A radio has a bandpass filter transfer function that filters out all radio station frequencies except the frequency of the radio station that you want to listen to; the width of the frequency band in this case is very small so as to let only that one particular frequency pass for you to hear; the width of the band of frequencies passed through could be large however depending on the application. A low pass filter is designed to filter signals with high frequencies and only allow signals with low frequencies to pass through. A high pass filter is designed to filter signals with low frequencies and only allow signals with high frequencies to pass through. 248 Example filter design problem It is usually very important to use a low pass filter on a signal containing high frequency noise before differentiating the signal since differentiating a high frequency signal produces very large values. For example, suppose a signal y(t) = 1sin(10t) is measured with a sensor. Suppose the output of the sensor, ys(t), however, contains low amplitude high frequency noise n(t), i.e. ๐๐ (๐) = ๐(๐) + ๐(๐) = ๐๐๐๐(๐๐๐) + ๐. ๐๐๐๐๐(๐๐๐๐๐) (a) (16%) What is the equation for ๐ฬ ๐ (๐) ? 10cos(10t)+10cos(1000t) (b) (10%) What is the amplitude ๐ฬ (๐)? 10 (c) (10%) What is the amplitude ๐ฬ (๐)? 10 (d) (10%) Even though the amplitude of n(t) is small compared to the amplitude of y(t), how do the amplitudes of their derivatives compare? The amplitudes are the same which means 50% of my derivative is associated with noise which totally invalidates my measured data. (e) (10%) Why is the presence of the noise a problem when differentiating a signal containing noise? Because the amplitude of the derivative of high frequency noise is proportional to the frequency causing huge errors unless the noise is first removed before differentiating. (f) The transfer function for differentiating ๐๐ (๐) to get ๐ฬ ๐ (๐) is [s]; that is ๐ฬ๐ (๐) = ๐ณ{๐ฬ ๐ } = [๐]๐๐ (๐) A simple transfer function for low pass filtering and differentiating ๐๐ (๐) to minimize the effects of the high frequency noise is called a bandlimited differentiator and is shown below. ๐ฌ ๐๐ฌ ๐ฬ๐ฌ๐ (๐ฌ) = [ ๐ฌ ] ๐๐ (๐ฌ) = [ ] ๐ (๐ฌ) ๐ฌ+๐ ๐ + ๐ ๐ where ๐ is conventionally called the bandwidth frequency where the filtering begins. (20%) Generate the frequency responses for three bandlimited differentiators using values of ๐ equal to 100, 300, and 1000 rad/s; use the MATLAB command bode with all three plots on the same graph for comparison. >> G100=tf([1 0],[1/100 1]); >> G300=tf([1 0],[1/300 1]); 249 >> G1000=tf([1 0],[1/1000 1]); >> bode(G100,G300,G1000,{10 10000}) 60 Magnitude (dB) System: G1000 Frequency (rad/s): 1.01e+03 Magnitude (dB): 57 Bode Diagram 50 System: G300 Frequency (rad/s): 1.03e+03 Magnitude (dB): 49.2 System: G100 Frequency (rad/s): 1.01e+03 Magnitude (dB): 40 40 30 20 Phase (deg) 10 90 45 0 1 10 2 3 10 4 10 10 Frequency (rad/s) (g) Suppose ๐(๐) = ๐. ๐๐๐๐๐(๐๐๐๐๐). Click with the mouse on the bode plots in part (f) and determine the amplitude of the filtered ๐ฬ (๐) if each of the bandlimited differentiators had been used to differentiate the filtered n(t). ๐๐/๐๐ (g.1) (6%) ๐ = ๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐๐ ๐ฬ (๐) = ๐. ๐๐ ∗ ๐๐ =๐ (g.2) (6%) ๐ = ๐๐๐ ๐๐๐๐๐๐๐๐ ๐ ๐๐ ๐ฬ (๐) = ๐. ๐๐ ∗ ๐๐ ๐๐.๐/๐๐ = ๐. ๐๐ ๐๐/๐๐ (g.3) (6%) ๐ = ๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐ ๐๐ ๐ฬ (๐) = ๐. ๐๐ ∗ ๐๐ = ๐. ๐๐ ๐=∞ ๐๐๐๐๐๐๐๐ ๐ ๐๐ ๐ฬ (๐) = ๐๐ ๐๐๐๐ ๐๐ ๐๐ ๐๐๐๐๐๐๐๐๐ (h) (6%) After reviewing the results obtained in part (g), what filter frequency, ๐, would you suggest be used if the frequency of the noise is 1000 rad/s? ๐ ≤ ๐๐๐ Homework 49 Consider the following differential equation for y(t) with input u(t): 2๐ฆฬ + 4๐ฆ = 6๐ขฬ ๐ฆ(0− ) = 0 ๐ข(0− ) = 0 U(t) 10 0 time (a) (5%)What is the time constant associated with this differential equation? (b) (5%) What is the Laplace transform of ๐ข(๐ก). 250 (c) (5%) What is the Laplace transform of ๐ขฬ (๐ก). (d) (10%) Laplace transform the differential equation and solve for Y(s). (e) (5%) Apply the final value theorem to Y(s). Does the theorem give the correct final value? Explain. (f) (5%) Apply the initial value theorem to Y(s). Does the theorem give the correct value? Explain. (g) (6%) Find the equation for y(t) by finding the inverse Laplace of Y(s) from (d). (pg.25) (4%) Substitute t = 0 and t = ∞ into your equation for y(t). Are these values correct? (h) (15%) Express the differential equation in state variable format for an ode45 numerical simulation to get ๐ฅฬ 1 = −2๐ฅ1 − 6๐ข. In terms of y and u, what is the equation definition for ๐ฅ1 ? (i) (10%) Draw a sketch of ๐ขฬ (๐ก). ๐ขฬ (๐ก) 0 1 time t (j) (10%) Explain why it would be impossible to do an ode45 simulation if the state variable equation for ๐ฅฬ 1 contained ๐ขฬ . (k) (15%) Generate an ode45 simulation and plot y(t). Plot on the same graph for comparison y(t) from (d). (l) (5%) How do the two plots in (k) compare? Homework 49 Solution Consider the following differential equation for y(t) with input u(t): 2๐ฆฬ + 4๐ฆ = 6๐ขฬ ๐ฆ(0− ) = 0 ๐ข(0− ) = 0 U(t) 10 0 time (a) (5%)What is the time constant associated with this differential equation? 0.5 s (b) (5%) What is the Laplace transform of ๐ข(๐ก). 10/s (c) (5%) What is the Laplace transform of ๐ขฬ (๐ก). sU(s) = 10 (d) (10%) Laplace transform the differential equation and solve for Y(s). 251 ๐๐๐(๐) + ๐๐(๐) = ๐๐๐ผ(๐) ๐(๐) = ๐๐ ๐๐ ๐๐ ๐๐ ๐๐ ๐ผ(๐) = = = ๐๐ + ๐ ๐๐ + ๐ ๐ ๐๐ + ๐ ๐ + ๐ (e) (5%) Apply the final value theorem to Y(s). Does the theorem give the correct final value? Explain. sY(s)s=0 = 0 Since the derivative of u is zero as time goes to infinity and since the derivative y goes to zero, solving for y(t) in the original differential equation gives y = 0 which confirms the final value theorem. (f) (5%) Apply the initial value theorem to Y(s). Does the theorem give the correct value? ๐๐๐ Explain. ๐(๐+ ) = ๐๐(๐)๐→∞ = (๐+๐) ๐→∞ =( ๐๐ ๐+ ๐ ๐ ) = ๐๐ ๐→∞ This is the correct value for ๐(๐+ ) which is different than ๐(๐− ) because of the derivative of a step which is an impulse at t = 0. (g) (6%) Find the equation for y(t) by finding the inverse Laplace of Y(s) from (d). ๐(๐) = (๐๐๐๐๐ ๐๐ ๐๐๐ ๐ = −๐) = ๐๐๐−๐๐ (4%) Substitute t = 0 and t = ∞ into your equation for y(t). Are these values correct? ๐(๐) = ๐๐๐−๐ = ๐๐ ๐(∞) = ๐๐๐−∞ = ๐ These are both correct. (h) (15%) Express the differential equation in state variable format for an ode45 numerical simulation to get ๐ฅฬ 1 = −2๐ฅ1 − 6๐ข. In terms of y and u, what is the equation definition for ๐ฅ1 ? ๐ฬ − ๐๐ฬ = −๐๐ Thus, ๐๐ = ๐ − ๐๐ So, ๐ฬ ๐ = −๐๐ = −๐(๐๐ + ๐๐) = −๐๐๐ − ๐๐ (i) (10%) Draw a sketch of ๐ขฬ (๐ก). ๐ขฬ (๐ก) ∞ Impulse with area 10 at t = 0 1 time t (j) (10%) Explain why it would be impossible to do an ode45 simulation if the state variable equation for ๐ฅฬ 1 contained ๐ขฬ . Because a value of infinity for zero length of time cannot be put into MATLAB as an equation for ๐ฬ (๐). 252 (k) (15%) Generate an ode45 simulation and plot y(t). Plot on the same graph for comparison y(t) from (d). Solution Hmwk 6 part k 30 inverse Laplace ode45 25 y(t) 20 15 10 5 0 0 0.5 1 1.5 2 2.5 time, s function Homework_6_3360_Fall_2020 format shortg [t,x]=ode45(@eqns,[0 2.5],[0]); Y=30*exp(-2*t); y=x(:,1)+3*10; plot(t,Y,'r*',t,y,'K','linewidth',2) xlabel('time, s','fontsize',18) ylabel('y(t)','fontsize',18) title('Solution Hmwk 6 part k','fontsize',18) legend('inverse Laplace','ode45') grid function dx=eqns(t,x) dx=zeros(1,1); dx(1)=-2*x(1)-6*10; end end (l) (5%) How do the two plots in (k) compare? The two plots are identical. 253 Homework #50 The magnitude of a ratio of complex numbers can be calculated by first finding magnitudes of the individual complex numbers and then multiplying and/or dividing them. Also, the angle of a ratio of complex numbers can be found by adding and/or subtracting the angles of the individual complex numbers. Consider the following ratio of complex numbers: ๐บ= (−2 + ๐3)(−4 − ๐8) 4๐(−6 + ๐10) (a) (20%) Find the magnitude of G, |๐บ|, using the MATLAB command ‘abs’. _________ (b) (20%) Use a calculator and find |๐บ| by finding the individual magnitudes and then the product and ratio of the magnitudes, i.e. |−2 + ๐3| ∗ |−4 − ๐8| ?∗? (−2 + ๐3)(−4 − ๐8) |๐บ| = | = = __________ |= |4๐| ∗ |−6 + ๐10| 4๐(−6 + ๐10) ?∗? (c) (5%) Confirm that a and b give the same answer. (d) (20%) Find the angle of G using the MATLAB command ‘angle’. angle(G) = ? (e) (20%) Use a calculator and the inverse tangent to get the angle of G, i.e. (−2 + ๐3)(−4 − ๐8) ๐๐๐๐๐ ( ) 4๐(−6 + ๐10) = ๐๐๐๐๐(−2 + ๐3) + ๐๐๐๐๐(−4 − ๐8) − ๐๐๐๐๐(4๐) − ๐๐๐๐๐(−6 + ๐10) = ? + ? − ? − ? = _____________ (f) (5%) confirm d and e give the same angle. (g) (10%) For s = -2+j4, use MATLAB to calculate the magnitude and angle of H. ๐ป= 3๐ +5 7๐ 3 +4๐ 2 +2๐ +10 magnitude = _____ angle = ___________ 254 Homework #50 Solution The magnitude of a ratio of complex numbers can be calculated by first finding magnitudes of the individual complex numbers and then multiplying and/or dividing them. Also, the angle of a ratio of complex numbers can be found by adding and/or subtracting the angles of the individual complex numbers. Consider the following ratio of complex numbers: ๐บ= (−2 + ๐3)(−4 − ๐8) 4๐(−6 + ๐10) (h) (20%) Find the magnitude of G, |๐บ|, using the MATLAB command ‘abs’. |๐| =0.69133 See code below. >> G=(-2+j*3)*(-4-j*8)/(4*j*(-6+j*10)) G = -0.63235 + 0.27941i >> Mg=abs(G) Mg = 0.69133 (i) (20%) Use a calculator and find |๐บ| by finding the individual magnitudes and then the product and ratio of the magnitudes, i.e. (−๐ + ๐ฃ๐)(−๐ − ๐ฃ๐) |−๐ + ๐ฃ๐| ∗ |−๐ − ๐ฃ๐| √๐ + ๐ ∗ √๐๐ + ๐๐ |๐| = | = |= |๐๐ฃ| ∗ |−๐ + ๐ฃ๐๐| ๐๐ฃ(−๐ + ๐ฃ๐๐) ๐ ∗ √๐๐ + ๐๐๐ = ๐. ๐๐๐๐ ∗ ๐. ๐๐๐๐ = ๐. ๐๐๐๐๐ ๐ ∗ ๐๐. ๐๐๐ (j) (5%) Confirm that a and b give the same answer. Same answer. (k) (20%) Find the angle of G using the MATLAB command ‘angle’. angle(G) = 2.7255 rad See code below. >> angle(G) ans = 2.7255 255 (l) (20%) Use a calculator and the inverse tangent to get the angle of G, i.e. (−2 + ๐3)(−4 − ๐8) ๐๐๐๐๐ ( ) 4๐(−6 + ๐10) = ๐๐ง๐ ๐ฅ๐(−๐ + ๐ฃ๐) + ๐๐ง๐ ๐ฅ๐(−๐ − ๐ฃ๐) − ๐๐ง๐ ๐ฅ๐(๐๐ฃ) − ๐๐ง๐ ๐ฅ๐(−๐ + ๐ฃ๐๐) 3 4 -2 -4 10 -6 -8 A calculator does not know if a negative sign is in the numerator or denominator; so, it gives an answer in quadrant 1 or quadrant 4, both are wrong. I always put positive numbers in a calculator and then figure out what the result means using the graph (see red angles on graphs above). = [๐ − ๐๐๐−๐ (๐/๐)] + [๐ + ๐๐๐−๐ (๐/๐)] − ๐ − [๐ − ๐๐๐−๐ (๐๐/๐)] ๐ = ๐. ๐๐๐๐ (m) (5%) confirm d and e give the same angle. Same answer (n) (10%) For s = -2+j4, use MATLAB to calculate the magnitude and angle of H. ๐= ๐๐ฌ+๐ ๐๐ฌ ๐ +๐๐ฌ ๐ +๐๐ฌ+๐๐ magnitude = 0.020134 angle = 1.98387 rad >> s=-2+j*4; >> H=(3*s+5)/(7*s^3+4*s^2+2*s+10) H = -0.0072407 + 0.018787i >> abs(H) ans = 0.020134 >> angle(H) ans = 1.9387 256 Homework #51 1.(a) Repeat the Euler’s integration portion of Quiz 12 on page 97 in this book but starting with an initial value of 3 instead of 1. (5%) Before doing the integration steps, draw an estimate of the plot for x(t). (20%) For the differential equation below, use Euler’s numerical integration to compute the first two solution values of x(t) using a time step of T = 0.01. ๐ฑฬ + ๐๐๐ฑ = ๐๐ Time t x(t) 0 3 ๐ฑ(๐− ) = ๐ ๐ฬ (๐) = ๐๐ − ๐๐๐(๐) x(t+T)=x(t)+T๐ฬ (๐) 0.01 0.02 (b) (20%) Use separation of variables to get the exact answer x(t) at t = 0.02. (5%) What is the percent error of the Euler solution at t = 0.02? 2. See Quiz 31 on page 110 in the problems text. 257 A spring-mass –damper system is shown below; the displacement of the mass is z. z spring damper mass The differential equation for the position of the mass is as follows ๐งฬ + 0.1๐งฬ + 0.01๐ง = 0 ๐ง(0− ) = 0 ๐ ๐งฬ (0− ) = 2 ๐/๐ (c) (10%) Draw an estimate of z(t). (d) (15%) Define state variables for this 2nd order differential equation and then write the derivative equations for the state variables, i.e. ๐ฅ1 =? ๐ฅฬ 1 =? ๐ฅ2 =? ๐ฅฬ 2 =? (e) (25%) Complete the first two time steps of the Euler numerical integration solution of these state variable equations to get values of the state variables after two time steps of โ๐ก = 1 sec. t ๐ฅ1 (๐ก) ๐ฅ2 (๐ก) ๐ฅฬ 1 (๐ก) ๐ฅฬ 2 (๐ก) ๐ฅ1 (๐ก + โ๐ก) = ๐ฅ1 (๐ก) + โ๐ก๐ฅฬ 1 (๐ก) ๐ฅ2 (๐ก + โ๐ก) = ๐ฅ2 (๐ก) + โ๐ก๐ฅฬ 2 (๐ก) 0 1 2 258 Homework #51 Solution 1.(a) Repeat the Euler’s integration portion of Quiz 12 on page 97 in the problems text but starting with an initial value of 3 instead of 1. (5%) Before doing the integration steps, draw an estimate of the plot for x(t). The initial value is 3; setting ๐ฑฬ =0 gives the final value of 2; the time constant is 0.1 s. So, 5*0.1 = 0.5 s. 3 x(t) 2 0 0.5 (20%) For the differential equation below, use Euler’s numerical integration to compute the first two solution values of x(t) using a time step of T = 0.01. ๐ฑฬ + ๐๐๐ฑ = ๐๐ ๐ฑ(๐− ) = ๐ ๐ฬ (๐) = ๐๐ − ๐๐๐(๐) x(t+T)=x(t)+T๐ฬ (๐) Time t x(t) 0 3 20-10*3=-10 3+0.01*(-10)=2.9 0.01 2.9 20-10*2.9=-9 2.9+0.01*(-9)=2.81 0.02 2.81 (b) (20%) Use separation of variables to get the exact answer x(t) at t = 0.02. ๐๐ฑ + ๐๐๐ฑ = ๐๐ ๐ ๐ ๐ฑ(๐− ) = ๐ ๐๐ฑ = (๐๐ − ๐๐๐ฑ)๐๐ญ ๐ฅ ๐ก ๐๐ฅ ∫ = ∫ ๐๐ก 3 20 − 10๐ฅ 0 259 ๐๐๐ ๐ = ๐๐๐ − ๐๐ ๐๐๐๐ ๐ ๐ = ๐๐๐ ๐ ๐๐๐(๐)−๐๐ ∫ ๐๐(๐)−๐๐ ๐ ๐ ๐ = − ∫ ๐ ๐ ๐๐๐ ๐ ๐๐(๐๐๐(๐) − ๐๐) − ๐๐(๐๐) = −๐๐๐ ๐๐๐(๐) − ๐๐ ๐๐ ( ) = −๐๐ ๐๐ ๐๐๐(๐) − ๐๐ = ๐−๐๐๐ ๐๐ ๐ฅ(๐ก) = 2 + ๐ −10๐ก Checking the answer at t = 0 and at t = ∞ gives x(0) = 3 and x(∞) = 2 ๐๐๐ ๐ก = 0.02, ๐ฅ(0.02) = 2 + ๐ −0.2 = 2.8187 (5%) What is the percent error of the Euler solution at t = 0.02? (2.8187-2.81)/2.8187 = 0.0031 (0.31% error) Note, you can always check your solution by substituting it back into the original differential equation and see if it satisfies it. ๐(๐ + ๐−๐๐๐ ) + ๐๐(๐ + ๐−๐๐๐ ) = −๐๐๐−๐๐๐ + ๐๐ + ๐๐๐−๐๐๐ = ๐๐ ๐ ๐ Which checks and confirms the solution. 260 2. See Quiz 31 on page 110 in the problems text. A spring-mass –damper system is shown below; the displacement of the mass is z. z spring mass damper The differential equation for the position of the mass is as follows ๐งฬ + 0.1๐งฬ + 0.01๐ง = 0 ๐ง(0− ) = 0 ๐ ๐งฬ (0− ) = 2 ๐/๐ (f) (10%) Draw an estimate of z(t). Note, the time constant is 20 s. z(t) 0 100 t nd (g) (15%) Define state variables for this 2 order differential equation and then write the derivative equations for the state variables, i.e. ๐ฅ1 = ๐ง ๐ฅฬ 1 = ๐ฅ2 ๐ฅ2 = ๐งฬ ๐ฅฬ 2 = −0.01๐ฅ1 − 0.1๐ฅ2 (h) (25%) Complete the first two time steps of the Euler numerical integration solution of these state variable equations to get values of the state variables after two time steps of โ๐ก = 1 sec. ๐ฅ1 (๐ก) ๐ฅฬ 2 (๐ก) ๐ฅ1 (๐ก + โ๐ก) = ๐ฅ1 (๐ก) + โ๐ก๐ฅฬ 1 (๐ก) ๐ฅ2 (๐ก + โ๐ก) = ๐ฅ2 (๐ก) + โ๐ก๐ฅฬ 2 (๐ก) ๐ฅ2 (๐ก) ๐ฅฬ 1 (๐ก) 0 0 2 2 -0 – 0.1*2=-0.2 0+1*2=2 2+1*(-0,2)=1.8 1 2 1.8 1.8 -0.01*2-0.1*1.8 = -0.2 2+1*1.8 = 3.8 1.8+1*(-0.2)=1.6 t 261 Homework #52 The schematic for an impact barrier for a car is shown below. Typically, these barriers are constructed of components that collapse storing and dissipating energy. For example, partially filled barrels of water; on impact, air in the barrels is compressed softening the impact by storing energy while the water being forced out of the crushed barrels dissipates energy. In the schematic, the spring represents the component that stores the energy and the damper represents the component that dissipates the energy. The barrier design specifications are to stop a car with a maximum deceleration not greater than 4 g’s while avoiding a total collapse of the barrier (D=10 m). If the barrier totally collapses before the forward velocity goes to zero, there will likely be very high g’s and damage to the car. Obviously, the possibility of satisfying the design specifications depends on the size and speed of the car. D K b Impact Barrier System A demo MATLAB m-file for simulating the performance of this barrier is provided in the 4th module in Canvas and can be downloaded for execution in MATLAB; this code is also listed at the end of this assignment. Assignment objectives The first objective of this homework assignment is to teach valuable coding techniques associated with ode45 using this demo function file. The students are to study the code and be able to explain the purpose of each line; as with the many examples in the books, the code can be used as a template for slight modifications for future simulation problems. The second objective of this homework assignment is to perform slightly modified versions of this code to determine how values of b affect the performance of the barrier in regard to meeting the design specifications for a particular size car and particular impact velocity. 262 Model for the barrier system Assuming that the car has just contacted the yellow bumper with initial velocity Vo, the differential equation for the forward displacement y of the car and bumper moving as if stuck together is as follows: ๐๐ฆฬ + ๐๐ฆฬ + ๐พ๐ฆ = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = ๐๐ ๐ฆ(๐ก) < ๐ท ๐ฆฬ (๐ก) > 0 The model is observed to be a 2nd order linear differential equation that is only valid if ๐ฆ(๐ก) < ๐ท. The impact with the bumper is assumed to be at ๐ฆ(0− ) = 0 with initial impact velocity ๐ฆฬ (0− ) = ๐๐ . Before doing any simulations, it is important to understand the model and predict the results of a valid simulation. First of all, this is not a simulation where the variables will reach steady state. For example, a plot of y(t) should start at 0 and hopefully never reach the value D before ๐ฆฬ (๐ก) goes to zero. Also, if ๐ฆฬ (๐ก) reaches zero, it means the forward movement of the car has ended and the simulation should stop since the barrier will be permanently crushed and the equation is no longer valid; that is, even if the car would in reality bounce back, the car and bumper would no longer be in contact. It is also important to predict values for the deceleration (-๐ฆฬ ) of the car. Solving the equation for −๐ฆฬ gives −๐ฆฬ = (๐๐ฆฬ + ๐พ๐ฆ)/๐. At time = 0, −๐ฆฬ (0) = [๐๐ฆฬ (0− ) + ๐พ๐ฆ(0− )]/๐ = ๐๐ฆฬ (0− )/๐ So, if it is important for the deceleration to not exceed 4g’s, then, for certain, selection of b for an initial velocity and car mass must satisfy ๐< 4๐๐ 4๐๐ − = ๐ฆฬ (0 ) ๐๐ We don’t know if the deceleration will decrease or increase from this value; we only know that b cannot be greater than this value otherwise we are guaranteed of not meeting the design specification. This is the initial guess for a value of b using the simulation code provided with this assignment. (4) (25%) Define state variables and write the state variable derivative equations in terms of M, b, and K required for an ode45 simulation. Confirmed that you have done it correctly by examining the dx function in the MATLAB code. What are the state variable initial conditions? 263 (5) (25%) Execute the MATLAB code provided for this assignment. What are the parameter values used in the code? M = _______ K = ________ Vo = ______ D = ____ b = _________ For these parameter values, does the design meet the performance specifications? _____ Explain why or why not by showing and referring to the plot. Use the ‘data cursor’. (6) (50%) By trial-and-error, find the smallest value of b that can be used and still meet the design specifications for the same values of M, K, Vo and D. bmin = _______ Use the ‘data cursor’ to label the peak value of deceleration. %Always add comments before the first command to explain how to use %the function. These comments will appear if you type 'help functionname' %in the command window. For example: >> help Homework_52 function Homework_52 clear all%makes sure all memory is clear at start of simulation options=odeset('events',@StopSim);%look of event to be defined in function StopSim M=1000;K=2000;Vo=23;D=10;g=9.81;% Fixed parameter values b=4*M*g/Vo %b design parameter value to be determined [t,x]=ode45(@eqns,[0 3],[0 Vo],options);%runs simulation with events to % stop it. Final time = 3 guessing this is more than enough needed % initial values of state variables of 0 and Vo. y=x(:,1);yd=x(:,2);ydd=-(b*yd+K*y)/M;%Assigning natural variable names %to the outputs of interest. plot(t,y/D,'r',t,yd/Vo,'k--',t,-ydd/g,'r.','linewidth',2)% Note that the % variables being plotted have been normalized so they can go on a % single plot for easy comparison. Without normalizing, resolution % for some data will be lost and the results worthless. grid xlabel('time, s','fontsize',18) ylabel('normalized variables','fontsize',18) legend('normalized displacement, y/D','normalized velocity, y_d/V_o',... 'normalize deceleration, y_d_d/g','location','best')%The underscore prints %prints a subscript; use ^ for superscripts; use \ for greek symbols, %for example \phi or \PHI. Click on figure properties under 'Edit' in %a plot to edit the size of the axis which will change the legend fonts. function dx=eqns(t,x) Y=x(1);Yd=x(2);%So we can write dx equations %in terms of natural variables Y and Yd dx=zeros(2,1);%Basically defines how many dx equations to look for dx(1)=Yd;%We could have used dx(1)=x(2)but then %we would have to remember the definition of x(2) dx(2)=-(b*Yd+K*Y)/M;%Note, this is the equation for acceleration %which will be needed when generating the plots end function [Val,Ister,Dir]=StopSim(t,x) %there are two possible events to stop the simulation before final time Ister(1)=1;Val(1)=D-x(1);Dir(1)=-1;%Stops the simulation if x(1)=D Ister(2)=1;Val(2)=x(2);Dir(1)=-1;%Stops the simulation if x(2)=0 end end 264 Homework #52 Solution The schematic for an impact barrier for a car is shown below. Typically, these barriers are constructed of components that collapse storing and dissipating energy. For example, partially filled barrels of water; on impact, air in the barrels is compressed softening the impact by storing energy while the water being forced out of the crushed barrels dissipates energy. In the schematic, the spring represents the component that stores the energy and the damper represents the component that dissipates the energy. The barrier design specifications are to stop a car with a maximum deceleration not greater than 4 g’s while avoiding a total collapse of the barrier (D=10 m). If the barrier totally collapses before the forward velocity goes to zero, there will likely be very high g’s and damage to the car. Obviously, the possibility of satisfying the design specifications depends on the size and speed of the car. D K b Impact Barrier System A demo MATLAB m-file for simulating the performance of this barrier is provided in the 4th module in Canvas and can be downloaded for execution in MATLAB; this code is also listed at the end of this assignment. Assignment objectives The first objective of this homework assignment is to teach valuable coding techniques associated with ode45 using this demo function file. The students are to study the code and be able to explain the purpose of each line; as with the many examples in the books, the code can be used as a template for slight modifications for future simulation problems. The second objective of this homework assignment is to perform slightly modified versions of this code to determine how values of b affect the performance of the barrier in regard to meeting the design specifications for a particular size car and particular impact velocity. 265 Model for the barrier system Assuming that the car has just contacted the yellow bumper with initial velocity Vo, the differential equation for the forward displacement y of the car and bumper moving as if stuck together is as follows: ๐๐ฆฬ + ๐๐ฆฬ + ๐พ๐ฆ = 0 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = ๐๐ ๐ฆ(๐ก) < ๐ท ๐ฆฬ (๐ก) > 0 The model is observed to be a 2nd order linear differential equation that is only valid if ๐ฆ(๐ก) < ๐ท. The impact with the bumper is assumed to be at ๐ฆ(0− ) = 0 with initial impact velocity ๐ฆฬ (0− ) = ๐๐ . Before doing any simulations, it is important to understand the model and predict the results of a valid simulation. First of all, this is not a simulation where the variables will reach steady state. For example, a plot of y(t) should start at 0 and hopefully never reach the value D before ๐ฆฬ (๐ก ) goes to zero. Also, if ๐ฆฬ (๐ก ) reaches zero, it means the forward movement of the car has ended and the simulation should stop since the barrier will be permanently crushed and the equation is no longer valid; that is, even if the car would in reality bounce back, the car and bumper would no longer be in contact. It is also important to predict values for the deceleration (-๐ฆฬ ) of the car. Solving the equation for −๐ฆฬ gives −๐ฆฬ = (๐๐ฆฬ + ๐พ๐ฆ)/๐. At time = 0, −๐ฆฬ (0) = [๐๐ฆฬ (0− ) + ๐พ๐ฆ(0− )]/๐ = ๐๐ฆฬ (0− )/๐ So, if it is important for the deceleration to not exceed 4g’s, then, for certain, selection of b for an initial velocity and car mass must satisfy 4๐๐ 4๐๐ ๐< − = ๐ฆฬ (0 ) ๐๐ We don’t know if the deceleration will decrease or increase from this value; we only know that b cannot be greater than this value otherwise we are guaranteed of not meeting the design specification. This is the initial guess for a value of b using the simulation code provided with this assignment in part (2) to get the first graph. (7) (25%) Define state variables and write the state variable derivative equations in terms of M, b, and K required for an ode45 simulation. Confirmed that you have done it correctly by examining the dx function in the MATLAB code. What are the state variable initial conditions? ๐พ๐ฅ1 ๐๐ฅ2 ๐ฅ1 = ๐ฆ ๐ฅ2 = ๐ฆฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = − − ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 24 ๐ ๐ (8) (25%) Execute the MATLAB code provided for this assignment. What are the parameter values used in the code? M = 1000 kg K = 2000 N/m Vo = 24 m/s D = 10 m For b = 0.75(4Mg/Vo)=1226 Ns/m, the graph is shown below. 266 Using b=0.75*4Mg/Vo the velocity=0 at y=10m 3.5 normalized variables 3 X: 0.1635 Y: 3.104 2.5 normalized displacement, y/D normalized velocity, y d/Vo 2 normalize deceleration, y dd/g 1.5 X: 0.8807 Y: 0.989 1 0.5 X: 0.8807 Y: 0 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 time, s For these parameter values, does the design meet the performance specifications? Yes Explain why or why not by showing and referring to the plot. Use the ‘data cursor’. As shown in the figure above, the normalized displacement is only 0.989 which means y=9.89 m which is less than 10 m when the velocity goes to zero. The peak deceleration is 3.104 g’s. %Always add comments before the first command to explain how to use %the function. These comments will appear if you type 'help functionname' %in the command window. For example: >> help Homework_3_3360_Spr_2021 function Homework_3_3360_Spr_2021 clear all%makes sure all memory is clear at start of simulation format shortg % my preferred format options=odeset('events',@StopSim);%look of event to be defined in function StopSim M=1000;K=2000;Vo=24;D=10;g=9.81;% Fixed parameter values b=0.75*4*M*g/Vo %b design parameter value to be determined [t,x]=ode45(@eqns,[0 3],[0 Vo],options);%runs simulation with events to % stop it. Final time = 3 guessing this is more than enough needed % initial values of state variables of 0 and Vo. y=x(:,1);yd=x(:,2);ydd=-(b*yd+K*y)/M;%Assigning natural variable names %to the outputs of interest. plot(t,y/D,'r',t,yd/Vo,'k--',t,-ydd/g,'r.','linewidth',2)% Note that the % variables being plotted have been normalized so they can go on a % single plot for easy comparison. Without normalizing, resolution % for some data will be lost and the results worthless. grid xlabel('time, s','fontsize',18) 267 ylabel('normalized variables','fontsize',18) legend('normalized displacement, y/D','normalized velocity, y_d/V_o',... 'normalize deceleration, y_d_d/g','location','best')%The underscore prints %prints a subscript; use ^ for superscripts; use \ for greek symbols, %for example \phi or \PHI. Click on figure properties under 'Edit' in %a plot to edit the size of the axis which will change the legend fonts. function dx=eqns(t,x) Y=x(1);Yd=x(2);%So we can write dx equations %in terms of natural variables Y and Yd dx=zeros(2,1);%Basically defines how many dx equations to look for dx(1)=Yd;%We could have used dx(1)=x(2)but then %we would have to remember the definition of x(2) dx(2)=-(b*Yd+K*Y)/M;%Note, this is the equation for acceleration %which will be needed when generating the plots end function [Val,Ister,Dir]=StopSim(t,x) %there are two possible events to stop the simulation before final time Ister(1)=1;Val(1)=D-x(1);Dir(1)=-1;%Stops the simulation if x(1)=D Ister(2)=1;Val(2)=x(2);Dir(1)=-1;%Stops the simulation if x(2)=0 end end (50%) By trial-and-error, find the smallest value of b that can be used and still meet the design specifications for the same values of M, K, Vo and D. As shown on the plot below using b = (0.73)4Mg/Vo = 1193.6 Ns/m the performance is slightly out of specifications since y/D reaches 1 and the velocity is still not zero. Use the ‘data cursor’ to label the peak value of deceleration. 3.057 g’s still within spec. Based on this result, the minimum value of b is 0.74 or 0.75 times 4Mg/Vo. 268 Using b=0.73*4Mg/Vo 3.5 normalized variables 3 X: 0.2385 Y: 3.057 2.5 normalized displacement, y/D normalized velocity, y d/Vo 2 normalize deceleration, y dd/g 1.5 X: 0.8627 Y: 1 1 0.5 X: 0.8627 Y: 0.01914 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 time, s The next plot demonstrates what happens if the value of b is 25% greater than 4Mg/Vo, i.e. B = 1.25(4Mg/Vo). The velocity does reach zero at the 7.6 m displacement, which is within specifications, but the peak deceleration is 5 g’s. Using b=1.25*4Mg/Vo the velocity=0 at y=10m 5 normalized variables normalized displacement, y/D normalized velocity, y d/Vo 4 normalize deceleration, y dd/g 3 2 X: 0.7764 Y: 0.7642 1 0 X: 0.7807 Y: -3.238e-17 -1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 time, s 269 Homework #53 1. (20%) Use the quadratic formula to factor each characteristic polynomial below to find the eigenvalues and time constants. For complex eigenvalues, determine the damping ratio and the undamped natural frequency. In each case, check the results by remultiplying to see if you get the original polynomial. Note, using a calculator or computer to factor these polynomials will be a mistake because you won’t be able to use one on an exam and you will need to have memorized the quadratic formula and the following general form: ๐ฌ๐ + ๐๐ ๐๐ง ๐ฌ + ๐๐๐ง Polynomial ๐ซ๐ + ๐๐ซ + ๐๐ ๐๐ซ๐ + ๐๐๐ซ + ๐๐ ๐๐ + ๐๐ + ๐๐ ๐๐๐ + ๐๐๐ + ๐๐ (๐ + ๐)๐ + ๐๐ Eigenvalues Time constant Damping ratio ๐น Undamped natural frequency ๐๐ 2. This problem is the same as Homework 30 on page 186 in the problems book with a slight addition associated with a linearized solution for accuracy comparison. An impact barrier for a car is shown below. When the car contacts the gray bumper, the yellow piston starts moving forward compressing the fluid in the cylinder due to the movement of the piston to the left. Also, the rise in pressure forces the fluid through the orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a rubber ball or balloon filled with air has been placed in the water in the cylinder to increase the compressibility of the fluid in the cylinder. y Q 10 water air The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow rate Q m3/s are as follows: ๐ฬ + (๐๐๐๐−๐ )๐ท = ๐ (๐๐ − ๐)๐ทฬ = (๐๐๐๐๐ )(๐. ๐๐๐ฬ − ๐ธ) ๐ธ = (๐. ๐๐๐๐−๐ )√|๐ท| ∗ ๐๐๐๐(๐ท) ๐(๐− ) = ๐ ๐ ๐ฬ (๐− ) = ๐๐ ๐/๐ ๐ท(๐− ) = ๐ ๐ต/๐๐ 270 In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1 if P<0. Thus, Q can be positive or negative without computing errors associated with calculating the square root of negative numbers. Use g = 9.81 m/s2. (e) (5%) What are the unknowns in these equations? (f) (20%) Define state variables and write the derivative equations for your state variables in a suitable format for ode45. (g) (20%) Create a MATLAB ode45 numerical simulation of these equations and plot on the same graph ๐(๐)/๐๐, ๐ฬ (๐)/๐๐, ๐๐๐ ๐ฬ (๐)/๐. Use event functions to end the simulation should ๐(๐) ๐ข๐ง๐๐ซ๐๐๐ฌ๐๐ฌ ๐ญ๐จ ๐๐ ๐จ๐ซ ๐ฬ (๐) ๐ ๐๐๐๐๐๐๐๐ ๐๐ ๐. (h) (5%) From examination of your plots, what can you conclude about the performance of this barrier system? For example, does it meet the design specifications? (i) (20%) Repeat (c) but this time use a linear approximation for the equation for Q; approximate √๐ท with a straight-line for values of P between the initial value and the maximum value observed in (c); use the command ‘max(P)’ to get the maximum value. Use the ‘hold on’ command to put these plots on the same graph in (c) for comparison using red for the nonlinear model and black for the linear approximation model. (j) (5%) What can you say about the accuracy of the linearized solution? (5%) Why does the linearized solution run longer? Suggested portion of MATAB code for running and plotting both models on same graph: [t,X]=ode45(@barrier3360,[0 2],[0 24 0],options); plot(t,X(:,1)/10,'r-',t,X(:,2)/24,'r--',t,(5e-5)*X(:,3)/9.8,'r:','LineWidth',2) hold on clear t X [t,X]=ode45(@barrier3360L,[0 2],[0 24 0],options); plot(t,X(:,1)/10,'k-',t,X(:,2)/24,'k--',t,(5e-5)*X(:,3)/9.8,'k:','LineWidth',2) xlabel('Time, sec.','fontsize',18) ylabel('Normalized outputs of interest','fontsize',18) title('Homework 4, Crash Barrier Simulation','fontsize',18) legend('nonlinear displacement/10','nonlinear velocity/24','nonlinear deceleration/g',... 'linear displacement/10','linear velocity/24',... 'linear deceleration/g','Location','Best') grid 271 Homework #53 Solution 1. (20%) Use the quadratic formula to factor each characteristic polynomial below to find the eigenvalues and time constants. For complex eigenvalues, determine the damping ratio and the undamped natural frequency. In each case, check the results by remultiplying to see if you get the original polynomial. Note, using a calculator or computer to factor these polynomials will be a mistake because you won’t be able to use one on an exam and you will need to have memorized the quadratic formula and the following general form: ๐ฌ๐ + ๐๐ ๐๐ง ๐ฌ + ๐๐๐ง Eigenvalues Time constant(s) Damping ratio ๐น Undamped natural frequency ๐๐ rad/s ๐ 0.5 and 0.2 Not applicable Not applicable ๐ซ + ๐๐ซ + ๐๐ -2 and -5 ๐ 0.5 and 0.2 Not applicable Not applicable ๐๐ซ + ๐๐๐ซ + ๐๐ -2 and -5 ๐ 0.333 0.6 5 −3 ± ๐4 ๐ + ๐๐ + ๐๐ ๐ 0.333 0.6 5 −3 ± ๐4 ๐๐ + ๐๐๐ + ๐๐ ๐ ๐ 0.333 0.6 5 −3 ± ๐4 (๐ + ๐) + ๐ Note: Frequencies and damping ratios only have meaning for complex roots. Polynomial 2. This problem is the same as Homework 30 on page 186 in the problems book with a slight addition associated with a linearized solution for accuracy comparison. An impact barrier for a car is shown below. When the car contacts the gray bumper, the yellow piston starts moving forward compressing the fluid in the cylinder due to the movement of the piston to the left. Also, the rise in pressure forces the fluid through the orifice represented by flow rate Q out of the cylinder. Hopefully, the barrier will stop a car with an initial impact speed of 24 m/s without the deceleration exceeding 5 g’s and without total barrier collapse corresponding to y = 10 m. To decrease the g levels of deceleration, a rubber ball or balloon filled with air has been placed in the water in the cylinder to increase the compressibility of the fluid in the cylinder. y Q 10 water air The equations for the displacement y of the piston and car, for the pressure P in the cylinder, and for the flow rate Q m3/s are as follows: ๐ฬ + (๐๐๐๐−๐ )๐ท = ๐ (๐๐ − ๐)๐ทฬ = (๐๐๐๐๐ )(๐. ๐๐๐ฬ − ๐ธ) ๐ธ = (๐. ๐๐๐๐−๐ )√|๐ท| ∗ ๐๐๐๐(๐ท) ๐(๐− ) = ๐ ๐ ๐ฬ (๐− ) = ๐๐ ๐/๐ ๐ท(๐− ) = ๐ ๐ต/๐๐ 272 In the equation for Q, ‘sign(P)’ is a programming command that produces +1 if P>0 and -1 if P<0. Thus, Q can be positive or negative without computing errors associated with calculating the square root of negative numbers. Use g = 9.81 m/s2. (k) (5%) What are the unknowns in these equations? y, P and Q (l) (20%) Define state variables and write the derivative equations for your state variables in a suitable format for ode45. x1 = y x2 = yฬ x3 = P Writing the derivatives in terms of the natural variables for clarification and checking: function dx=barrier3360(t,x) dx=zeros(3,1); y=x(1);yd=x(2);P=x(3);%Allows writing dx eqn’s using natural variables ๐ = (๐. ๐๐ฑ๐๐−๐ )√|๐| ∗ ๐ฌ๐ข๐ ๐ง(๐); ๐ ๐(๐) = ๐๐ ; ๐ ๐(๐) = −(๐๐ − ๐) ∗ ๐ท; ๐ ๐(๐) = (๐๐๐) ∗ (๐. ๐๐ ∗ ๐๐ − ๐ธ)/(๐๐ − ๐); end (m)(20%) Create a MATLAB ode45 numerical simulation of these equations and plot on the same graph ๐ฆ(๐ก)/10, ๐ฆฬ (๐ก)/24, ๐๐๐ ๐ฆฬ (๐ก)/๐. Use event functions to end the simulation should ๐ฆ(๐ก) increases to 10 or ๐ฆฬ (๐ก) ๐๐๐๐๐๐๐ ๐๐ ๐ก๐ 0. Graph and code shown below. (n) (5%) From examination of your plots, what can you conclude about the performance of this barrier system? For example, does it meet the design specifications? It stops the car before the barrier bottoms out but the deceleration is slightly greater than 5 g’s. So, it doesn’t totally meet the design specifications. (o) (20%) Repeat (c) but this time use a linear approximation for the equation for Q; approximate √๐ with a straight-line for values of P the initial value and the maximum value observed in (c); use the command ‘max(P)’ to get the maximum value. Use the ‘hold on’ command to put these plots on the same graph in (c) for comparison using red for the nonlinear model and black for the linear approximation model. See graph and code below. Pmax was found to be 1.087e6. √๐ท ≈ ๐ท/√๐. ๐๐๐๐๐ (p) (5%) What can you say about the accuracy of the linearized solution? The linearized solution is reasonably accurate. (5%) Why does the linearized solution run longer? It runs longer because the displacement never reaches 10 m and the velocity is exponentially approaching zero but never gets there. 273 Homework 4, Crash Barrier Simulation Normalized outputs of interest 6 nonlinear displacement/10 nonlinear velocity/24 nonlinear deceleration/g linear displacement/10 linear velocity/24 linear deceleration/g 5 4 3 2 1 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Time, sec. function Homework_4_3360_Apr_2021 clear all format shortg options=odeset('events',@StopSim8); [t,X]=ode45(@barrier3360,[0 2],[0 24 0],options); plot(t,X(:,1)/10,'r-',t,X(:,2)/24,'r--',t,(5e-5)*X(:,3)/9.8,'r:','LineWidth',2) hold on Pm=max(x(:,3)) clear t X [t,X]=ode45(@barrier3360L,[0 2],[0 24 0],options); plot(t,X(:,1)/10,'k-',t,X(:,2)/24,'k--',t,(5e-5)*X(:,3)/9.8,'k:','LineWidth',2) xlabel('Time, sec.','fontsize',18) ylabel('Normalized outputs of interest','fontsize',18) title('Homework 4, Crash Barrier Simulation','fontsize',18) legend('nonlinear displacement/10','nonlinear velocity/24',... 'nonlinear deceleration/g',... 'linear displacement/10','linear velocity/24',... 'linear deceleration/g','Location','Best') Grid dx(function dx=barrier3360(t,x) y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P dx=zeros(3,1); dx(1)=yd; dx(2)=-(5e-5)*P; Q=(8.9e-4)*sqrt(abs(P))*sign(P); dx(3)=2e8*(.05*yd-Q)/(10-y); end function dx=barrier3360L(t,x) y=x(1);yd=x(2);P=x(3);%allows writing equations in terms of y, yd, and P dx=zeros(3,1); dx(1)=yd; dx(2)=-(5e-5)*P; Q=(8.9e-4)*P/sqrt(Pm); % Using straight-line approximation for sqrt(P) dx(3)=2e8*(.05*yd-Q)/(10-y); end function[Val,Ister,Dir]=StopSim8(t,x) Val(1)=x(1)-10;Ister(1)=1;Dir(1)=0;%stops simulation if y=10 Val(2)=x(2);Ister(2)=1;Dir(2)=0;%stops simulation if velocity=0 end end 274 Homework #54 The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ H1 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H2 Q (a) (5%) List the unknowns and confirm you have enough equations to solve for any or all of the unknowns. (b) (10%) Laplace transform each of these three equations. (c) (15%) Eliminate Q and reduce the equations down to two equations with unknowns H1(s) and H2(s) . Dropping the notation ‘(s)’ since every term is in the Laplace domain and to minimize the writing: (d) (10%) Reduce the equations down to one equation for the unknown H1(s) by solving for H2(s) in the one of the equations in (c) and putting the equation for H2(s) in the other equation. Show that 6666.6๐ 2 + 4 ๐ป1 (๐ ) = ๐ (3333.3๐ 2 + 1) (e) (5%) Use the quadratic formula to get the poles of H1(s)? (5%) What does the final value theorem give for H1(∞). (5%) Explain why the final value theorem is likely to give a misleading answer. (f) (10%) Use the initial value theorem to check if your H1(s) gives the correct the initial value. (5%) Does your H1(s) give the correct initial value for H1? If not, find your error. (g) (10%) Use ‘pfract’ in MATLAB to express H1(s) in partial fraction format. (h) (15%) Use the techniques in Lecture #11 (pages 26-34 in the book) to find the inverse Laplace of H1(s) to get an equation for H1(t). (5%) Substitute t = 0 and t = ∞ into your equation for H1(t) to see if you get the correct initial and final values of H1. Explain why the solution is correct or incorrect. 275 Homework #55 The objective of this assignment is to teach and demonstrate the value and simplicity of using frequency response for sinusoidal inputs to get the steady state output instead of having to find the inverse Laplace transform or having to do a MATLAB simulation to get the same results. A pile driver is used to drive the pile shown below into the ground. This is a study to determine the significance of the pounding frequency of the input force F on the amplitude of the penetration force f at the ground. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L = 1.5e8 N/m; the pile length is L=15 m. Although a 5 or more lumped mass model would be preferred for the study, for simplicity, only 2 lumped masses will be used. Assume b = 2e5 Ns/m for the damping coefficient. F M /2 z 2K b M K w M /2 b 2K f It can be shown that the equations for the displacements z and w of the masses and the equation for the penetration force f at the ground are: 2 (๐๐คฬ + 2๐พ๐ค + ๐น − 2๐พ๐ง − ๐๐งฬ ) ๐ 2 ๐คฬ = (๐๐งฬ + 2๐พ๐ง − 4๐พ๐ค − 2๐๐คฬ ) ๐ ๐ = ๐๐คฬ + 2๐พ๐ค + ๐๐ ๐งฬ = (a) (15%) Using symbolic math in MATLAB, show that the Laplace transform equation for the force at the ground associated with the pounding force F at the top is 711.11๐ 2 + 2.133๐6๐ + 1.6๐9 ๐(๐ ) = [ 4 ] ๐น(๐ ) ๐ + 80๐ 3 + 1.2067๐5๐ 2 + 2.133๐6๐ + 1.6๐9 Note, the equation for the ground force f includes the weight of the pile as an additional input. However, we are only interested in the transfer function for the input force F. (b) (5%) What is the transfer function for f? (c) (5%) What is the characteristic polynomial for this system? 276 (d) (5%) What is the DC gain of this transfer function? Explain why this value for the DC gain makes sense. (e) (5%) What are the eigenvalues for this system? The ‘damp’ command in the code in (a) above gives (f) (5%) What are the resonant frequencies (damped natural frequencies) for the beam? (g) (5%) What are the damping ratios for this system? (h) (5%) Is the system over damped or lightly damped or what? What is the significance of the damping level in regard to force (or stress) oscillations up and down the beam? (i) (5%) Based on examination of the frequency response (bode plot) of the transfer function, what pounding frequency will produce the largest amplitude of the force at the ground? (j) (10%) Suppose the pounding force is sinusoidal with the first resonant frequency found in (i) with an amplitude of 500 N. What will be the steady state amplitude and frequency of the force at the ground? (3%) Is the amplitude of the force at the ground greater or less than the input force amplitude? (2%) How much bigger or smaller? (k) (7%) Confirm your answer in (j) using lsim in MATLAB. (l) (8%) Suppose the pounding force is a series of pulses with amplitude of 500 and with the period of the pulses corresponding to the frequency in (i). Use lsim in MATAB to simulate the system to determine the steady state amplitude of the force at the ground due to F. Use the (homemade) MATLAB function PulseSeries.m in Canvas to generate the pulse series. See example in book in Section 2.8.4.1. To generate a series of pulses, certain parameters must be specified: N, m and the number of points per pulse (NumPPP) must be integers. I suggest m=5 which means the width of the pulse will be 1/m = 1/5 of the pulse period mT as shown on the schematic below. Also, if NumPPP = 10, then there will be enough points to accurately define the shape of the pulse. The fundamental frequency of the pulse series is 2๐/๐๐ rad/s; this needs to match the first resonant frequency of the beam model; thus, ๐ = 2๐/124๐ = 2๐/(124 ∗ 5) = 0.01 s. The total simulation time is NmT where N is the number of pulses to be included in the simulation. The simulation time needs to be great enough to be able to observe some of the steady state oscillations. Since the largest time constant is 1/5.09 = 0.2 s, the simulation needs to run at least 1.5 s which will give about 0.5 s of steady state oscillations or 0.5/(mT) = 0.5/(0.05) = 10 cycles of ground force pulses. So, N = 1.5/mT = 30. 277 f(t) T F t mT (m) (3%) Compare the amplitudes from (j) and (l). (3%) Which one is greater and why do you think it is? (n) How critical is the sinewave-pounding-frequency to the performance of the pile driver? (3%) For example, how much do your answers in (j) change if the pounding frequency is increased by 10%? (3%) What if the pounding frequency is decreased by 10%? (3%) What does this tell you about the significance of input frequencies at the resonant frequencies of the system. Homework #54 Solution The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H1 H2 Q (a) (5%) List the unknowns and confirm you have enough equations to solve for any or all of the unknowns. H1 H2 and Q (b) (10%) Laplace transform each of these three equations. −๐(๐ ) − 20[๐ ๐ป1 (๐ ) − 2] = 0 ๐(๐ ) − 40[๐ ๐ป2 (๐ ) − 5] = 0 ๐ป1 (๐ ) − ๐ป2 (๐ ) = 250[๐ ๐(๐ ) − 0] 278 (c) (15%) Eliminate Q(s) and reduce the equations down to two equations with unknowns H1(s) and H2(s) . Dropping the notation ‘(s)’ since every term is in the Laplace domain and to minimize the writing: ๐= ๐ป1 − ๐ป2 250๐ Thus, − ๐ป1 − ๐ป2 − 20[๐ ๐ป1 − 2] = 0 250๐ ๐ป1 − ๐ป2 − 40[๐ ๐ป2 − 5] = 0 250๐ (d) (10%) Reduce the equations down to one equation for the unknown H1(s) by solving for H2(s) in the one of the equations and putting the equation for H2(s) in the other equation. Show that 6666.6๐ 2 + 4 ๐ป1 (๐ ) = ๐ (3333.3๐ 2 + 1) Solving for H2 in the first equation: H2 = 5,000s2H1 + H1 -10,000s Putting this equation for H2 in the other equation gives ๐ป1 (๐ ) = 10๐7๐ 2 + 6๐4 6666.6๐ 2 + 4 2๐ 2 + 0.0012 = = ๐ (5๐7๐ 2 + 1.5๐4) ๐ (3333.3๐ 2 + 1) ๐ (๐ 2 + 0.0003) Symbolic math in MATLAB can also be used to get this solution. syms s H1 Q H2 E1=-Q-20*(s*H1-2)==0; E2=Q-40*(s*H2-5)==0; E3=H1-H2==250*s*Q; h=solve(E1,E2,E3,H1,H2,Q); pretty(h.H1) 4(5000๐ 2 + 3) 6666.6๐ 2 + 4 = ๐ (10000๐ 2 + 3) ๐ (3333.3๐ 2 + 1) (e) (5%) What are the poles of H1(1)? Using the quadratic formula: −0 ± √0 − 0.0003 = ±๐0.0173 The other pole is s = 0. (5%) What does the final value theorem give for H1(∞). ๐ป1 (∞) = ๐ ๐ป1 (๐ )๐ =0 = ๐ 10๐7๐ 2 + 6๐4 6 = =4 2 ๐ (5๐7๐ + 1.5๐4)๐ =0 1.5 279 (5%) Explain why the final value theorem is likely to give a misleading answer. H1(s) has a complex pair of poles with a zero-real part. This means that a portion of H1(t) will oscillate forever and never go to a constant. The final value theorem cannot be used for cases of poles with positive real parts or complex poles with zero real parts. (f) (10%) Use the initial value theorem to check if your H1(s) gives the correct the initial value. ๐ป1 (0+ ) = ๐ ๐ป1 (๐ )๐ =∞ = ๐ 10๐7๐ 2 + 6๐4 10๐7 = =2 2 ๐ (5๐7๐ + 1.5๐4)๐ =0 5๐7 ๐คโ๐๐โ ๐โ๐๐๐๐ (5%) Does your H1(s) give the correct initial value for H1? Yes (g) (10%) Express H1(s) in partial fraction format. >> den=[5e7 0 1.5e4 0]; >> num=[1e8 0 6e4]; >> H1=tf(num,den) H1 = 1e08 s^2 + 60000 ----------------------5e07 s^3 + 15000 s >> pfract(num,den) 4 -2 s H1(s) = ---- + -----------s s^2 + 0.0003 4 -2s = ----- + -------------------------------s (s + j0.0173)(s – j0.0173) (h) (15%) Use the techniques in Lecture #11 to find the inverse Laplace of H1(s) to find an equation for H1(t). ๐ 0๐ก |−2(๐0.0173)|๐ ๐๐(00173๐ก + ๐๐๐๐๐(−2(๐0.0173)) 0.0173 ๐ = 4 + 2๐ ๐๐(0.0173๐ก − ) 2 ๐ป1 (๐ก) = 4๐ 0๐ก + (5%) Substitute t = 0 and t = ∞ into your equation for H1(t) to see if you get the correct initial and final values of H1. At t = 0: 280 ๐ ๐ป1 (0) = 4 + 2๐ ๐๐(0 − ) = 4 − 2 = 2 ๐คโ๐๐โ ๐๐ ๐๐๐๐๐๐๐ก 2 At t = ∞: ๐ ๐ป1 (๐ก)๐ก→∞ = 4 + 2๐ ๐๐(0.0173๐ก − ) 2 ๐ ๐๐๐๐ค๐๐ฃ๐ ๐๐ ๐๐๐๐๐๐ก๐๐๐ ๐๐๐๐ข๐ก 4 This makes since the final value theorem gave a constant of 4 which is consistent with a sinewave oscillating about an average value of 4. Note, in reality, viscous flow through the pipe will cause the water levels to eventually settle to equal heights of 4 m. We could have predicted this final value since the water volume remains constant which is the sum of the water heights times the tank areas at any time. 281 Homework #56 The input to the suspension system shown below is the road displacement u(t). z z u The equations for this suspension system are: 1000๐งฬ + 2400๐งฬ + 9000๐ง = 2400๐ขฬ + 9000๐ข all initial conditions are zero (1) 20%) Using the simulation diagram approach express this differential equation in state variable format assuming z is the output of interest, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? (2) (20%) Repeat (1) using the phase variable method. (3) (20%) Repeat (1) using the MATLAB command tf2ss. (4) (10%) For all three formulations in (1), (2), and (3), demonstrate using the MATLAB command ss2tf that all three must be valid representations since all 3 of them give the same transfer function for Z(s). (5) (20%) Starting with the original differential equation, create a simulation diagram containing integrators and then create a SIMULINK model corresponding to your simulation diagram. (6) (10%) For a step input of 0.05 m, generate a plot of z(t) using the formulations in (1), (2), (3) and (5) and put them on the same graph for comparison. Confirm that all 4 plots are identical. 282 Homework #56 Solution This assignment is very similar to 5.49 on page 69 in the problems book and a problem in Section 1.4.2 in the theory book. The objective of this assignment is to teach and demonstrate the value and simplicity of using frequency response for sinusoidal inputs to get the steady state output instead of having to find the inverse Laplace transform or having to do a MATLAB simulation to get the same results. A pile driver is used to drive the pile shown below into the ground. This is a study to determine the significance of the pounding frequency of the input force F on the amplitude of the penetration force f at the ground. The total mass of the pile is M=15,000 Kg. The stiffness of the pile is K=AE/L = 1.5e8 N/m; the pile length is L=15 m. Although a 5 or more lumped mass model would be preferred for the study, for simplicity, only 2 lumped masses will be used. Assume b = 2e5 Ns/m for the damping coefficient. F M /2 z 2K b M K w M /2 b 2K f It can be shown that the equations for the displacements z and w of the masses and the equation for the penetration force f at the ground are: 2 (๐๐คฬ + 2๐พ๐ค + ๐น − 2๐พ๐ง − ๐๐งฬ ) ๐ 2 ๐คฬ = (๐๐งฬ + 2๐พ๐ง − 4๐พ๐ค − 2๐๐คฬ ) ๐ ๐ = ๐๐คฬ + 2๐พ๐ค + ๐๐ ๐งฬ = (a) (15%) Using symbolic math in MATLAB, show that the Laplace transform equation for the force at the ground associated with the pounding force F at the top is 711.11๐ 2 + 2.133๐6๐ + 1.6๐9 ๐(๐ ) = [ 4 ] ๐น(๐ ) ๐ + 80๐ 3 + 1.2067๐5๐ 2 + 2.133๐6๐ + 1.6๐9 Note, the equation for the ground force f includes the weight of the pile as an additional input. However, we are only interested in the transfer function for the input force F. % m-file for finding the transfer function, eigenvalues, and freq. response 283 function Homework_6_3360_Spr_2021 format shortg syms Z W f b K M s F E1=s^2*Z==2*(b*s*W+2*K*W+F-2*K*Z-b*s*Z)/M; E2=s^2*W==2*(b*s*Z+2*K*Z-4*K*W-2*b*s*W)/M; E3=f==(2*K+b*s)*W; G=solve(E1,E2,E3,Z,W,f); Gf=subs(G.f,[M K b],[1.5e4 1.5e8 2e5]); digits(4) Gfv=vpa(Gf); [num,den]=numden(Gfv/F); Num=sym2poly(num); Den=sym2poly(den); GF=tf(Num,Den) damp(GF) figure(1) bode(GF,{50 500},'r') grid end 6400 s^2 + 1.92e07 s + 1.44e10 GF = ---------------------------------------------------9 s^4 + 720 s^3 + 1.086e06 s^2 + 1.92e07 s + 1.44e10 Divide numerator and denominator by 9 to get the coefficient on s4 equal to 1 gives 711.11๐ 2 + 2.133๐6๐ + 1.6๐9 ๐(๐ ) = [ 4 ] ๐น(๐ ) ๐ + 80๐ 3 + 1.2067๐5๐ 2 + 2.133๐6๐ + 1.6๐9 (b) (5%) What is the transfer function for f? 711.11๐ 2 + 2.133๐6๐ + 1.6๐9 [ 4 ] ๐ + 80๐ 3 + 1.2067๐5๐ 2 + 2.133๐6๐ + 1.6๐9 (c) (5%) What is the characteristic polynomial for this system? ๐ 4 + 80๐ 3 + 1.2067๐5๐ 2 + 2.133๐6๐ + 1.6๐9 (d) (5%) What is the DC gain of this transfer function? DC gain =1 found by setting s = 0 in the transfer function. Explain why this value for the DC gain makes sense. If F is a constant force (constant means zero frequency) such as would be achieved by setting a weight on top of the pile, the increase in force at the ground will be the same as the constant force input. (e) (5%) What are the eigenvalues for this system? The ‘damp’ command in the code in (a) above gives Eigenvalues -5.09e+00 + 1.24e+02i -5.09e+00 - 1.24e+02i -3.49e+01 + 3.22e+02i -3.49e+01 - 3.22e+02i Damping ratio 4.12e-02 4.12e-02 1.08e-01 1.08e-01 Frequency 1.24e+02 1.24e+02 3.24e+02 3.24e+02 284 (f) (5%) What are the resonant frequencies (damped natural frequencies) for the beam? From the results shown in (e), the resonant frequencies of the pile are 124 and 322 rad/s (19.7 and 51.2 hz). (g) (5%) What are the damping ratios for this system? From the results shown in (e), the damping ratios are 0.041 and 0.108. (h) (5%) Is the system over damped or lightly damped or what? What is the significance of the damping level in regard to force (or stress) oscillations up and down the beam? The eigenvalues are very lightly damped which means the force waves will be very oscillatory lasting for a relatively long time before they damp out. (i) (5%) Based on examination of the frequency response (bode plot) of the transfer function, what pounding frequency will produce the largest amplitude of the force at the ground? The command bode is included in the code in (a); the gain of the transfer function peaks in the frequency response at the resonant frequencies 123 and 321 rad/s which are essentially 124 and 322 in the eigenvalues. 30 System: GF Frequency (rad/s): 123 Magnitude (dB): 23 Bode Diagram Magnitude (dB) 20 System: GF Frequency (rad/s): 321 Magnitude (dB): -1.45 10 0 -10 -20 -30 0 Phase (deg) -90 -180 -270 -360 2 10 Frequency (rad/s) 285 (j) (10%) Suppose the pounding force is sinusoidal with the first resonant frequency found in (i) with an amplitude of 500 N. What will be the steady state amplitude and frequency of the force at the ground? The gain of the transfer function at 123 rad/s is 23.1 dB which means the gain of the transfer function is 10(23.1/20) = 14.28. The frequency of the ground force will also be 123 rad/s and the amplitude will be 14.28 times larger, 14.28*500 = 7144 N. (3%) Is the amplitude of the force at the ground greater or less than the input force amplitude? Greater (2%) How much bigger or smaller? 14.28 times greater (k) (7%) Confirm your answer in (j) using lsim in MATLAB. (a) Examining the real parts of the eigenvalues, the largest time constant is 0.2 s. So, it will take about 5*0.2 = 1 s for the simulation to reach steady state. To see at least 10 steady state oscillations at 124 rad/s (19.7 hz), the simulation needs to run at least 1.5 s with a time increment of approximately 1/(10*124) = 0.0008; I will use 0.001s. As shown in the plot, the steady state amplitude is 7085 which is very close to 7144 in part (j) using the frequency resp. X: 1.394 Y: 7085 8000 ground force, N 6000 4000 2000 0 -2000 -4000 -6000 -8000 0 0.5 1 1.5 time, s t=0:0.0001:1.5; Fi=500*sin(124*t); [gf]=lsim(GF,Fi,t); figure(2) plot(t,gf,'r','linewidth',2) xlabel('time, s','fontsize',18) ylabel('ground force, N','fontsize', 18) grid 286 (l) (8%) Suppose the pounding force is a series of pulses with amplitude of 500 and with the period of the pulses corresponding to the frequency in (i). Use lsim in MATAB to simulate the system to determine the steady state amplitude of the force at the ground due to F. Use the (homemade) MATLAB function PulseSeries.m in Canvas to generate the pulse series. See example in book in Section 2.2.5. To generate a series of pulses, certain parameters must be specified: N, m and the number of points per pulse (NumPPP) must be integers. I suggest m=5 which means the width of the pulse will be 1/m = 1/5 of the pulse period mT as shown on the schematic below. Also, if NumPPP = 10, then there will be enough points to accurately define the shape of the pulse. The fundamental frequency of the pulse series is 2๐/๐๐ rad/s; this needs to match the first resonant frequency of the beam model; thus, ๐ = 2๐/124๐ = 2๐/(124 ∗ 5) = 0.01 s. The total simulation time is NmT where N is the number of pulses to be included in the simulation. The simulation time needs to be great enough to be able to observe some of the steady state oscillations. Since the largest time constant is 1/5.09 = 0.2 s, the simulation needs to run at least 1.5 s which will give about 0.5 s of steady state oscillations or 0.5/(mT) = 0.5/(0.05) = 10 cycles of ground force pulses. So, N = 1.5/mT = 30. f(t) T F t mT >> T=0.01;m=5;F=500;N=30;NumPPP=10; >> [F,t] = PulseSeries(T,m,F,N,NumPPP); 550 500 450 pulse function amplitude 400 350 300 250 200 150 100 50 0 0 0.5 1 1.5 time, sec. 287 Consider the following commands to simulate the ground force for the pulse series input: >> GF=tf([711.11 2.133e6 1.6e9],[1 80 1.2067e5 2.133e6 1.6e9]); >> [f]=lsim(GF,F,t); >> plot(t,f,'r','linewidth',2) >> title('Pile driver with 19.6 hz pulse input') >> xlabel('Time,s','fontsize',16) >> ylabel('Ground force, N','fontsize',16) Pile driver with 19.6 hz pulse input 3000 X: 1.269 Y: 2900 Ground force, N 2000 1000 0 -1000 -2000 -3000 0 0.5 1 1.5 Time,s (m) (3%) Compare the amplitudes from (j) and (l). For a sinewave input, the ground force amplitude is 7085 n; with the pulse series input, the amplitude is 2900 N which is only 2900/500 = 5.8 times larger than the input amplitude compared to 14.28 times with the sinewave input. (3%) Which one is greater and why do you think it is? The sinewave input generates the greatest ground force amplitude because it is continuous and represents a greater input energy. It can be shown that the RMS value of the sinewave is 500/sqrt(2) = 354. Using the ‘rms’ command in MATLAB, the RMS value of the pulse series is only 234. A true comparison would require that the work done by the pile driver be the same in each case. >> RMS=rms(F) RMS = 234.24 288 (n) How critical is the sinewave-pounding-frequency to the performance of the pile driver? (3%) For example, how much do your answers in (j) change if the pounding frequency is increased by 10%? A 10% increase in pounding frequency decreases the gain from 14.28 down to 10(15.2/20) = 5.75. Bode Diagram 30 20 System: GF Frequency (rad/s): 111 Magnitude (dB): 14.5 System: GF Frequency (rad/s): 135 Magnitude (dB): 15.2 Magnitude (dB) 10 0 -10 -20 -30 0 Phase (deg) -90 -180 -270 -360 2 10 Frequency (rad/s) (3%) What if the pounding frequency is decreased by 10%? A 10% decrease in pounding frequency decreases the gain from 14.28 down to 10(14.5/20) = 5.3. (3%) What does this tell you about the significance of input frequencies at the resonant frequencies of the system. The input frequency needs to be as close as possible to maximize the performance of the pile driver. In reality, the true resonant frequency can only be estimated; however, if would be possible to vary the pounding frequency from the best estimate until the peak performance is achieved. 289 Homework #57 The input to the suspension system shown below is the road displacement u(t). z z u The equations for this suspension system are: 3000๐งฬ + 18000๐งฬ + 120000๐ง = 18000๐ขฬ + 120000๐ข (1) (5%) What is the transfer function H(s) for z? (2) (10%) What are the eigenvalues of this suspension? ______ (3) (10%) What is the damping ratio of this suspension? ______ (4) (10%) What is the damped natural frequency of this suspension? ________ (5) Assume the road profile is Gaussian with a PSD given below for the vehicle traveling 20 m/s. ๐บ๐ข๐ข (๐) = 0 ๐บ๐ข๐ข (๐) = 0.001 ๐2 ๐ > 80โ๐ง 0.01 ≤ ๐ ≤ 80 โ๐ง (10%) What is the mean value of the road profile? ____________ (10%) What is the mean square value of the road profile? ________ 290 (10%) What is the approximate probability that the road elevation at any location exceeds 0.5 m greater than the mean elevation? Hint: Use the table in the book and/or the MATLAB ‘disttool’ function. ________ (15%) Determine the mean square value of z(t). ________ (5%) How does this value compare with the mean square value of the road profile. Explain why the two values are essentially the same. _________________ Recall, the mean square value is calculated by integrating the PSD over all frequencies. As explained in the book, you can get an equation for the PSD using the input PSD and the transfer function. So, using H(s) found in (1) above, the PSD of the displacement z of the vehicle with input u(t) is ๐บ๐ง๐ง (๐) = ๐บ๐ข๐ข (๐)[๐ป(๐ )๐ป(−๐ )]๐ =๐2๐๐ Or, in terms of the Laplace operator s, the PSD of z(t) is ๐บ๐ง๐ง (๐ ) = ๐ป(๐ )๐ป(−๐ )๐บ๐ข๐ข (๐)๐= ๐ ๐2๐ = ๐(๐ )๐(−๐ ) A homemade symbolic math m-file for integrating a PSD is listed below. You can use it to get the mean square value. % function [MSV]=msv(G,f1,f2) % Generates the mean square value, MSV, of a variable with symbolic % transfer function G assuming the input to this transfer function % is a one sided unity band limited white noise from f1 hertz to f2 hertz. % A typical value of f1 is zero and a typical value for f2 is 1/2h where % h is the sampling interval in seconds. function [MSV]=msv(G,f1,f2) syms s f Gms=subs(G,s,-s); GGms=G*Gms; GGmsf=subs(GGms,s,j*2*pi*f); MSV=double(int(GGmsf,f,f1,f2)); end (6) (15%) Knowing the mean and mean square values for z(t), what is the 95% probability value of displacement z? That is, there is only a 5% probability that at any time, z(t) is greater than this value? Hint: Use the table in the book and/or the MATLAB ‘disttool’ function. ________ 291 292 Homework #57 Solution The input to the suspension system shown below is the road displacement u(t). z z u The equations for this suspension system are: 1000๐งฬ + 2400๐งฬ + 9000๐ง = 2400๐ขฬ + 9000๐ข all initial conditions are zero (7) 20%) Using the simulation diagram approach express this differential equation in state variable format assuming z is the output of interest, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? ๐งฬ + 2.4๐งฬ + 9๐ง = 2.4๐ขฬ + 9๐ข ๐งฬ − 2.4๐ขฬ = −9๐ง − 2.4๐งฬ + 9๐ข ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ − 2.4๐ข ๐ฅฬ 1 = ๐ฅ2 + 2.4๐ข ๐ฅฬ 2 = −9๐ฅ1 − 2.4(๐ฅ2 + 2.4๐ข) + 9๐ข = −9๐ฅ1 − 2.4๐ฅ2 + 3.24๐ข ๐ด=[ 0 1 ] −9 −2.4 ๐ต=[ 2.4 ] 3.24 ๐ถ = [1 0] ๐ท = [0] (8) (20%) Repeat (1) using the phase variable method. 0 1 0 ๐ด=[ ] ๐ต = [ ] ๐ถ = [9 2.4] ๐ท = [0] −9 −2.4 1 293 (9) (20%) Repeat (1) using the MATLAB command tf2ss. >> num=[2.4 9];den=[1 2.4 9]; >> [Am,Bm,Cm,Dm]=tf2ss(num,den) Am = -2.4 -9 1 0 Bm = 1 0 Cm = 2.4 9 Dm = 0 (10) (10%) For all three formulations in (1), (2), and (3), demonstrate using the MATLAB command ss2tf that all three must be valid representations since all 3 of them give the same transfer function for Z(s). % Homework #9 MAE 3360 Spring 2021 As=[0 1;-9 -2.4];Bs=[2.4;3.24];Cs=[1 0];Ds=[0]; Ap=[0 1;-9 -2.4];Bp=[0;1];Cp=[9 2.4];Dp=[0]; num=[2.4 9];den=[1 2.4 9]; [Am,Bm,Cm,Dm]=tf2ss(num,den); [Nums,Dens]=ss2tf(As,Bs,Cs,Ds);Gs=tf(Nums,Dens) [Nump,Denp]=ss2tf(Ap,Bp,Cp,Dp);Gp=tf(Nump,Denp) [Numm,Denm]=ss2tf(Am,Bm,Cm,Dm);Gm=tf(Numm,Denm) Gs = 2.4 s + 9 --------------s^2 + 2.4 s + 9 Gp = 2.4 s + 9 --------------s^2 + 2.4 s + 9 Gm = 2.4 s + 9 --------------s^2 + 2.4 s + 9 (11) (20%) Starting with the original differential equation, create a simulation diagram containing integrators and then create a SIMULINK model corresponding to your simulation diagram. Assuming a step for u: 294 (12) (10%) For a step input of 0.05 m, generate a plot of z(t) using the formulations in (1), (2), (3) and (5) and put them on the same graph for comparison. Confirm that all 4 plots are identical. Step Response 0.07 0.06 Amplitude 0.05 0.04 0.03 Simulation Diagram 0.02 Phase Variable Matlab 0.01 0 Simulink 0 1 2 3 4 Time (seconds) >> step(0.05*Gs,'r',0.05*Gp,'k:',0.05*Gm,'k*') >> hold >> plot(Z(:,1),Z(:,2),'r--') >> legend('Simulation Diagram','Phase Variable','Matlab','Simulink','location','best') >> grid 295 Homework #58 A simple model for a suspension consists of a sprung mass (displacement z) and an unsprung mass (displacement w) as shown in the schematic below. The input to the suspension system is the road displacement u(t). Specific details associated with the springs and dampers are not depicted. For this problem, we are interested in the decrease in the size of the gap between the two masses. The ‘stroke’ of the suspension is how much the gap can decrease without the suspension bottoming-out. Thus, the output of interest is y = w – z where y is defined to be the decrease in the gap size. z w u The equations for this system are given below; you will learn how to get these equations for a specific suspension design in MAE3319. ๐งฬ + 6๐งฬ + 40๐ง = 6๐คฬ + 40๐ค ๐คฬ + 100๐คฬ + 4000๐ค = 12๐งฬ + 80๐ง + 80๐ขฬ + 4000๐ข (1) (15%) Complete the simulation diagram (section 3.2 in book) below linking the two differential equations. Note, 1/s is Laplace notation for integration. ๐งฬ 1 ๐งฬ ๐ ๐คฬ − 80๐ขฬ 1 ๐ ๐คฬ − 80๐ข (2) 15%) Define the state variables as the outputs of the integrators on your diagram and write the state variable equations including the equation for the output of interest, i.e. 296 ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? (3) (5%) Enter this state space system into MATAB and use the damp command to get the eigenvalues. Eigenvalues = ? (5%) Damping ratios = ? (5%) Time constants = ? (5%) Damped natural frequencies = ? (4) (5%) Assume that this vehicle is moving over a road in a pasture at 20 m/s (see section 8.3.6 in the book). Using the parameters in the table, what is the PSD of the input u(t)? Guu(f) = ? (5) (10%) Using the m-file StochInput, generate and plot the random profile for the road assuming that the road PSD is the defined in (4) for frequencies between 0.1 and 100 hz and zero for all other frequencies. Note, the m-file StochInput contains a function dpsd at the very end; the logic for the desired PSD must be entered in this function. Examples of dpsd are in Section 8.3.5.1 in the book. Confirm that the function listed below corresponds to the road profile specified in (4): function [GY]=dpsd(f)% This function will be called for each value of f. % You need equations or logic for GY describing the desired PSD. GY=1.81e-3/f^1.6; if f >100;GY=0;end if f<0.1;GY=0;end end Also, you will need to follow the instructions discussed in section 8.3.5.1 in the book for selecting the time increment H and the total number of points N. H= ? N= ? (6) (10%) Using lsim in MATLAB and the road profile generated in (5), generate a plot of y(t). 297 (7) (5%) Draw a line on your plot in (6) corresponding to a Stroke of 0.125 meters. Looking at this plot of y(t), count the number of times that y(t) exceeds the Stroke corresponding to the suspension bottoming-out; calculate the frequency that this occurs. (times of bottoming-out)/sec = ? (8) (10%) Change the output of interest (1) to ๐ฆฬ and then repeat (6) but this time plot ๐ฆฬ (๐ก). (9) (10%) Using the MATLAB command std, find the standard deviation of y and ๐ฆฬ . Use these standard deviations in the formula in section 8.3.8 to calculate an estimate of the frequency of bottoming-out. How does this frequency compare with the frequency found in (7)? __________ Homework #58 Solution The input to the suspension system shown below is the road displacement u(t). z z u The equations for this suspension system are: 3000๐งฬ + 18000๐งฬ + 120000๐ง = 18000๐ขฬ + 120000๐ข (1) (5%) What is the transfer function H(s) for z? 18000๐ + 120000 3000๐ 2 + 18000๐ + 120000 (2) (10%) What are the eigenvalues of this suspension? −3 ± ๐5.57 3000(๐ 2 + 6๐ + 40) = 3000(๐ + 3 + ๐5.57)(๐ + 3 − ๐5.57) (3) (10%) What is the damping ratio of this suspension? 0.474 298 2๐ฟ๐๐ = 2๐ฟ√40 = 6 ๐กโ๐ข๐ ๐ฟ = 6 2√40 = 0.474 (4) (10%) What is the damped natural frequency of this suspension? ๐๐ = 5.57 (5) Assume the road profile is Gaussian with a PSD given below for the vehicle traveling 20 m/s. ๐บ๐ข๐ข (๐) = 0 ๐บ๐ข๐ข (๐) = ๐ > 80โ๐ง & ๐ < 0.01 0.001 ๐2 0.01 ≤ ๐ ≤ 80 โ๐ง (10%) What is the mean value of the road profile? 0 Mean equals zero since there is no impulse at f = 0 in the PSD. (10%) What is the mean square value of the road profile? 80 0.001 Mean square value is area under the PSD = ∫0.01 ๐2 ๐๐ = 0.1 ๐2 (10%) What is the approximate probability that the road elevation at any location exceeds 0.5 m greater than the mean elevation? Using the table in Section 8.24: |๐ง − 0| ≤ 1.64๐๐ง = 1.64√0.1 = 0.52 for 90% probability. That is, there is a 90% probability that -0.52<z<0.52. So, there is 5% probability for z to be less than -0.52 and 5% probability for z to be greater than 0.52. Or, using the command ‘disttool’, we get 100-94 = 6 % probability. Note, you can get better resolution by decreasing the upper bound on sigma without changing the answer. The 6% area of the probability density function is shown below. 1.5 1 0.8 1 0.6 0.5 0.4 0.2 0 -4 -3 -2 -1 0 1 2 3 4 0 -4 -3 -2 -1 0 1 2 3 4 299 (15%) Determine the mean square value of z(t). Using formulas below: 0.101 m2 A simple way to compute the mean square value without having to simulate the system is to obtain the equation for the PSD of z(t), ๐บ๐ง๐ง (๐), and then integrate it over the applicable frequency range. You can do the integration manually or with symbolic math. Or, you can split the input PSD into positive and negative parts as shown in the formulation below, g(s) and g(-s), and then use the mfile msv. (5%) How does this value compare with the mean square value of the road profile. Same. Explain why the two values are essentially the same. The displacement of the vehicle mass essentially follows the road profile and the profile irregularities are not significant in the frequency range close to the suspension resonant frequency to cause large amplitudes of vibration. Recall, the mean square value is calculated by integrating the PSD over all frequencies. As explained in the book, you can get an equation for the PSD using the input PSD and the transfer function. So, using H(s) found in (1) above, the PSD of the displacement z of the vehicle with input u(t) is ๐บ๐ง๐ง (๐) = ๐บ๐ข๐ข (๐)[๐ป(๐ )๐ป(−๐ )]๐ =๐2๐๐ Or, in terms of the Laplace operator s, the PSD of z(t) is ๐บ๐ง๐ง (๐ ) = ๐ป(๐ )๐ป(−๐ )๐บ๐ข๐ข (๐)๐= ๐ ๐2๐ = ๐(๐ )๐(−๐ ) A homemade symbolic math m-file for integrating a PSD is listed below. You can use it to get the mean square value. % function [MSV]=msv(G,f1,f2) % Generates the mean square value, MSV, of a variable with symbolic % transfer function G assuming the input to this transfer function % is a one sided unity band limited white noise from f1 hertz to f2 hertz. % A typical value of f1 is zero and a typical value for f2 is 1/2h where % h is the sampling interval in seconds. function [MSV]=msv(G,f1,f2) syms s f Gms=subs(G,s,-s); GGms=G*Gms; GGmsf=subs(GGms,s,j*2*pi*f); MSV=double(int(GGmsf,f,f1,f2)); end ๐ป(๐ ) = 18000๐ + 120000 3000๐ 2 + 18000๐ + 120000 300 ๐บ๐ข๐ข (๐)๐= ๐ ๐2๐ 0.001 =[ 2 ] ๐ ๐= ๐ ๐2๐ =[ √0.001 √0.001 ๐ ] [ −๐ ] 2๐ 2๐ Thus, 18000๐ + 120000 √0.001 ๐(๐ ) = [ ] [ ๐ ] 3000๐ 2 + 18000๐ + 120000 2๐ =[ 3576๐ + 23843 ] 3000๐ 3 + 18000๐ 2 + 120000๐ >> H=(3576*s+23843)/(3000*s^3+18000*s^2+120000*s); >> MSVz=msv(H,0.01,80) MSVz = 0.10162 + 5.0269e-88i = 0.10162 (6) (15%) Knowing the mean and mean square values for z(t), what is the 95% probability value of displacement z? That is, there is only a 5% probability that at any time, z(t) is greater than this value? Variance of z is √0.10162 = 0.32 As shown on the disttool graphs below, the displacement value of 0.52 m is the 5% value for z(t) to be above this level. 1.5 1 0.8 1 0.6 0.4 0.5 0.2 0 -4 -3 -2 -1 0 1 2 3 4 0 -4 -3 -2 -1 0 1 2 3 4 301 Previous Exams and Solutions Exam 1a 1. (20%) For each differential equation below, answer the following questions: (a) ๐ฃฬ + 16๐ฃฬ + 12๐ฃ = 5 Is the equation linear?________ What is the order? _______ What is the dependent variable?_______ What is the independent variable?_____ What is the final value of the dependent variable?________ (b) 2๐ฆโ + 0.4๐ฆฬ + 0.1(๐ฆฬ )5 + 10๐ฆ = 24 Is the equation linear?________ What is the order? _______ What is the dependent variable?_______ What is the independent variable?_____ What is the final value of the dependent variable?________ 2. Before the valve on the water tank is opened, the height H of the water in the tank is 10 m. Once the valve is opened, water flows out of the tank. The differential equation for H with water flowing out is as follows 4๐ปฬ + 0.8√๐ป = 0 (10%) On the sketch below, draw a reasonable estimate of H as a function of time. H H valve 0 flow time Use separation of variables to solve this differential equation for H(t). Does your equation for H(t) give the correct initial and final values for H? (20%) Equation for H(t) _______________________________ (5%) Initial value of H from the equation __________ (5%) Final value of H from the equation ___________ 302 3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that is, nothing is moving. spring cart pendulum If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left and then released, the cart will start rolling back and forth compressing and extending the spring while the pendulum swings back and forth. z ๏ฑ It can be shown, for small angles, the following two simultaneous equations with unknowns ๐ง ๐๐๐ ๐ accurately model the dynamics of this system ๐ฬ + 3๐ฬ + 9๐ = −0.9๐งฬ 7๐งฬ + 175๐ง = −2๐ฬ Using the 'D' operator, convert these equations to algebraic equations, eliminate ๐, and finally end up with a single differential equation for ๐ง. What is the order of this differential equation? (15%) Equations in terms of the 'D' operator (20%) Single differential equation in terms of z only (5%) Order of the differential equation for z? ___________ 303 Exam 1a Solution 1. (20%) For each differential equation below, answer the following questions: (a) ๐ฃฬ + 16๐ฃฬ + 12๐ฃ = 5 Is the equation linear?__yes___ What is the order? ___2nd_ What is the dependent variable?_v_____ What is the independent variable? time What is the final value of the dependent variable? 5/12=0.4166 (b) 2๐ฆโ + 0.4๐ฆฬ + 0.1(๐ฆฬ )5 + 10๐ฆ = 24 Is the equation linear?__no What is the order? ___3rd What is the dependent variable?_y____ What is the independent variable? time What is the final value of the dependent variable? 2.4 2. Before the valve on the water tank is opened, the height H of the water in the tank is 10 m. Once the valve is opened, water flows out of the tank. The differential equation for H with water flowing out is as follows 4๐ปฬ + 0.8√๐ป = 0 (10%) On the sketch below, draw a reasonable estimate of H as a function of time. H 10 H valve flow 0 time Use separation of variables to solve this differential equation for H(t). ๐ป(๐ก) ๐ก ๐๐ป 4∫ = − ∫ 0.8๐๐ก ๐ป(๐ก) = (√๐ป(0) − 0.1๐ก)2 √๐ป(๐ก) − √๐ป(0) = −0.1๐ก ๐ป(0) √๐ป 0 Does your equation for H(t) give the correct initial and final values for H? (20%) Equation for H(t) ๐ป(๐ก) = (√10 − 0.1๐ก)2 (5%) Initial value of H from the equation ๐ป(0) = (√10 − 0.1 ∗ (0))2 = 10 √ 2 (5%) Final value of H from the equation ๐ป(∞) = (√10 − 0.1๐ก) = 0 √ H cannot go negative 304 3. A pendulum is attached to a cart as shown below. The system is shown in equilibrium, that is, nothing is moving. spring cart pendulum If the cart is rolled to the right or left and released or if the pendulum is raised to the right or left and then released, the cart will start rolling back and forth compressing and extending the spring while the pendulum swings back and forth. z ๏ฑ It can be shown, for small angles, the following two simultaneous equations with unknowns ๐ง ๐๐๐ ๐ accurately model the dynamics of this system ๐ฬ + 3๐ฬ + 9๐ = −0.9๐งฬ 7๐งฬ + 175๐ง = −2๐ฬ Using the 'D' operator, convert these equations to algebraic equations, eliminate ๐, and finally end up with a single differential equation for ๐ง. What is the order of this differential equation? (15%) Equations in terms of the 'D' operator (7๐ท2 + 175)๐ง = −2๐ท2 ๐ (๐ท2 + 3๐ท + 9)๐ = −0.9๐ท2 ๐ง (20%) Single differential equation in terms of z only −0.9๐ท2 ๐ง ๐= 2 ๐ท + 3๐ท + 9 −0.9๐ท2 ๐ง 2 2 (7๐ท + 175)๐ง = −2๐ท 2 ๐ท + 3๐ท + 9 Which simplifies to (5.2๐ท4 + 21๐ท3 + 238๐ท2 + 525๐ท + 1575)๐ง = 0 which corresponds to the following differential equation: 5.2๐ง (4) + 21๐งโ + 238๐งฬ + 525๐งฬ + 1575๐ง = 0 (5%) Order of the differential equation for z? 4th 305 Exam 1b 1. (15%) Obtain a linear approximation to the following differential equation based on the initial and final values of z. ๐งฬ + 3๐งฬ + 6√๐ง = 12 2. ๐ง(0− ) = 1 Consider the following Laplace transform for Z(s): ๐(๐ ) = 6๐ 2 + 20๐ + 80 ๐ [๐ 2 + 12๐ + 40] (a) (5%) Use the final value theorem (FVT) to compute the final value of z(t). (b)(5%) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+. (c)(9%) What are the poles of Z(s) which are the roots of the denominator polynomial? FVT: ๐๐๐๐๐ก ๐ ๐น(๐ )๐ →0 IVT: ๐๐๐๐๐ก ๐ ๐น(๐ )๐ →∞ 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ H1 ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 H2 Q (a) (25%) Laplace transform each of these three equations. (b)(15%) Reduce the equations down to two equations with unknowns H1(s) and H2(s) . (c)(15%) Reduce the equations down to one equation for the unknown H1(s). (d)(6%) Use the final value theorem to determine the final value of H1. Does this value make sense? (e) (5%) Use the initial value theorem to check the initial value. Is it correct? 306 Exam 1b Solution 1. (15%) Obtain a linear approximation to the following differential equation using the initial and final values of z. ๐งฬ + 3๐งฬ + 6√๐ง = 12 ๐ง(0− ) = 1 0 + 0 + 6√๐ง = 12 ๐กโ๐ข๐ , ๐ง(∞) = 4 1 2 √๐ง ≅ ๐ง + 3 3 ๐ง 2 ๐งฬ + 3๐งฬ + 6[ + ] = 12 3 3 ๐งฬ + 3๐งฬ + 2๐ง = 8 2. Consider the following Laplace transform for Z(s): ๐(๐ ) = 6๐ 2 + 20๐ + 80 ๐ [๐ 2 + 12๐ + 40] (a) (5%) Use the final value theorem (FVT) to compute the final value of z(t). 80 ๐ ๐(๐ )๐ =0 = =2 40 (b)(5%) Use the initial value theorem (IVT) to compute the value of z(t) at t = 0+. ๐ ๐(๐ )๐ =∞ = 6 (c)(9%) What are the poles of Z(s) which are the roots of the denominator polynomial? ๐ = 0, − 6 + ๐2, − 6 − ๐2 FVT: ๐๐๐๐๐ก ๐ ๐น(๐ )๐ →0 IVT: ๐๐๐๐๐ก ๐ ๐น(๐ )๐ →∞ 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 − ๐ป2 = 250๐ฬ ๐ป1 (0− ) = 3 ๐ป2 (0− ) = 5 ๐(0− ) = 0 307 H1 H2 Q (a) (25%) Laplace transform each of these three equations. −๐ − 20[๐ ๐ป1 (๐ ) − 3] = 0 ๐ − 40[๐ ๐ป2 − 5] = 0 ๐ป1 − ๐ป2 = 250[๐ ๐(๐ ) − 0] (b)(15%) Reduce the equations down to two equations with unknowns H1(s) and H2(s) . ๐ป1 − ๐ป2 ๐= 250๐ Thus, − ๐ป1 − ๐ป2 − 20[๐ ๐ป1 (๐ ) − 3] = 0 250๐ ๐ป1 − ๐ป2 − 40[๐ ๐ป2 − 5] = 0 250๐ (c)(15%) Reduce the equations down to one equation for the unknown H1(s). ๐ป2 = [5,000๐ 2 + 1]๐ป1 + 15,000๐ Thus, ๐ป1 = 1.5๐ฅ108 ๐ 2 + 65,000 ๐ (5๐ฅ107 ๐ 2 + 15,000) (d)(6%) Use the final value theorem to determine the final value of H1. Does this value make sense? 65,000 ๐ ๐ป1 (๐ )๐ =0 = = 4.333 15,000 Since the initial water height in this tank was 3 and the other 5, a final value between 3 and 5 makes sense. However, the poles of the denominator are complex with zero real part which means the H1 will oscillate forever and never reach a constant value. So, the final value theorem cannot be used in such cases. (e) (5%) Use the initial value theorem to check the initial value. Is it correct? ๐ ๐ป1 (๐ )๐ =∞ = 1.5๐ฅ108 5๐ฅ107 = 3 which is the correct value. 308 Exam 1c 1. Consider the following differential equation with input u. ๐งโ + 8๐งฬ + 37๐งฬ + 50๐ง = 150๐ข + 25๐ขฬ (a) (5%) What is the transfer function for z? (b) Consider the following MATLAB command and results: >> roots([1 8 37 50]) ans: -2, -3-j4, -3+j4 (b.1) (6%) What are the eigenvalues of this system? (b.2) (4%) What are the time constants of this system? (b.3) (2%) What is the damped natural frequency of this system? (b.4) (2%) What is the undamped natural frequency of this system? (b.5) (2%) What is the damping ratio? (b.6) (4%) Assume that the input u is a constant of 4. About how long will it take for z to reach its final value and what will be the final value? 2. The differential equations for the suspension shown below with input displacement u(t) are ๐งฬ + 2๐งฬ + 10๐ง = 2๐คฬ + 10๐ค 2๐คฬ + 20๐ค = 2๐งฬ + 10๐ง + 10๐ข (a) (20%) Find the transfer function for z Z W U 309 (b) (10%) The MATLAB command for entering a transfer function is as follows: >> H=tf(a,b) For this problem, what is a and what is b? a= ? b= ? 3. Consider the following differential equation with a constant input: 2๐งฬ + 4√15๐งฬ + 2๐ง 3 = 54 ๐ง(0− ) = 2 ๐งฬ (0− ) = 0 (a) (15%) Linearize this differential equation by obtaining a straight line approximation for ๐ง 3 . (b) (10%) What are the eigenvalues of the linearized differential equation? Note, √15 = 3.872983346 4. (20%) Consider the following differential equation with input u: 2๐ฆฬ + 16 ๐ฆฬ + 30๐ฆ = 2๐ขฬ + 4๐ข What are the modes of this system? Exam 1c Solution 1. Consider the following differential equation with input u. ๐งโ + 8๐งฬ + 37๐งฬ + 50๐ง = 150๐ข + 25๐ขฬ (a) (5%) What is the transfer function for z? (can be in terms of D or s) 25๐ท + 150 3 ๐ท + 8๐ท2 + 37๐ท + 50 (b) Consider the following MATLAB command and results: >> roots([1 8 37 50]) ans: -2, -3-j4, -3+j4 (b.1) (6%) What are the eigenvalues of this system? -2, -3-j4, -3+j4 (b.2) (4%) What are the time constants of this system? ½ and 1/3 (b.3) (2%) What is the damped natural frequency of this system? 4 rad/sec (b.4) (2%) What is the undamped natural frequency? ๐๐ = √32 + 42 = 5 ๐๐๐/๐ ๐๐ 310 (b.5) (2%) What is the damping ratio? Damping ratio = 0.6 (b.6) (4%) Assume that the input u is a constant of 4. About how long will it take for z to reach its final value and what will be the final value? 5*0.5=2.5 sec. Set the derivatives to zero in the differential equation to get: 50*z=150*4 or z =12 2. The differential equations for the suspension shown below with input displacement u(t) are ๐งฬ + 2๐งฬ + 10๐ง = 2๐คฬ + 10๐ค 2๐คฬ + 20๐ค = 2๐งฬ + 10๐ง + 10๐ข (a) (20%) Find the transfer function for z Z W U Converting differential equations to algebraic equations using the D or s operator and solving for z gives the following transfer function: 2๐ท3 20๐ท + 100 + 20๐ท2 + 20๐ท + 100 (b) (10%) The MATLAB command for entering a transfer function is as follows: >> H=tf(a,b) For this problem, what is a and what is b? a= [20 100]; b= [2 20 20 100]; 3. Consider the following differential equation with a constant input: 2๐งฬ + 4√15๐งฬ + 2๐ง 3 = 54 ๐ง(0− ) = 2 ๐งฬ (0− ) = 0 (a) (15%) Linearize this differential equation by obtaining a straight line approximation for ๐ง 3 . z starts at 2 and ends at 3; thus, a straight line through these two points gives 311 ๐งฬ + 2√15๐งฬ + 19๐ง = 57 (b)(10%) What are the eigenvalues of the linearized differential equation? Note, √15 = 3.872983346 ๐๐๐๐๐๐ฃ๐๐๐ข๐๐ = −√15 ± √15 − 19 = −√15 ± ๐2 = −3.873 ± ๐2 4. (20%) Consider the following differential equation with input u: 2๐ฆฬ + 16 ๐ฆฬ + 30๐ฆ = 2๐ขฬ + 4๐ข What are the modes of this system? The modes are the partial fractions of the transfer function, i.e. ๐ท+2 −0.5 1.5 + [ 2 ]= ๐ท + 8๐ท + 15 ๐ท+3 ๐ท+5 −0.5 Usually, the first mode is the one with the largest time constant. So, the first mode is ๐ท+3 and the second mode is 1.5 . ๐ท+5 Exam 2a 1. The differential equations for the suspension shown below with input displacement u(t) are ๐งฬ + 10๐งฬ + 100๐ง = 10๐คฬ + 100๐ค ๐คฬ + 40๐ค = ๐งฬ + 10๐ง + 30๐ข (a) (10%) Assume all initial conditions are zero and convert the equations above to Laplace domain. 312 Z W U (b) (10%) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 (c) (10%) What is the transfer function for this system? (d) (12%) Consider the following MATLAB command and results: >> roots([1 40 300 3000]) ans = -33.7442 -3.1279 + 8.8950i -3.1279 - 8.8950i What are the eigenvalues of this system? (e) (8%) What are the time constants of this system? (f) (12%) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown to be ๐ง(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (โ๐ก + ∅) What are b = _______ d = _______________ g = __________ h = ________________ (g) (8%) What is the final value of z(t) and how long will it take to get within 1% of this value? 2. (15%) Use the residue theorem to solve the following differential equation for y(t). 22๐ฆฬ + 44๐ฆ = 88 ๐ฆ(0− ) = 5 3. (15%) Use separation of variables to solve the differential equation in problem 2. 313 Exam 2a Solution 1. The differential equations for the suspension shown below with input displacement u(t) are ๐งฬ + 10๐งฬ + 100๐ง = 10๐คฬ + 100๐ค ๐คฬ + 40๐ค = ๐งฬ + 10๐ง + 30๐ข (a) (10%) Assume all initial conditions are zero and convert the equations above to Laplace domain. Z W U (๐ 2 + 10๐ + 100)๐ = (10๐ + 100)๐ (๐ + 40)๐ = (๐ + 10)๐ + 30๐ (b) (10%) Demonstrate that if you solve for W(s) in the first equation and then substitute this expression for W(s) into the 2nd equation, when you solve for Z(s) you get 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 2 ๐ + 10๐ + 100 (๐ + 40) ( ) ๐ = (๐ + 10)๐ + 30๐ 10๐ + 100 (๐ + 40)(๐ 2 + 10๐ + 100) = (10๐ + 100)(๐ + 10)๐ + 30(10๐ + 100)๐ (๐ 3 + 50๐ 2 + 500๐ + 4000 − 10๐ 2 − 200๐ − 1000)๐ = (300๐ + 3000)๐ 3000 + 300๐ ๐(๐ ) = [ 3 ] ๐(๐ ) ๐ + 40๐ 2 + 300๐ + 3000 (c) (10%) What is the transfer function for this system? 3000 + 300๐ [ 3 ] ๐ + 40๐ 2 + 300๐ + 3000 (d) (12%) Consider the following MATLAB command and results: >> roots([1 40 300 3000]) ans = -33.7442 -3.1279 + 8.8950i -3.1279 - 8.8950i What are the eigenvalues of this system? -33.7442 -3.1279 + 8.8950i -3.1279 - 8.8950i (e) (8%) What are the time constants of this system? 1/33.7442 = 0.0296 and 1/3.1279 = 0.3197 (f) (12%) If the input u(t) is a unit step, the general form of the equation for z(t) can be shown to be ๐ง(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (โ๐ก + ∅) 314 ๐(๐ ) = [ What are b=0 d = 33.7442 3000 + 300๐ 1 ] ๐ 3 + 40๐ 2 + 300๐ + 3000 ๐ g = 3.1279 h = 8.8950 (g) (8%) What is the final value of z(t) and how long will it take to get within 1% of this value? Final Value = sZ(s)s=0 = 3000/3000 = 1 Time required ≅ 5*0.3197 =1.6 sec 2. (15%) Use the residue theorem to solve the following differential equation for y(t). 22๐ฆฬ + 44๐ฆ = 88 ๐ฆ(0− ) = 5 22(๐ ๐๐ ) − 5) + 44๐(๐ ) = 88/๐ ๐(๐ ) = 5๐ + 4 ๐ (๐ + 2) ๐ฆ(๐ก) = 2 + 3๐ −2๐ก 3. (15%) Use separation of variables to solve the differential equation in problem 2. ๐ฆ(๐ก) ๐ก ๐๐ฆ ∫ = − ∫ ๐๐ก ๐ฆ(0) 2๐ฆ − 4 0 ๐๐ [ 2๐ฆ(๐ก) − 4 ] = −2๐ก 2๐ฆ(0) − 4 2๐ฆ(๐ก) − 4 = ๐ −2๐ก 2๐ฆ(0) − 4 ๐ฆ(๐ก) = 2 + 3๐ −2๐ก Exam 2b 1. (30%) Find the magnitude and angle of the following complex numbers: 4 + j4 -4 + j4 -4 – j4 4 - j4 (4 + ๐4)(−4 + ๐4) 4 − ๐4 2. For the differential equation below, 2๐งฬ + 24๐งฬ + 40๐ง = 20๐ข ๐ง(0− ) = 0.5 ๐งฬ (0− ) = 3 ๐ข(๐ก) = 5 315 (a) (20%) Solve for the Laplace transform of z(t), i.e. Z(s)=?. (b)(5%) Check your Z(s) to see if it gives the correct initial value using the initial value theorem. (c)(5%) Check your Z(s) to see if it gives the correct final value using the final value theorem. IVT: limit sF(s)s=∞ FVT: limit sF(s)s=0 ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ} = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ (0− ) 3. (a) (30%) Find the inverse Laplace transform of Y(s) below. 32 ๐(๐ ) = ๐ [(๐ + 4)2 + 42 ] (b) (5%) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT. (c) (5%) Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT. Portion of inverse Laplace for complex poles of ๐(๐ ) [(๐ +๐)2 +๐2 ]๐ท(๐ ) ๐ −๐๐ก ๐(−๐+๐๐) | | sin (๐๐ก ๐ ๐ท(−๐+๐๐) + ๐(−๐+๐๐) ๐๐๐๐๐ [๐ท(−๐+๐๐)]) Exam 2b Solution 1. (30%) Find the magnitude and angle of the following complex numbers: +4 ๐ +4 4 3๐ −1 +4 2 2 -4 + j4 Magnitude= √4 + 4 = √32 = 5.66 ๐๐๐๐๐ = ๐ก๐๐ ( ) = −4 4 −4 5๐ -4 – j4 Magnitude= √42 + 42 = √32 = 5.66 ๐๐๐๐๐ = ๐ก๐๐−1 (−4) = 4 −4 7๐ 4 - j4 Magnitude=√42 + 42 = √32 = 5.66 ๐๐๐๐๐ = ๐ก๐๐−1 ( ) = +4 4 (4+๐4)(−4+๐4) ๐ 3๐ 7๐ 3๐ Magnitude= 5.66*5.66/5.66 = 5.66 ๐๐๐๐๐ = 4 + 4 − 4 = − 4 4−๐4 4 + j4 Magnitue= √42 + 42 = √32 = 5.66 2. ๐๐๐๐๐ = ๐ก๐๐−1 ( ) = For the differential equation below, 2๐งฬ + 24๐งฬ + 40๐ง = 20๐ข ๐ง(0− ) = 0.5 (a) (20%) Solve for the Laplace transform of z(t), Z(s). ๐งฬ (0− ) = 3 2[๐ 2 ๐(๐ ) − 0.5๐ − 3] + 24[๐ ๐(๐ ) − 0.5] + 40๐(๐ ) = 20 ๐(๐ ) = ๐ข(๐ก) = 5 5 ๐ 0.5๐ 2 + 9๐ + 50 ๐ (๐ 2 + 12๐ + 20) (b)(5%) Check your Z(s) to see if it gives the correct initial value using the initial value theorem. ๐ ๐(๐ )๐ =∞ = 0.5 ๐คโ๐๐โ ๐โ๐๐๐๐ 316 (c)(5%) Check your Z(s) to see if it gives the correct final value using the final value theorem. 50 ๐ ๐(๐ )๐ =0 = = 2.5 ๐คโ๐๐โ ๐โ๐๐๐๐ ๐ค๐๐กโ ๐๐๐๐๐๐๐๐ ๐๐๐๐. ๐๐๐ ๐ค๐๐กโ ๐๐๐๐๐ฃ๐๐ก๐๐ฃ๐๐ = 0 20 IVT: limit sF(s)s=∞ FVT: limit sF(s)s=0 ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ} = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ (0− ) 3. (a) (30%) Find the inverse Laplace transform of Y(s) below. 32 ๐(๐ ) = ๐ [(๐ + 4)2 + 42 ] 32๐ ๐ ๐ก 1 32 32 + | | ๐ −4๐ก sin [4๐ก + ๐๐๐๐๐( )๐ =−4+๐4 ] } 2 2 [(๐ + 4) + 4 ] ๐ =0 4 ๐ ๐ =−4+๐4 ๐ 1 32 −4๐ก 3๐ 3๐ =1+ ๐ sin (4๐ก − ) = 1 + √2๐ −4๐ก sin (4๐ก − ) 4 √32 4 4 (b) (5%) Plug t = 0 into your equation for y(t) and see if it gives the same value as the IVT. ๐ฆ(0) = 1 − 1 = 0 ๐คโ๐๐โ ๐โ๐๐๐๐ ๐ค๐๐กโ ๐ผ๐๐ (c) (5%) Plug t=∞ into your equation for y(t) and see if it gives the same value as the FVT. ๐ฆ(∞) = 1 − 0 = 1 ๐คโ๐๐โ ๐โ๐๐๐๐ ๐ค๐๐กโ ๐น๐๐ ๐ฆ(๐ก) = { Exam 2c 1. (a) (10%) Find the initial and final values for the following Laplace transform using the Initial Value Theorem and the Final Value theorem: 2๐ + 4 ๐(๐ ) = ๐ (2๐ + 10)(๐ + 10) (b) (20%) Use residue theorem to find the inverse Laplace transform of W(s) in part (a); check you final equation at t = 0 and at t = ∞. 2. The input to the vehicle suspension shown below is the displacement u(t). The equations that define this suspension are as follows: 317 (b) Suppose that the transfer function for w is as follows: 8๐ +25 ๐ 2 +8๐ +25 (b.1) (2%) What is the DC gain? (b.2) (4%) What are the eigenvalues? (b.3) (2%) What is the undamped natural frequency, ๐๐ ? (b.4) (2%) What is the damping ratio? (b.5) (2%) What is the time constant? (b.6) (2%) If u(t) is a bump, about how long will it take to return to equilibrium? 3. (36%) Using the transfer function for the suspension in (2.b) above, assume that u(t) is a unit step input and get an equation for w(t). Exam 2c Solution 1. (a) (10%) Find the initial and final values for the following Laplace transform using the Initial Value Theorem and the Final Value theorem: ๐(๐ ) = 2๐ + 4 ๐ (2๐ + 10)(๐ + 10) 0+4 FVT gives (0+10)(0+10) = 0.04 Dividing the numerator and denominator by s2, the IVT gives [ 2/๐ +4/๐ 2 10 ๐ 10 ๐ (2+ )(1+ ) ] =0 ๐ =∞ (b) (20%) Use residue theorem to find the inverse Laplace transform of W(s) in part (a); check you final equation at t = 0 and at t = ∞. 0+2 −5 + 2 −10 + 2 ๐ค(๐ก) = ๐ −0๐ก + ๐ −5๐ก + ๐ −10๐ก (0 + 5)(0 + 10) (−5)(−5 + 10) (−10)(−10 + 5) = 0.04 + 0.12๐ −5๐ก − 0.16๐ −10๐ก Checking: ๐ค(๐ก)๐ก=∞ = 0.04 + 0 + 0 = 0.04 which checks ๐ค(๐ก)๐ก=0 = 0.04 + 0.12 − 0.16 = 0 which checks 2. The input to the vehicle suspension shown below is the displacement u(t). The equations that define this suspension are as follows: 318 (b) Suppose that the transfer function for w is as follows: 8๐ +25 ๐ 2 +8๐ +25 (b.1) (2%) What is the DC gain? 1 (b.2) (4%) What are the eigenvalues? -4±๐3 (b.3) (2%) What is the undamped natural frequency, ๐๐ ? 5 rad/sec (b.4) (2%) What is the damping ratio? 0.8 (b.5) (2%) What is the time constant? 0.25 sec (b.6) (2%) If u(t) is a bump, about how long will it take to return to equilibrium? 1.25 sec 3. (36%) Using the transfer function for the suspension in (2.b) above, assume that u(t) is a unit step input and get an equation for w(t). 8๐ + 25 1 8๐ + 25 ๐(๐ ) = [ 2 ] = ๐ + 8๐ + 25 ๐ ๐ [(๐ + 4)2 + 32 ] 25 0๐ก ๐ −4๐ก ๐ค(๐ก) = ๐ + ๐ ๐ ๐๐( 3๐ก + ๐) 25 3 8๐ + 25 8(−4 + ๐3) + 25 √(−7)2 + (24)2 25 ๐=| | =| |= = =5 ๐ −4 + ๐3 5 ๐ =−4+๐3 √(−4)2 + (3)2 ๐ = ๐๐๐๐๐(−7 + 24๐) − ๐๐๐๐๐(−4 + ๐3) ≈ (๐ − 1.28) − (๐ − 0.64) = −0.64 ๐ค(๐ก) = 1 + 1.66๐ −4๐ก ๐ ๐๐( 3๐ก − 0.64) Exam 3a 1. Consider the following differential equation for y(t). 2๐ฆฬ + 5๐ฆ = 25 ๐ฆ(0− ) = 6 (a) (25%) Use the Laplace transform and the residue theorem to solve this differential equation for y(t). (b) (10%) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the correct values at t = 0 and at t = ∞? (c) (15%) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time constant for T. 2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐ฃ. The model for the system is represented by the following equations : 1000๐ฃฬ + 0.05๐ = 9800 ๐ = 100000๐ ๐ = 0.05๐ฃ Velocity v Pressure P Flow Rate Q 319 (a) (5%) We have three equations. What are the three unknowns? (b) (20%) Assuming the initial velocity is zero, Laplace transform the equations and then find a single equation for the Laplace transform of the pressure P(s). (c) (10%) What is the final value for P(t) and how long does it take for P(t) to reach this final value within 1 %? 3. (10%) Express the following 3rd order differential equation in a format of three simultaneous 1st order differential equations. All initial conditions are zero. 2๐งโ + 16๐งฬ + 8๐งฬ + 5๐ง = 10 4. (5%) Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer function with the input being a unit impulse. What are the MATLAB commands for getting a plot of w(t) using the 'impulse' command in MATLAB? 2๐ + 4 ๐(๐ ) = 2 3๐ + 20๐ + 5 >> help tf TF Creation of transfer functions or conversion to transfer function. SYS = TF(NUM,DEN) creates a continuous-time transfer function SYS with numerator(s) NUM and denominator(s) DEN. The output SYS is a TF object. >> help impulse IMPULSE Impulse response of LTI models. IMPULSE(SYS) plots the impulse response of the LTI model SYS (created with either TF, ZPK, or SS). Exam 3a Solution 1. Parts (a) and (b) of this problem are the Key Assignment. Consider the following differential equation for y(t). 2๐ฆฬ + 5๐ฆ = 25 ๐ฆ(0− ) = 6 (a) (25%) Use the Laplace transform and the residue theorem to solve this differential equation for y(t). 2(๐ ๐ − 6) + 5๐ = 25/๐ 6๐ + 12.5 ๐(๐ ) = ๐ (๐ + 2.5) ๐ฆ(๐ก) = 5 + ๐ −2.5๐ก (b) (10%) Check your equation for y(t) at t = 0 and at t = ∞. Does your equation give the correct values at t = 0 and at t = ∞? ๐ฆ(๐ก)๐ก=0 = 6 ๐ฆ(๐ก)๐ก=∞ = 5 Thus, the equation for y(t) gives the correct initial and final values. (c) (15%) Perform two steps of Euler's integration to get y(T) and y(2T). Use 1/10 of the time constant for T. Time constant is 0.4 seconds so T=0.04. 320 t 0 0.04 0.08 y(t) ๐ฆฬ (๐ก) = −2.5๐ฆ + 12.5 ๐ฆ(๐ก + ๐) = ๐๐ฆฬ (๐ก) + ๐ฆ(๐ก) 6 12.5-2.5*6=-2.5 0.04*(-2.5)+6=5.9 5.9 12.5-2.5*5.9=-2.25 0.04*(-2.25)+5.9=5.81 5.81 2. Consider the hydraulic lift system shown below. Fluid flows, Q, into the bottom of the hydraulic cylinder. The pressure, P, increases and pushes the mass upwards with velocity ๐ฃ. The model for the system is represented by the following equations : 1000๐ฃฬ + 0.05๐ = 9800 ๐ = 100000๐ ๐ = 0.05๐ฃ Velocity v Pressure P Flow Rate Q (a) (5%) We have three equations. What are the three unknowns? v, P, and Q (b) (20%) Assuming the initial velocity is zero, Laplace transform the equations and then find a single equation for the Laplace transform of the pressure P(s). 9800 1000๐ ๐ + 0.05๐ = ๐ ๐ = 100000๐ ๐ = 0.05๐ Solving for P gives 49000 ๐(๐ ) = ๐ (๐ + 0.25) (c) (10%) What is the final value for P(t) and how long does it take for P(t) to reach this final value within 1 %? 49000 ๐ ๐(๐ )๐ =0 = = 196000 It takes about 5 time constants which is 20 seconds. (๐ +0.25)๐ =0 321 3. (10%) Express the following 3rd order differential equation in a format of three simultaneous 1st order differential equations. All initial conditions are zero. 2๐งโ + 16๐งฬ + 8๐งฬ + 5๐ง = 10 ๐ฅ1 = ๐ง ๐ฅ2 = ๐งฬ ๐ฅ3 = ๐งฬ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = ๐ฅ3 ๐ฅฬ 3 = 5 − 2.5๐ฅ1 − 4๐ฅ2 − 8๐ฅ3 4. (5%) Consider the Laplace transform W(s) shown below. Pretend that W(s) is a transfer function with the input being a unit impulse. What are the MATLAB commands for getting a plot of w(t) using the 'impulse' command in MATLAB? 2๐ + 4 ๐(๐ ) = 2 3๐ + 20๐ + 5 >> w=tf([2 4],[3 20 5]); >> impulse(w) >> help tf TF Creation of transfer functions or conversion to transfer function. SYS = TF(NUM,DEN) creates a continuous-time transfer function SYS with numerator(s) NUM and denominator(s) DEN. The output SYS is a TF object. >> help impulse IMPULSE Impulse response of LTI models. IMPULSE(SYS) plots the impulse response of the LTI model SYS (created with either TF, ZPK, or SS). ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ} = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ (0− ) Exam 3b 1. Use Laplace transform to solve the following differential equations for z(t): (a) (10%) ๐งฬ + 25๐ง = 2๐ขฬ + 15๐ข ๐ง(0− ) = 4 The input u(t) is a step with magnitude 5. (b) (10%) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’ command. (c) (10%) ๐งฬ + 6๐งฬ + 25๐ง = 50๐ข(๐ก) ๐ง(0− ) = 1 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. ๐ฟ๐๐. [๐(๐ก)] = ๐น(๐ ) ๐ฟ๐๐. [ ๐ฬ (๐ก)] = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ๐๐. [๐ฬ (๐ก)] = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) 1 ๐(๐ ) ๐(๐ ) ) | | ๐ −๐๐ก sin(๐๐ก + ๐) ๐ = ๐๐๐๐๐ ( ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐ท(๐ ) ๐ =−๐+๐๐ 2. A vehicle suspension system is defined by the following differential equations with input u(t): 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข (a) (20%) Define state variables and then find the equations for the derivatives of the state variables. 322 (b) (10%) Express your state variable derivative equations from (a) in state variable matrix format assuming the output of interest is y = u - v, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 84๐ฃฬ + 300๐ฃ 3 = 2400 ๐ฃ(0− ) = 1.9 ๐ฃฬ (0− ) = 2 (a) (10%) What is the equilibrium (final value) of v(t)? (b) (15%) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. (c) (5%) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. (d) (5%) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? (e) (5%) What are the eigenvalues of your linearized differential equation? Time constants? ๐(๐ฃ) = ๐(๐ฃ๐ ) + [ ๐๐ 1 ๐ 2๐ ] (๐ฃ − ๐ฃ๐ ) + [ 2 ] (๐ฃ − ๐ฃ๐ )2 + โฏ ๐๐ฃ ๐ฃ๐ 2! ๐๐ฃ ๐ฃ ๐ Exam 3b Solution 1. Use Laplace transform to solve the following differential equations for z(t): (a) (10%) ๐งฬ + 25๐ง = 2๐ขฬ + 15๐ข ๐ง(0− ) = 4 The input u(t) is a step with magnitude 5. ๐ ๐(๐ ) − 4 + 25๐(๐ ) = (2๐ + 15) ๐(๐ ) = ๐ ๐ฌ 14๐ + 75 ๐ (๐ + 25) ๐ง(๐ก) = 3 + 11๐ −25๐ก (b) (10%) What are MATLAB commands to get a plot of z(t) in part (a) using the ‘impulse’ command. >> z=tf([14 75],[1 25 0]); >> impulse(z) (c) (10%) ๐งฬ + 6๐งฬ + 25๐ง = 50๐ข(๐ก) ๐ง(0− ) = 1 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. (๐ 2 ๐(๐ ) − 1๐ ) + 6(๐ ๐(๐ ) − 1) + 25๐(๐ ) = 50(๐) ๐(๐ ) = ๐ + 56 (๐ + 3)2 + 42 1 ๐ง(๐ก) = |๐ + 56|๐ =−3+๐4 ๐ −3๐ก sin (4๐ก + ๐๐๐๐๐(๐ + 56)๐ =−3+๐4 ) 4 ๐ง(๐ก) = 13.29๐ −3๐ก sin (4๐ก + 0.0753) ๐ฟ๐๐. [๐(๐ก)] = ๐น(๐ ) ๐ฟ๐๐. [ ๐ฬ (๐ก)] = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ๐๐. [๐ฬ (๐ก)] = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) 323 1 ๐(๐ ) | | ๐ −๐๐ก sin(๐๐ก + ๐) ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐(๐ ) ) ๐ = ๐๐๐๐๐ ( ๐ท(๐ ) ๐ =−๐+๐๐ 2. A vehicle suspension system is defined by the following differential equations with input u(t): 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข ๐คฬ + 6๐คฬ + 25๐ค = 6๐ฃฬ + 25๐ฃ ๐ฃฬ + 4.5๐ฃฬ + 25๐ฃ = 3๐คฬ + 12.5๐ค + 1.5๐ขฬ + 12.5๐ข (a) (20%) Define state variables and then find the equations for the derivatives of the state variables. ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ ๐ฅ4 = ๐ฃฬ − 1.5๐ข ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −25๐ฅ1 − 6๐ฅ2 + 25๐ฅ3 + 6๐ฅ4 + 9๐ข ๐ฅฬ 3 = ๐ฅ4 + 1.5๐ข ๐ฅฬ 4 = 12.5๐ฅ1 + 3๐ฅ2 − 25๐ฅ3 − 4.5๐ฅ4 + 5.75๐ข (b) (10%) Express your state variable derivative equations from (a) in state variable matrix format assuming the output of interest is y = u - v, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต =? ๐ถ =? ๐ท =? 0 0 1 0 0 25 6 ] ๐ต = [ 9 ] ๐ถ = [0 0 ๐ด = [−25 −6 0 0 0 1 1.5 12.5 3 −25 −4.5 5.75 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 84๐ฃฬ + 300๐ฃ 3 = 2400 −1 0] ๐ท = [1] ๐ฃ(0− ) = 1.9 ๐ฃฬ (0− ) = 2 (a) (10%) What is the equilibrium (final value) of v(t)? 0 + 0 + 300๐ฃ 3 = 2400 ๐กโ๐ข๐ ๐ฃ(∞) = 2 (b) (15%) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. ๐ฃ 3 ≈ 23 + 3(2)2 (๐ฃ − 2) = 12๐ฃ − 16 (c) (5%) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. ๐ฃฬ + 84๐ฃฬ + 300(12๐ฃ − 16) = 2400 ๐ฃฬ + 84๐ฃฬ + 3600๐ฃ = 7200 (d) (5%) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? 324 7200 = 2 ๐คโ๐๐โ ๐โ๐๐๐๐ 3600 (e) (5%) What are the eigenvalues of your linearized differential equation? Time constants? ๐ฃ= ๐ 2 + 84๐ + 3600 = (๐ + 42 + ๐42.85)(๐ + 42 − ๐42.85) ๐๐๐๐๐๐ฃ๐๐๐ข๐๐ = −42 ± ๐42.85 1 = 0.0238 ๐ ๐๐๐๐๐๐ 42 ๐๐ 1 ๐ 2๐ ๐(๐ฃ) = ๐(๐ฃ๐ ) + [ ] (๐ฃ − ๐ฃ๐ ) + [ 2 ] (๐ฃ − ๐ฃ๐ )2 + โฏ ๐๐ฃ ๐ฃ๐ 2! ๐๐ฃ ๐ฃ ๐ก๐๐๐ ๐๐๐๐ ๐ก๐๐๐ก = ๐ Exam 3c 1. Use the Laplace transform to solve the following differential equations for w(t). In each case, check W(s) using the initial and final value theorems. Also, using your final equation for w(t), check using w(t) at t = 0 and at t = ∞. Also, in each case determine the time constant(s). (a) (19 pts) 4๐คฬ + 40๐ค = 0 ๐ค(0− ) = 5 (b) (19 pts) 2๐คฬ + 12๐คฬ + 50๐ค = 12๐ขฬ + 50๐ข ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 u(t) 2 0 t 2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity 156.2 m/s. The differential eqn for the vertical displacement is ๐ฆฬ + 0.005๐๐ฆฬ ≈ −10 ๐ฆ(0− ) = 2 ๐ ๐ฆฬ (0− ) = 100 ๐/๐ and the equation for the horizontal displacement is ๐คฬ + 0.005๐๐คฬ = 0 ๐ค(0− ) = 0 ๐ ๐คฬ (0− ) = 120 ๐/๐ where ๐ = √๐ฆฬ 2 + ๐คฬ 2 (a) (16 pts) Express these equations in state variable format for an ode45 simulation. (b) (26 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations. [t,x]=ode45(@Exam3Eqns,[0 10],[ 2 100 0 120 ]); y=x(:,1); w=x(:,3); plot(?,?) xlabel(‘ horizontal displacement, m ‘) ylabel(‘ height, m‘) 325 function dx=Exam3Eqns(t,x) dx=zeros( ? , 1); dx(1)= ?; dx(2)=?; dx(3)=?; dx(4)=?; end (c) (5 pts) Draw a sketch of what you think the plot will look like. y 2 w 0 3. (10 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b) above for T=0.02 and u(t) piecewise constant is shown below. What is the discrete time solution to this this differential equation? 0.1177๐ง − 0.1083 ๐(๐ง) = [ 2 ] ๐(๐ง) ๐ง − 1.878๐ง + 0.8869 ๐{๐(๐ก)) = ๐น(๐ง) ๐{๐(๐ก + ๐)} = ๐ง๐น(๐ง) ๐{(๐(๐ก + 2๐)} = ๐ง 2 ๐น(๐ง) ๐{๐(๐ก − ๐)} = ๐ง −1 ๐น(๐ง) ๐(๐(๐ก − 2๐)} = ๐ง −2 ๐น(๐ง) 4. (22 pts) Express the following differential equation in state variable format assuming ๐คฬ is the output of interest. The input is a step with magnitude of 2. What are the initial conditions for the state variables? A = ? B = ? C = ? D = ? initial conditions = ? 2๐คฬ + 12๐คฬ + 50๐ค = 12๐ขฬ + 50๐ข ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 Exam 3c Solution 1. Use the Laplace transform to solve the following differential equations for w(t). In each case, check W(s) using the initial and final value theorems. Also, using your final equation for w(t), check using w(t) at t = 0 and at t = ∞. Also, in each case determine the time constant(s). (a) (19 pts) 4๐คฬ + 40๐ค = 0 ๐ค(0− ) = 5 ๐คฬ + 10๐ค = 0 5 ๐น๐๐ ๐๐๐ฃ๐๐ 0 ๐ผ๐๐ ๐๐๐ฃ๐๐ 5 ๐ก๐๐๐ ๐๐๐๐ ๐ก๐๐๐ก = 0.1 ๐ + 10 ๐ค(๐ก) = 5๐ −10๐ก ๐ค(0) = 5 ๐ค(∞) = 0 ๐(๐ ) = 326 (b) (19 pts) 2๐คฬ + 12๐คฬ + 50๐ค = 12๐ขฬ + 50๐ข u(t) ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 EV = −3 ๏ฑ j 4 ๏ด = 1/ 3 2 0 t 6๐ + 25 2 ] ๐น๐๐ ๐๐๐ฃ๐๐ 2 ๐ผ๐๐ ๐๐๐ฃ๐๐ 0 (๐ + 3)2 + 42 ๐ ๐ 12๐ + 50 ๐ค(๐ก) = 2 + ๐ −3๐ก sin(4๐ก + ∅) ๐=| | = 10 4 ๐ ๐ =−3+๐4 ∅ = ๐๐๐(14 + ๐48) − ๐๐๐(−3 + ๐4) = −0.9273 ๐(๐ ) = [ ๐ค(๐ก) = 2 + 2.5๐ −3๐ก ๐ ๐๐(4๐ก − 0.9273) For ๐ = −๐ ± ๐๐, 2. ๐ ๐ ๐ −๐๐ก sin(๐๐ก + ๐) ๐=| ๐(๐ ) | ๐ท(๐ ) ๐ =−๐+๐๐ ๐ค(0) = 2 − 2 = 0 ๐ค(∞) = 2 ๐(๐ ) ๐ = ๐๐๐๐๐ { } ๐ท(๐ ) ๐ =−๐+๐๐ A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity 156.2 m/s. The differential eqn for the vertical displacement is ๐ฆฬ + 0.005๐๐ฆฬ ≈ −10 ๐ฆ(0− ) = 2 ๐ ๐ฆฬ (0− ) = 100 ๐/๐ and the equation for the horizontal displacement is ๐คฬ + 0.005๐๐คฬ = 0 ๐ค(0− ) = 0 ๐ ๐คฬ (0− ) = 120 ๐/๐ where ๐ = √๐ฆฬ 2 + ๐คฬ 2 (a) (16 pts) Express these equations in state variable format for an ode45 simulation. (b) (26 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations. [t,x]=ode45(@Exam3Eqns,[0 10],[ 2 100 0 120 ]); y=x(:,1); w=x(:,3); plot(w,y) xlabel(‘ horizontal displacement, m ‘) ylabel(‘ height, m‘) function dx=Exam3Eqns(t,x) dx=zeros( ? , 1); dx(1)= x(2); V=sqrt(x(2)^2+x(4)^2); dx(2)=-10-0.005*V*x(2); dx(3)=x(4); dx(4)=-0.005*V*x(4); end 327 (c) (5 pts) Draw a sketch of what you think the plot will look like. y 2 w 0 3. (10 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b) above for T=0.02 and u(t) piecewise constant is shown below. What is the discrete time solution to this this differential equation? 0.1177๐ง − 0.1083 ๐(๐ง) = [ 2 ] ๐(๐ง) ๐ง − 1.878๐ง + 0.8869 ๐ง 2 ๐(๐ง) − 1.878๐ง๐(๐ง) + 0.8869๐(๐ง) = 0.1177๐ง๐(๐ง) − 0.1083๐(๐ง) Taking the inverse Z transform ๐ค๐+2 − 1.878๐ค๐ + 0.8869๐ค๐ = 0.1177๐ข๐+1 − 0.1083๐ข๐ Or ๐ค๐= 1.878๐ค๐−1 − 0.8869๐ค๐−2 + 0.1177๐ข๐−1 − 0.1083๐ข๐−2 ๐{๐(๐ก)) = ๐น(๐ง) ๐{๐(๐ก + ๐)} = ๐ง๐น(๐ง) ๐{(๐(๐ก + 2๐)} = ๐ง 2 ๐น(๐ง) ๐{๐(๐ก − ๐)} = ๐ง −1 ๐น(๐ง) ๐(๐(๐ก − 2๐)} = ๐ง −2 ๐น(๐ง) 4. (22 pts) Express the following differential equation in state variable format assuming ๐คฬ is the output of interest. The input is a step with magnitude of 2. What are the initial conditions for the state variables? A = ? B = ? C = ? D = ? initial conditions = ? ๐ฅ1 = ๐ค ๐ด=[ 0 −25 2๐คฬ + 12๐คฬ + 50๐ค = 12๐ขฬ + 50๐ข ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐ฅ2 = ๐คฬ − 6๐ข ๐ฅฬ1 = ๐ฅ2 + 6๐ข ๐ฅฬ 2 = −25๐ฅ1 − 6๐ฅ2 − 11๐ข ๐ฆ = ๐ฅ2 + 6๐ข 1 ] −6 6 ๐ต=[ ] ๐ถ = [0 −11 1] ๐ท = [6] ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 0 Exam 3d 1. Use Laplace transform to solve the following differential equations for z(t): (a) (15%) 2๐งฬ + 10๐ง = 4๐ขฬ + 20๐ข ๐ง(0− ) = 3 The input u(t) is a step with magnitude 2. −) (b) (15%) 10๐งฬ + 60๐งฬ + 250๐ง = 24๐ข(๐ก) ๐ง(0 = 0 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. 1 ๐(๐ ) ๐(๐ ) ) | | ๐ −๐๐ก sin(๐๐ก + ๐) ๐ = ๐๐๐๐๐ ( ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐ท(๐ ) ๐ =−๐+๐๐ 2. A vehicle suspension system is defined by the following differential equations with input u(t): 328 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข (a) (20%) Express this system of equations in state variable format. (b) (10%) Express your state variable equations from (a) in state variable matrix format assuming the output of interest is y = v - w, i.e. (c) ๐ฬ = ๐ด๐ + ๐ต๐ข = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต = ๐ถ =? ๐ท =? 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 2.4๐ฃฬ + 3๐ฃ 3 = 3000 ๐ฃ(0− ) = 10.01 ๐ฃฬ (0− ) = 2 (a) (10%) What is the equilibrium (final value) of v(t)? (b) (15%) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. (c) (5%) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. (d) (5%) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? (e) (5%) What are the eigenvalues of your linearized differential equation? Time constants? ๐(๐ฃ) = ๐(๐ฃ๐ ) + [ ๐๐ 1 ๐ 2๐ ] (๐ฃ − ๐ฃ๐ ) + [ 2 ] (๐ฃ − ๐ฃ๐ )2 + โฏ ๐๐ฃ ๐ฃ๐ 2! ๐๐ฃ ๐ฃ ๐ Exam 3d Solution 1. Use Laplace transform to solve the following differential equations for z(t): (a) (15%) 2๐งฬ + 10๐ง = 4๐ขฬ + 20๐ข ๐ง(0− ) = 3 The input u(t) is a step with magnitude 2. 2[๐ ๐ − 3] + 10๐ = [4๐ + 20]๐ 2 14๐ + 40 (2๐ + 10)๐ = (4๐ + 20) + 6 = ๐ ๐ 7๐ + 20 ๐(๐ ) = ๐ (๐ + 5) ๐ง(๐ก) = ๐ ๐๐ ๐๐๐ข๐ ๐๐๐ ๐ = 0 + ๐ ๐๐ ๐๐๐ข๐ ๐๐๐ ๐ = −5 ๐ง(๐ก) = 4 + 3๐ −5๐ก Checking z(t) at t = ∞ gives the correct value of 4. However, the t = 0+ value of z is different from the t = 0 value due to the impulse created by ๐ขฬ . (b) (15%) 10๐งฬ + 60๐งฬ + 250๐ง = 24๐ข(๐ก) ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 The input u(t) is a unit impulse. (10๐ 2 + 60๐ + 250)๐ = 24 2.4 ๐(๐ ) = (๐ + 3)2 + 42 1 ๐ง(๐ก) = |2.4 + ๐0|๐ −3๐ก sin[4๐ก + ๐๐๐๐๐(2.4 + ๐0)] = 0.6๐ −3๐ก sin (4๐ก) 4 329 The t = ∞ value of z and the t = 0- value check; note, we have the impulse input in the equation for ๐งฬ which changes the initial value of ๐งฬ but not the initial value of ๐ง. 1 ๐(๐ ) ๐(๐ ) ) | | ๐ −๐๐ก sin(๐๐ก + ๐) ๐ = ๐๐๐๐๐ ( ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐ท(๐ ) ๐ =−๐+๐๐ 2. A vehicle suspension system is defined by the following differential equations with input u(t): 100๐คฬ + 600๐คฬ + 2500๐ค = 600๐ฃฬ + 2500๐ฃ 200๐ฃฬ + 900๐ฃฬ + 5000๐ฃ = 600๐คฬ + 2500๐ค + 300๐ขฬ + 2500๐ข (a) (20%) Express this system of equations in state variable format. ๐คฬ + 6๐คฬ + 25๐ค = 6๐ฃฬ + 25๐ฃ ๐ฃฬ + 4.5๐ฃฬ + 25๐ฃ = 3๐คฬ + 12.5๐ค + 1.5๐ขฬ + 12.5๐ข ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐ฃ ๐ฅ4 = ๐ฃฬ − 1.5๐ข ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −25๐ฅ1 − 6 ๐ฅ2 + 25๐ฅ3 + 6๐ฅ4 + 9๐ข ๐ฅฬ 3 = ๐ฅ4 + 1.5๐ข ๐ฅฬ 4 = 12.5๐ฅ1 + 3๐ฅ2 − 25๐ฅ3 − 4.5๐ฅ4 + 5.75๐ข (b) (10%) Express your state variable equations from (a) in state variable matrix format assuming the output of interest is y = v - w, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข ๐ด =? ๐ต = ? ๐ถ =? ๐ท =? 0 0 1 0 0 25 6 ] ๐ด = [−25 −6 ๐ต=[ 9 ] ๐ถ = [−1 0 1 0] ๐ท = [0] 0 0 0 1 1.5 12.5 3 −25 −4.5 5.75 3. Consider the following non-linear differential equation for v(t): ๐ฃฬ + 2.4๐ฃฬ + 3๐ฃ 3 = 3000 ๐ฃ(0− ) = 10.01 ๐ฃฬ (0− ) = 2 (a) (10%) What is the equilibrium (final value) of v(t)? 0 + 0 + 3๐ฃ 3 = 1000 ๐ฃ(∞) = 10 (b) (15%) Find a straight line approximation for ๐ฃ 3 for values of ๐ฃ in the neighborhood of the equilibrium value. ๐ฃ 3 ≈ 103 + 3(102 )(๐ฃ − 10) = 300๐ฃ − 2000 (c) (5%) Substitute you straight line equation for ๐ฃ 3 in the original differential equation to obtain a linear differential equation. ๐ฃฬ + 2.4๐ฃฬ + 3(300๐ฃ − 2000) = 3000 ๐ฃฬ + 2.4๐ฃฬ + 900๐ฃ = 9000 (d) (5%) The equilibrium value of your linear differential equation should be the same as the equilibrium value for the original differential equation. Is this the case? 0 + 0 + 900๐ฃ = 9000 ๐ฃ(∞) = 10 ๐คโ๐๐โ ๐โ๐๐๐๐ (e) (5%) What are the eigenvalues of your linearized differential equation? Time constants? ๐๐๐๐๐๐ฃ๐๐๐ข๐๐ = −1.2 ± ๐29.98 1 ๐ก๐๐๐ ๐๐๐๐ ๐ก๐๐๐ก = = 0.833 1.2 330 Exam 4.a 1. A hydraulic car lift is shown below. At time t = 0, the valve is opened allowing pressurize fluid to flow into the cylinder pressurizing the fluid under the piston causing the piston and car to rise with velocity v. velocity v piston valve closed piston P Q valve open The equations for this system are given below ๐๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐๐๐ฬ + ๐. ๐๐ท = ๐๐๐๐ ๐(๐− ) = ๐ ๐/๐ ๐๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐ท = ๐๐๐, ๐๐๐๐ธ ๐ต/๐๐ ๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐๐๐๐ ๐ธ = ๐. ๐๐๐ ๐๐ /๐ (a) (b) (c) (d) (e) (f) What are the unknowns in the equations? We know that the velocity will eventually become constant. What is this constant? Convert the first equation to an algebraic equation using the Laplace transform. Solve for the Laplace transform of v, i.e. V(s) = ? Check your V(s) using the initial and final value theorems. How long will it take for the velocity to become constant (within 1%)? 2. The mass shown below is sitting on a nonlinear spring with the spring force Fs = 10z3 N. (a) If the mass vibrates with a small amplitude about equilibrium (z=4), obtain a linear approximation for the differential equation for z by obtaining a straight line approximation for z3. ๐๐ฬ + ๐๐๐๐ = ๐๐๐ 331 M z (b) What is the frequency of vibration? 3. A sliding block system is shown below. A spring connects a swinging bar to the block. A force f is the input to the system. The differential equations that model the motion of this system resulting from a certain input f are also given below. (a) What is the transfer function for y, i.e. ๐(๐) = [? ]๐ญ(๐) ๐๐๐๐๐ ๐ญ(๐) = ๐ณ๐๐๐๐๐๐(๐) Exam 4.a Solution 1. A hydraulic car lift is shown below. At time t = 0, the valve is opened allowing pressurize fluid to flow into the cylinder pressurizing the fluid under the piston causing the piston and car to rise with velocity v. velocity v piston valve closed piston P Q valve open 332 The equations for this system are given below ๐๐๐๐๐ ๐๐๐๐๐๐๐ ๐๐๐๐๐ฬ + ๐. ๐๐ท = ๐๐๐๐ ๐(๐− ) = ๐ ๐/๐ ๐๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐ท = ๐๐๐, ๐๐๐๐ธ ๐ต/๐๐ ๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐๐๐๐ ๐ธ = ๐. ๐๐๐ ๐๐ /๐ (a)(6%)What are the unknowns in the equations? v, P, and Q (b)(10%)We know that the velocity will eventually become constant. What is this constant? 0 + 9.8(100,000)0.05๐ฃ = 9800 ๐คโ๐๐โ ๐๐๐ฃ๐๐ ๐ฃ = 0.2 ๐/๐ (c)(10%)Convert the first equation to an algebraic equation using the Laplace transform. ๐ฟ๐๐๐๐๐๐ ๐๐ ๐ฃฬ = ๐ ๐ 9800 ๐ฟ๐๐๐๐๐๐ ๐๐ 9800 = ๐ Thus, 1000๐ ๐ + 9.8๐ = 9800 ๐ (d)(15%)Solve for the Laplace transform of v, i.e. V(s) = ? 1000๐ ๐ + 9.8(100,000)0.05๐ = ๐(๐ ) = 9800 ๐ 9800 9.8 = ๐ (1000๐ + 9800(5)] ๐ (๐ + 49) (e)(10%)Check your V(s) using the initial and final value theorems. If doesn’t check, go back and determine what is wrong with part (c). FVT: IVT: ๐ฃ(๐ก)๐ก=∞ ๐น๐๐: ๐๐๐๐๐ก ๐ ๐(๐ )๐ =0 9.8 = ๐ ๐(๐ )๐ =0 = 49 = 0.2 ๐ผ๐๐: ๐๐๐๐๐ก ๐ ๐(๐ )๐ =∞ ๐คโ๐๐โ ๐๐ ๐๐๐๐๐๐๐ก 9.8 ๐ฃ(๐ก)๐ก=∞ = ๐ ๐(๐ )๐ =0 = ∞+49 = 0 ๐คโ๐๐โ ๐๐ ๐๐๐๐๐๐๐ก (f)(3%)How long will it take for the velocity to become constant (within 1%)? 5/49 ≈ 0.1 ๐ ๐๐ 2. The mass shown below is sitting on a nonlinear spring with the spring force Fs = 10z3 N. (a) (20%)If the mass vibrates with a small amplitude about equilibrium (z=4), obtain a linear approximation for the differential equation for z by obtaining a straight line approximation for z3. 5๐งฬ + 10๐ง 3 = 640 333 z3 M z 64 0 4 z z is always in the neighborhood of the equilibrium value of z=4. Thus ๐ง 3 ≈ 43 + 3(4)2 (๐ง − 4) = 48๐ง − 128 5๐งฬ + 10(48๐ง − 128) = 640 Or, 5๐งฬ + 480๐ง = 1920 Checking: 0 + 480๐ง = 1920 ๐คโ๐๐๐ ๐๐๐ฃ๐๐ ๐ง = 4 ๐คโ๐๐โ ๐โ๐๐๐๐ (b) (5%)What is the frequency of vibration? General form: ๐ 2 + ๐๐2 = ๐ถ ๐๐2 = 480 5 = 96 ๐กโ๐ข๐ ๐๐ = √96 ≈ 9.8 ๐๐๐/๐ ๐๐ 3. A sliding block system is shown below. A spring connects a swinging bar to the block. A force f is the input to the system. The differential equations that model the motion of this system resulting from a certain input f are also given below. (c) (21%) What is the transfer function for y, i.e. ๐(๐ ) = [? ]๐น(๐ ) ๐คโ๐๐๐ ๐น(๐ ) = ๐ฟ๐๐๐๐๐๐(๐) Note, since we only want the transfer function, we don’t need to consider any initial conditions when doing the Laplace transform. ๐ 2 ๐ + 100๐ − 50๐ = 10๐น ๐ 2 ๐ + 64๐ − 75๐ = 0 From the first equation, (๐ 2 + 100)๐ − 10๐น = 50๐ Into the 2nd equation gives ๐ ๐ (๐ 2 + 100)๐/50 − 10๐น/50 = ๐ 334 (๐ 2 + 64)[(๐ 2 + 100)๐/50 − 10๐น/50] − 75๐ = 0 Or (0.02๐ 4 + 3.28๐ 2 + 53)๐ = 0.2๐น Or ๐(๐ ) = [ ๐ 4 10 ] ๐น(๐ ) + 164๐ 2 + 2650 Exam 4.b 1. ๐(๐) = [ ๐๐+๐ ] ๐ผ(๐) (๐+๐)๐ +๐๐ (a) (4%) What are the eigenvalues? (b) (4%) What is the undamped natural frequency? (c) (4%) What is the damping ratio? (d) (4%) What is the time constant? (e) (4%) If u(t) = 10, what is the final value of y? (f) (3%) How long will it take for y to reach this final value within 1%? 2. (25%) Fill in the blanks below. ๐๐๐ + ๐๐๐ + ๐๐๐ ๐พ(๐) = ๐(๐๐ + ๐๐๐ + ๐๐) ๐(๐) = ๐๐๐๐ + ๐๐๐ ๐ ๐ฌ๐ข๐ง (๐๐ + ∅) ๐ =? _______________ ๐ =? ______________ ๐ = ? _________________ ๐ =? _________________ 3. The input flow to a water tank system is ๐๐ . The equations that model the water heights H1 and H2 and the flow Q between the tanks are as follows: ๐ธ๐ − ๐ธ − ๐๐ฏฬ๐ = ๐ ๐ฏ๐ (๐− ) = ๐๐ ๐ธ − ๐๐ฏฬ๐ = ๐ ๐ฏ๐ (๐− ) = ๐ ๐ฏ๐ − ๐ฏ๐ = ๐๐๐๐ธฬ + ๐๐๐ธ ๐ธ(๐− ) = ๐ 335 Qi H1 (t ) H 2 (t ) Q (a) (3%) What are the unknowns? (b) (6%) Define state variables for this system of equations. (c) (3%) What are the initial conditions for your state variables? (d) (10%) Write the derivative equations for your state variables. (e) (10%) Express your state variable equations in matrix format assuming Q is the output of interest. 4. (20%) Find ๐๐๐๐๐ก ๐ฃ(๐ก)๐ก→∞ ๐ฬ + ๐๐ฬ + ๐๐๐ = ๐๐๐(๐) ๐(๐) = ๐๐๐ฌ๐ข๐ง (๐๐) Exam 4.b Solution ๐๐+๐ 1. ๐(๐) = [(๐+๐)๐ +๐๐ ] ๐ผ(๐) (a) (4%) What are the eigenvalues? −4 ± ๐5 (b) (4%) What is the undamped natural frequency? √41 = 6.4 (c) (4%) What is the damping ratio? 0.625 (d) (4%) What is the time constant? 0.25 (e) (4%) If u(t) = 10, what is the final value of y? 1.46 (f) (3%) How long will it take for y to reach this final value within 1%? 1.25 sec 336 2. (25%) Fill in the blanks below. ๐พ(๐) = ๐๐๐ + ๐๐๐ + ๐๐๐ ๐(๐๐ + ๐๐๐ + ๐๐) ๐(๐) = ๐๐๐๐ + ๐๐๐ ๐ ๐ฌ๐ข๐ง (๐๐ + ∅) ๐=๐ ๐=๐ ๐ = −๐ ๐=๐ 3. The input flow to a water tank system is ๐๐ . The equations that model the water heights H1 and H2 and the flow Q between the tanks are as follows: ๐ธ๐ − ๐ธ − ๐๐ฏฬ๐ = ๐ ๐ฏ๐ (๐− ) = ๐๐ ๐ธ − ๐๐ฏฬ๐ = ๐ ๐ฏ๐ (๐− ) = ๐ ๐ฏ๐ − ๐ฏ๐ = ๐๐๐๐ธฬ + ๐๐๐ธ ๐ธ(๐− ) = ๐ Qi H1 (t ) H 2 (t ) Q (a) (3%) What are the unknowns? ๐ป1 , ๐ป2 , ๐๐๐ ๐ (b) (6%) Define state variables for this system of equations. ๐ฅ1 = ๐ป1 ๐ฅ2 = ๐ป2 ๐ฅ3 = ๐ (c) (3%) What are the initial conditions for your state variables? ๐ฅ1 (0− ) = 10 , ๐ฅ2 (0− ) = 2 , ๐ฅ3 (0− ) = 0 (d) (10%) Write the derivative equations for your state variables in terms of the input ๐๐ . ๐ฅฬ 1 = 0.25๐๐ − 0.25๐ฅ3 ๐ฅ3 ๐ฅฬ 2 = 6 ๐ฅฬ 3 = 0.01๐ฅ1 − 0.01๐ฅ2 − 0.1๐ฅ3 (e) (10%) Express your state variable equations in matrix format assuming Q is the output of interest. 0 0 −0.25 0.25 ๐ด=[ 0 0 0.166 ] ๐ต = [ 0 ] ๐ถ = [0 0 1] ๐ท = [0] 0.01 −0.01 −0.1 0 337 4. (20%) Find ๐๐๐๐๐ก ๐ฃ(๐ก)๐ก→∞ ๐ฃฬ + 5๐ฃฬ + 13๐ฃ = 26๐(๐ก) ๐(๐ก) = 20sin (5๐ก) 26 ๐ ๐๐(5๐ก + ∅) | + 5๐ + 13 ๐ =๐5 26 = 20 ๐ ๐๐(5๐ก + ๐๐๐๐๐(26 + ๐0) − ๐๐๐๐๐[−12 + ๐25]) |−12 + ๐25| = 18.75๐ ๐๐(5๐ก + 0 − ๐ + ๐ก๐๐−1 2.1) = 18.75๐ ๐๐(5๐ก − 2) ๐๐๐๐๐ก ๐ฃ(๐ก)๐ก→∞ = 20 | ๐ 2 Exam 4.c 1. A. Use the Laplace transform to solve the following differential equations for w(t). B. In each case, check W(s) using the initial and final value theorems. C. Also, for (a) using your final equation for w(t), check using w(t) at t = 0 and at t = ∞. D. Also, in each case determine the time constant(s). (a) (15 pts) ๐๐ฬ + ๐๐๐ = ๐ ๐(๐− ) = ๐ (b) (15 pts) ๐๐ฬ + ๐๐๐ฬ + ๐๐๐ = ๐๐๐ฬ + ๐๐๐ ๐(๐− ) = ๐ ๐ฬ(๐− ) = ๐ u(t) 2 0 t ๐(๐) = ๐๐−๐๐ + ๐๐−๐ ๐ ๐ฌ๐ข๐ง (๐๐ + ∅) a=? b=? d=? f=? 2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity 156.2 m/s. The differential eqn for the vertical displacement is ๐ฆฬ + 0.005๐๐ฆฬ ≈ −10 ๐ฆ(0− ) = 2 ๐ ๐ฆฬ (0− ) = 100 ๐/๐ and the equation for the horizontal displacement is ๐คฬ + 0.005๐๐คฬ = 0 ๐ค(0− ) = 0 ๐ ๐คฬ (0− ) = 120 ๐/๐ where ๐ = √๐ฆฬ 2 + ๐คฬ 2 338 y w (a) (15 pts) Express these equations in state variable format for an ode45 simulation. (b) (10 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations. [t,x]=ode45(@Exam3Eqns,[0 10],[ y= ; w= ; ]); plot(w,y) xlabel( ‘ ‘) ylabel( ‘ ‘) function dx=Exam3Eqns(t,x) dx=zeros( , 1); dx(1)= End (c) (5 pts) Draw a sketch of what you think the plot will look like. 3. (5 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b) above for T=0.02 and u(t) piecewise constant is shown below. What is the discrete time solution to this this differential equation, i.e. wk = ? 0.1177๐ง − 0.1083 ๐(๐ง) = [ 2 ] ๐(๐ง) ๐ง − 1.878๐ง + 0.8869 339 4. (15 pts) For the differential equation in 1(b) above, what are the MATLAB commands for generating a plot of w(t) using the ‘impulse’ command? ๐{๐(๐ก)) = ๐น(๐ง) ๐{๐(๐ก + ๐)} = ๐ง๐น(๐ง) ๐{(๐(๐ก + 2๐)} = ๐ง 2 ๐น(๐ง) ๐{๐(๐ก − ๐)} = ๐ง −1 ๐น(๐ง) ๐(๐(๐ก − 2๐)} = ๐ง −2 ๐น(๐ง) 5. (20 pts) Express the following differential equation in state variable format assuming ๐คฬ is the output of interest. What are the initial conditions for the state variables? ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข A=? B=? C=? D = ? state variable initial conditions = ? ๐ค(0− ) = 0 2๐คฬ + 12๐คฬ + 50๐ค = 12๐ขฬ + 50๐ข ๐คฬ (0− ) = 0 ๐ข(0− ) = 0 Exam 4.c Solution 1. A. Use the Laplace transform to solve the following differential equations for w(t). E. In each case, check W(s) using the initial and final value theorems. F. Also, for (a) using your final equation for w(t), check using w(t) at t = 0 and at t = ∞. G. Also, in each case determine the time constant(s). (a) (15 pts) 4๐คฬ + 40๐ค = 0 ๐พ(๐) = ๐ค(0− ) = 5 ๐ ๐ + ๐๐ ๐(๐) = ๐๐−๐๐๐ ๐ญ๐ฝ๐ป ๐๐๐๐๐ ๐ ๐(∞) = ๐ ๐ฐ๐ฝ๐ป ๐๐๐๐๐ ๐ ๐(๐) = ๐ ๐๐๐๐ ๐๐๐๐๐๐๐๐ = ๐. ๐ ๐๐๐. 340 (b) (15 pts) ๐๐ฬ + ๐๐๐ฬ + ๐๐๐ = ๐๐๐ฬ + ๐๐๐ ๐(๐− ) = ๐ ๐ฬ(๐− ) = ๐ u(t) 2 0 ๐(๐ ) = [ ๐ 2 t 6๐ + 25 2 12๐ + 50 ] = + 6๐ + 25 ๐ ๐ [(๐ + 3)2 + 42 ] ๐น๐๐ ๐๐๐ฃ๐๐ 2 ๐ผ๐๐ ๐๐๐ฃ๐๐ 0 ๐(๐) = ๐๐−๐๐ + ๐๐−๐ ๐ ๐ฌ๐ข๐ง (๐๐ + ∅) a= 2 b=0 d=3 f=4 Time constant = 0.333 sec. 2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity 156.2 m/s. The differential eqn for the vertical displacement is ๐ฆฬ + 0.005๐๐ฆฬ ≈ −10 ๐ฆ(0− ) = 2 ๐ ๐ฆฬ (0− ) = 100 ๐/๐ and the equation for the horizontal displacement is ๐คฬ + 0.005๐๐คฬ = 0 ๐ค(0− ) = 0 ๐ ๐คฬ (0− ) = 120 ๐/๐ 2 2 where ๐ = √๐ฆฬ + ๐คฬ y w (a) (15 pts) Express these equations in state variable format for an ode45 simulation. ๐ฅ1 = ๐ฆ ๐ฅ2 = ๐ฆฬ ๐ฅ3 = ๐ค ๐ฅ4 = ๐คฬ ๐ = √๐ฅ22 + ๐ฅ42 ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −10 − .005๐๐ฅ2 ๐ฅฬ 3 = ๐ฅ4 ๐ฅฬ 4 = −0.005๐๐ฅ4 (b) (10 pts) Complete the MATLAB code below for ode45 m-files to simulate these equations. [t,x]=ode45(@Exam3Eqns,[0 10],[ 0 100 0 120 ]); y= X(:,1) ; w= X(:,3) ; plot(w,y) xlabel( ‘ horizontal distance, m ‘ ) ylabel( ‘ vertical distance, m ‘ ) 341 function dx=Exam3Eqns(t,x) dx = zeros( 4 , 1); dx(1) = x(2); V = sqrt(x(2)^2 +x(4)^2); dx(2) = - 10 - 0.005*V*x(2); dx(3) = x(4); dx(4 )= - 0.0005*V*x(4); end (c) (5 pts) Draw a sketch of what you think the plot will look like. y 2 0 w 3. (5 pts) The Z transform transfer function relating W(z) to the input U(z) for problem 1(b) above for T=0.02 and u(t) piecewise constant is shown below. What is the discrete time solution to this this differential equation, i.e. wk = ? 0.1177๐ง − 0.1083 ๐(๐ง) = [ 2 ] ๐(๐ง) ๐ง − 1.878๐ง + 0.8869 ๐ค๐+2 − 1.878๐ค๐−1 + 0.8869๐ค๐ = 0.1177๐ข๐+1 − 0.1083๐ข๐ ๐ค๐ = 1.878๐ค๐−1 − 0.8869๐ค๐−2 + 0.1177๐ข๐−1 − 0.1083๐ข๐−2 4. (15 pts) For the differential equation in 1(b) above, what are the MATLAB commands for generating a plot of w(t) using the ‘impulse’ command? 12s + 50 2 24s + 100 W(s) = [ 2 ] = 3 2s + 12s + 50 s 2s + 12s 2 + 50s + 0 12๐ + 50 = 3 ๐ + 6๐ 2 + 25๐ + 0 >> wd = tf([24 100],[2 12 50 0]); or wd = tf([12 50],[1 6 25 0]); >> impulse(wd) 5. (20 pts) Express the following differential equation in state variable format assuming ๐คฬ is the output of interest. What are the initial conditions for the state variables? ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข A = ? B = ? C = ? D = ? st. var. initial conditions: ๐ฅ1 (0− ) = ๐ฅ2 (0− ) = 0 2๐คฬ + 12๐คฬ + 50๐ค = 12๐ขฬ + 50๐ข ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐ข(0− ) = 0 342 ๐คฬ + 6๐คฬ + 25๐ค = 6๐ขฬ + 25๐ข ๐คฬ − 6๐ข = −6๐คฬ − 25๐ค + 25๐ข ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ − 6๐ข ๐ฅฬ 1 = ๐ฅ2 + 6๐ข ๐ฅฬ 2 = −25๐ฅ1 − 6(๐ฅ2 + 6๐ข) + 25๐ข 0 ๐ด=[ −25 1 ] −6 ๐ต=[ 6 ] ๐ถ = [0 1] −11 ๐ท = [6] Exam 5.a 1. The differential equation for y in terms of the input u is as follows: ๐ฆ(0− ) = 0.5 ๐ฆฬ (0− ) = 1 4๐ฆฬ + 24๐ฆฬ + 100๐ฆ = 32๐ข + 8๐ขฬ u(t) 2 0 t (a) (b) (c) (d) (e) (10%) What is the transfer function for y? (10%) What are the eigenvalues? (10%) What is the undamped natural frequency? What is the damping ratio? (5%) What is U(s), the Laplace transform of u(t)? (10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the final value theorem and the initial value theorem. (f) (5%) Draw a sketch of your estimate of y(t). y(t) 0 t 2. The modelling equations for the mass spring damper system are shown below in terms of the force input F. 343 (a) (6%) List the unknowns in these equations. (b) (10%) Laplace transform these equations assuming all initial conditions are zero. (c) (14%) Solve for the transfer function for x. ๐ +2 3. Consider the following function of s: ๐ = ๐ +4 (a) (10%) For s = -2+j4, what is |๐| ? (b) (10%) For s=-2+j4, what is the angle(a)? Exam 5.a Solution 1. The differential equation for y in terms of the input u is as follows: ๐ฆ(0− ) = 0.5 ๐ฆฬ (0− ) = 1 4๐ฆฬ + 24๐ฆฬ + 100๐ฆ = 32๐ข + 8๐ขฬ u(t) 2 0 t (a) (10%) What is the transfer function for y? 2๐ +8 ๐ 2 +6๐ +25 (b) (10%) What are the eigenvalues? ๐ 2 + 6๐ + 25 = (๐ + 3 + ๐4)(๐ + 3 − ๐4) Eigenvalues = −3 ± ๐4 (c) (10%) What is the undamped natural frequency? What is the damping ratio? ๐๐ = √25 = 5 ๐๐๐/ sec 2๐ฟ๐๐ = 6 ๐โ๐ข๐ , ๐๐๐๐๐๐๐ ๐๐๐ก๐๐ = 0.6 (d) (5%) What is U(s), the Laplace transform of u(t)? U(s) = 2/s (e) (10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the final value theorem and the initial value theorem. (๐ 2 ๐ − 0.5๐ − 1) + 6(๐ ๐ − 0.5) + 25๐ = (2๐ + 8)๐ 2 (๐ 2 + 6๐ + 25)๐(๐ ) = (2๐ + 8) + 0.5๐ + 4 ๐ 0.5๐ 2 + 8๐ + 16 ๐ฆ(๐ ) = ๐ (๐ 2 + 6๐ + 25) 344 16 = 0.64 25 0.5 = = 0.5 1 ๐น๐๐: ๐ ๐(๐ )๐ =0 = ๐ผ๐๐: ๐ ๐(๐ )๐ =∞ (f) (5%) Draw a sketch of your estimate of y(t). y(t) 0.64 0.5 0 t 1.66 4. The modelling equations for the mass spring damper system are shown below in terms of the force input F. (a) (6%) List the unknowns in these equations. ๐น๐ , ๐ฅ, ๐น๐ (b) (10%) Laplace transform these equations assuming all initial conditions are zero. 20 + 100๐ ๐ ๐น๐ = 5๐ ๐ 20 2๐ 2 ๐ + ๐น๐ + ๐น๐ − ๐น − =0 ๐ (c) (14%) Solve for the transfer function for x. ๐น๐ = 1 ] ๐น(๐ ) + 5๐ + 100 1 ๐๐๐๐๐ ๐๐๐ ๐๐ข๐๐๐ก๐๐๐ = [ 2 ] 2๐ + 5๐ + 100 ๐(๐ ) = [ 2๐ 2 345 5. Consider the following function of s: ๐ = ๐ +2 ๐ +4 −2+๐4+2 (1) (10%) For s = -2+j4, what is |๐| ? |−2+๐4+4| = √๐4 √2+๐4 = 4 √20 = 0.894 (2) (10%) For s=-2+j4, what is the angle(a)? ๐๐๐๐๐ ( −2+๐4+2 −2+๐4+4 ๐ ) = ๐๐๐๐๐(๐4) − ๐๐๐๐๐(2 + ๐4) = − 1.107 = 0.464 ๐๐๐ 2 Exam 5.b 1. (25%) The differential equation for a system is 2๐ฆฬ + 2.02๐ฆฬ + 18๐ฆ = 2.02๐ขฬ + 18๐ข If the input is ๐ข(๐ก) = 2sin (2.91๐ก), we know that y(t) will eventually become a sine function. i.e. ๐ฆ(๐ก) = ๐ด๐ ๐๐(๐๐ก + ∅) The MATLAB code below was used to generate the bode plot also shown. What are A, ๐, and ∅? >> g=tf([2.02 18],[2 2.02 18]); >> bode(g,{1,5}) Bode Diagram 15 Magnitude (dB) 10 System: g Frequency (rad/s): 2.91 Magnitude (dB): 10 5 0 Phase (deg) -5 0 -45 System: g Frequency (rad/s): 2.91 Phase (deg): -62.1 -90 -135 10 0 Frequency (rad/s) 2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also, assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-) = 2 and ๐ฆฬ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation. Complete the two M-files below to get a plot of y(t). M-file #1 [t,x]=ode45(@exam2,[? ?],[? ?]); 346 y = ?; plot(t,y) xlabel(‘time, sec.’) ylabel((‘y(t)’) M-file #2 function dx = exam2(t,x) dx=zeros(?,1); ? ? ? end 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 250๐ฬ + 25๐ H1 ๐(0− ) = 0 H2 Q (a) (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? (b) (10%) Laplace transform each of these equations. (c) (15%) Simplify these equations to a single equation for H2(s). Check your answer using the initial value theorem. (d) (5%) Use the final value theorem to solve for the final value of H2(t). Does this value make sense? (e) (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value. (f) (10%) Suppose instead of Laplace transforming the original three equations, express them in state variable format. Define the state variables and write their derivative equations. What are the initial conditions of the state variables? M in dB is 20Log10M ๐ฟ{๐ฬ (๐ก)} = ๐ ๐น(๐ ) − ๐(0− ) 347 Exam 5.b Solution (25%) The differential equation for a system is 2๐ฆฬ + 2.02๐ฆฬ + 18๐ฆ = 2.02๐ขฬ + 18๐ข If the input is ๐ข(๐ก) = 2sin (2.91๐ก), we know that y(t) will eventually become a sine function. i.e. ๐ฆ(๐ก) = ๐ด๐ ๐๐(๐๐ก + ∅) The MATLAB code below was used to generate the bode plot also shown. What are A, ๐, and ∅? >> g=tf([2.02 18],[2 2.02 18]); >> bode(g,{1,5}) 1. A= 2*10(10/20) = 2√10 = 6.325 ๐ = 2.91 ๐๐๐๐ ∅ = −62.1 deg (−1.0838 ๐๐๐) Bode Diagram 15 Magnitude (dB) 10 System: g Frequency (rad/s): 2.91 Magnitude (dB): 10 5 0 Phase (deg) -5 0 -45 System: g Frequency (rad/s): 2.91 Phase (deg): -62.1 -90 -135 10 0 Frequency (rad/s) 2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also, assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-) = 2 and ๐ฆฬ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation. Complete the two M-files below to get a plot of y(t). ๐ฅ1 = ๐ฆ ๐ฅ2 = ๐ฆฬ − 1.01๐ข ๐ฅฬ 1 = ๐ฅ2 + 1.01๐ข ๐ฅฬ 2 = −9๐ฅ1 − 1.01๐ฅ2 + 7.98๐ข Time constant = 2 sec M-file #1 [t,x]=ode45(@exam2,[0 10],[2 0.3]); y = x(:,1); plot(t,y) xlabel(‘time, sec.’) ylabel((‘y(t)’) M-file #2 function dx = exam2(t,x) dx=zeros(2,1); 348 u=0.2; dx(1)=x(2)+1.01*u; dx(2)=-9*x(1)-1.01*x(2)+7.98*u end 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 250๐ฬ + 25๐ ๐(0− ) = 0 5 H1 H2 4 H2 Q t 50,000 (a) (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? H1, H2, and Q 3 equations and 3 unknowns (b) (10%) Laplace transform each of these equations. -Q - 20(sH1 - 2)=0 Q - 40(sH2 - 5)=0 H1 - H2 = 250sQ + 25Q (c) (15%) Simplify these equations to a single equation for H2(s). Check your answer using the initial value theorem. ๐ป2 (๐ ) = 800∗1250๐ 2 +800∗125๐ +240 ๐ (800∗250๐ 2 +800∗25๐ +60) = 5๐ 2 +0.5๐ +0.0012 ๐ (๐ 2 +0.1๐ +0.0003) ๐ผ๐๐: ๐ ๐ป2 (๐ )๐ =∞ = 5 correct (d) (5%) Use the final value theorem to solve for the final value of H2(t). Does this make sense? ๐น๐๐: ๐ ๐ป2 (๐ )๐ =0 = 4 makes sense since between initial tank levels. (e) (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value. Largest time constant = 10,000 sec. So, time to steady state = 50,000 sec. See above. (f) (10%) Suppose instead of Laplace transforming the original three equations, express them in state variable format. Define the state variables and write their derivative equations. What are the initial conditions of the state variables? 349 ๐ฅ1 = ๐ป1 ๐ฅ1 (0) = 2 ๐ฅ2 = ๐ป2 ๐ฅ2 (0) = 5 ๐ฅ3 = ๐ ๐ฅ3 (0) = 0 ๐ฅ3 ๐ฅ3 ๐ฅฬ 1 = − ๐ฅฬ 2 = ๐ฅฬ 3 = 0.004๐ฅ1 − 0.004๐ฅ2 − 0.1๐ฅ3 20 40 Exam 5.c 1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to check your solution at t = 0 and at t = ∞. 2๐ฆฬ + 20๐ฆ = 40 ๐ฆ(0− ) = 1 2. Consider the differential equation for w(t) shown below with input u(t). ๐ค โ + 18๐คฬ + 105๐คฬ + 250๐ค = 75๐ขฬ + 500๐ข (a) (5%) What is the transfer function relating W(s) to U(s)? (b) (10%) Assume ๐ 3 + 18๐ 2 + 105๐ + 250 = (๐ + 10)[(๐ + 4)2 + 32 ] What are the eigenvalues? What are the time constants? Damping ratio? (c) (10%) Suppose u(t) is a step input with magnitude of 3. Also, assume ๐ค(0− ) = 0, ๐คฬ (0− ) = 0, ๐คฬ (0− ) = 2. Find an equation for W(s); check your answer using the initial value and final value theorems. (d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the following form: ๐ค(๐ก) = ๐ + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + โ) ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? (e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without first finding an equation for w(t). (f) (15%) Use the ‘simulation diagram’ approach to express the differential equation in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข Note, ๐คฬ is the output of interest. What are the initial conditions for your state variables if ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐คฬ (0− ) = 2 ๐ข(0− ) = 0 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 350 ๐ป1 − ๐ป2 = 25๐ H1 H2 Q a. (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? b. (10%) Laplace transform each of these equations. c. (10%) Simplify these equations to a single equation for Q(s). Check your answer using the initial and final value theorems. Exam 5.c Solution 1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to check your solution at t = 0 and at t = ∞. 2๐ฆฬ + 20๐ฆ = 40 ๐(๐ ) = 20 + ๐ ๐ (๐ + 10) ๐ฆ(0− ) = 1 ๐ฆ(๐ก) = 2 − ๐ −10๐ก ๐ฆ(0) = 1 ๐ฆ(∞) = 2 1. Consider the differential equation for w(t) shown below with input u(t). ๐ค โ + 18๐คฬ + 105๐คฬ + 250๐ค = 75๐ขฬ + 500๐ข (a) (5%) What is the transfer function relating W(s) to U(s)? 75๐ + 500 ๐ 3 + 18๐ 2 + 105๐ + 250 3 ๐ + 18๐ 2 + 105๐ + 250 = (๐ + 10)[(๐ + 4)2 + 32 ] ๐บ(๐ ) = (b) (10%) Assume What are the eigenvalues? What are the time constants? Damping ratio? Eigenvalues = -10 and -4 ±๐3 Time constants = 0.1 and 0.25 Damping ratio = 0.8 (c) (10%) Suppose u(t) is a step input with magnitude of 3. Also, assume ๐ค(0− ) = 0, ๐คฬ (0− ) = 0, ๐คฬ (0− ) = 2. 351 Find an equation for W(s); check your answer using the initial value and final value theorems. 227๐ + 1500 ๐ ๐(๐ )๐ =0 = 6 ๐ ๐(๐ )๐ =∞ = 0 ๐ (๐ 3 + 18๐ 2 + 105๐ + 250) (d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the following form: ๐(๐ ) = ๐ค(๐ก) = ๐ + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + โ) ๐=6 ๐= −10(227) + 1500 −770 = = 1.7111 −10((−10 + 4)2 + 32 ) −450 ๐ = 10 ๐=4 ๐=3 (e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without first finding an equation for w(t). >> num = [227 1500]; >> den = [1 18 105 250 0]; >> G = tf(num,den); >> impulse(G) (f) (15%) Use the ‘simulation diagram’ approach to express the differential equation in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข Note, ๐คฬ is the output of interest. ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐คฬ − 75๐ข 0 1 0 0 ๐ด=[ 0 ๐ต = [ 75 ] ๐ถ = [0 0 1] 0 1 ] −250 −105 −18 −850 What are the initial conditions for your state variables if ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐คฬ (0− ) = 2 ๐ข(0− ) = 0 − − ๐ฅ1 (0 ) = 0 ๐ฅ2 (0 ) = 0 ๐ฅ3 (0− ) = 2 ๐ท = [75] 2. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 25๐ 352 H1 H2 Q (a) (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? H1, H2, Q (b) (10%) Laplace transform each of these equations. −๐ − 20(๐ ๐ป1 − 2) = 0 ๐ − 40(๐ ๐ป2 − 5) = 0 ๐ป1 − ๐ป2 = 25๐ (c) (10%) Simplify these equations to a single equation for Q(s). Check your answer using the initial value and final value theorems. The theorems confirm the equation for Q(s). −120 ๐(๐ ) = ๐(๐ก)๐ก=∞ = ๐ ๐(๐ )๐ =0 = 0 ๐(๐ก)๐ก=0 = ๐ ๐(๐ )๐ =∞ = −0.1 1000๐ + 3 Exam 6.a 1. The differential equation for y in terms of the input u is as follows: 4๐ฆฬ + 24๐ฆฬ + 100๐ฆ = 32๐ข + 8๐ขฬ u(t) 2 0 (a) (b) (c) (d) (e) ๐ฆ(0− ) = 0.5 ๐ฆฬ (0− ) = 1 t (10%) What is the transfer function for y? (10%) What are the eigenvalues? (10%) What is the undamped natural frequency? What is the damping ratio? (5%) What is U(s), the Laplace transform of u(t)? (10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the final value theorem and the initial value theorem. (f) (5%) Draw a sketch of your estimate of y(t). 353 y(t) 0 t 2. The modelling equations for the mass spring damper system are shown below in terms of the force input F. (a) (6%) List the unknowns in these equations. (b) (10%) Laplace transform these equations assuming all initial conditions are zero. (c) (14%) Solve for the transfer function for x. ๐ +2 (d) Consider the following function of s: ๐ = ๐ +4 (d.1) (10%) For s = -2+j4, what is |๐| ? (d.2) (10%) For s=-2+j4, what is the angle(a)? ๐ฟ(๐) = ๐น(๐ ) ๐ฟ(๐ฬ ) = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ(๐ฬ ) = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐(0− ) FVT: ๐(∞) = ๐ ๐น(๐ )๐ =0 IVT: ๐(0+ ) = ๐ ๐น(๐ )๐ =∞ Exam 6.a Solution (a) The differential equation for y in terms of the input u is as follows: 4๐ฆฬ + 24๐ฆฬ + 100๐ฆ = 32๐ข + 8๐ขฬ ๐ฆ(0− ) = 0.5 ๐ฆฬ (0− ) = 1 354 u(t) 2 0 t (b) (10%) What is the transfer function for y? 2๐ +8 ๐ 2 +6๐ +25 (c) (10%) What are the eigenvalues? ๐ 2 + 6๐ + 25 = (๐ + 3 + ๐4)(๐ + 3 − ๐4) Eigenvalues = −3 ± ๐4 (d) (10%) What is the undamped natural frequency? What is the damping ratio? ๐๐ = √25 = 5 ๐๐๐/ sec 2๐ฟ๐๐ = 6 ๐โ๐ข๐ , ๐๐๐๐๐๐๐ ๐๐๐ก๐๐ = 0.6 (e) (5%) What is U(s), the Laplace transform of u(t)? U(s) = 2/s (f) (10%) Find an equation for Y(s), the Laplace transform of y(t). Check your answer using the final value theorem and the initial value theorem. (๐ 2 ๐ − 0.5๐ − 1) + 6(๐ ๐ − 0.5) + 25๐ = (2๐ + 8)๐ 2 (๐ 2 + 6๐ + 25)๐(๐ ) = (2๐ + 8) + 0.5๐ + 4 ๐ 0.5๐ 2 + 8๐ + 16 ๐ฆ(๐ ) = ๐ (๐ 2 + 6๐ + 25) 16 ๐น๐๐: ๐ ๐(๐ )๐ =0 = = 0.64 25 0.5 ๐ผ๐๐: ๐ ๐(๐ )๐ =∞ = = 0.5 1 (g) (5%) Draw a sketch of your estimate of y(t). y(t) 0.64 0.5 0 1.66 t (h) The modelling equations for the mass spring damper system are shown below in terms of the force input F. 355 (i) (6%) List the unknowns in these equations. ๐น๐ , ๐ฅ, ๐น๐ (j) (10%) Laplace transform these equations assuming all initial conditions are zero. 20 + 100๐ ๐ ๐น๐ = 5๐ ๐ 20 2๐ 2 ๐ + ๐น๐ + ๐น๐ − ๐น − =0 ๐ ๐น๐ = (k) (14%) Solve for the transfer function for x. 1 ] ๐น(๐ ) + 5๐ + 100 1 ๐๐๐๐๐ ๐๐๐ ๐๐ข๐๐๐ก๐๐๐ = [ 2 ] 2๐ + 5๐ + 100 ๐(๐ ) = [ 2๐ 2 ๐ +2 (l) Consider the following function of s: ๐ = ๐ +4 −2+๐4+2 (1) (10%) For s = -2+j4, what is |๐| ? |−2+๐4+4| = √๐4 √2+๐4 = 4 √20 = 0.894 (2) (10%) For s=-2+j4, what is the angle(a)? ๐๐๐๐๐ ( −2+๐4+2 −2+๐4+4 ๐ ) = ๐๐๐๐๐(๐4) − ๐๐๐๐๐(2 + ๐4) = − 1.107 = 0.464 ๐๐๐ 2 Exam 6.b 1. (25%) The differential equation for a system is 2๐ฆฬ + 2.02๐ฆฬ + 18๐ฆ = 2.02๐ขฬ + 18๐ข If the input is ๐ข(๐ก) = 2sin (2.91๐ก), we know that y(t) will eventually become a sine function. i.e. ๐ฆ(๐ก) = ๐ด๐ ๐๐(๐๐ก + ∅) The MATLAB code below was used to generate the bode plot also shown. What are A, ๐, and ∅? >> g=tf([2.02 18],[2 2.02 18]); >> bode(g,{1,5}) 356 Bode Diagram 15 Magnitude (dB) 10 System: g Frequency (rad/s): 2.91 Magnitude (dB): 10 5 0 Phase (deg) -5 0 -45 System: g Frequency (rad/s): 2.91 Phase (deg): -62.1 -90 -135 10 0 Frequency (rad/s) 2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also, assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-) = 2 and ๐ฆฬ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation. Complete the two M-files below to get a plot of y(t). M-file #1 [t,x]=ode45(@exam2,[? ?],[? ?]); y = ?; plot(t,y) xlabel(‘time, sec.’) ylabel((‘y(t)’) M-file #2 function dx = exam2(t,x) dx=zeros(?,1); ? 357 ? ? end 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 250๐ฬ + 25๐ H1 ๐(0− ) = 0 H2 Q 3.1 (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? 3.2 (10%) Laplace transform each of these equations. 3.3 (15%) Simplify these equations to a single equation for H2(s). Check your answer using the initial value theorem. 3.4 (5%) Use the final value theorem to solve for the final value of H2(t). Does this value make sense? 3.5 (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value. 3.6 (10%) Suppose instead of Laplace transforming the original three equations, express them in state variable format. Define the state variables and write their derivative equations. What are the initial conditions of the state variables? M in dB is 20Log10M ๐ฟ{๐ฬ (๐ก)} = ๐ ๐น(๐ ) − ๐(0− ) Exam 6.b Solution 1. (25%) The differential equation for a system is 2๐ฆฬ + 2.02๐ฆฬ + 18๐ฆ = 2.02๐ขฬ + 18๐ข If the input is ๐ข(๐ก) = 2sin (2.91๐ก), we know that y(t) will eventually become a sine function. i.e. ๐ฆ(๐ก) = ๐ด๐ ๐๐(๐๐ก + ∅) The MATLAB code below was used to generate the bode plot also shown. What are A, ๐, and ∅? >> g=tf([2.02 18],[2 2.02 18]); >> bode(g,{1,5}) 358 Bode Diagram 15 Magnitude (dB) 10 System: g Frequency (rad/s): 2.91 Magnitude (dB): 10 5 0 Phase (deg) -5 0 -45 System: g Frequency (rad/s): 2.91 Phase (deg): -62.1 -90 -135 10 0 Frequency (rad/s) A= 2*10(10/20) = 2√10 = 6.325 ๐ = 2.91 ๐๐๐๐ ∅ = −62.1 deg (−1.0838 ๐๐๐) 2. (25%) Suppose you are going to solve the differential equation in part 1 using ode45. Also, assume that the input in this case is a step with magnitude 0.2 and the initial conditions are y(0-) = 2 and ๐ฆฬ (0− ) = 0.3. We know that two M-files are needed to perform an ode45 simulation. Complete the two M-files below to get a plot of y(t). ๐ฅ1 = ๐ฆ ๐ฅ2 = ๐ฆฬ − 1.01๐ข ๐ฅฬ 1 = ๐ฅ2 + 1.01๐ข ๐ฅฬ 2 = −9๐ฅ1 − 1.01๐ฅ2 + 7.98๐ข Time constant = 2 sec M-file #1 [t,x]=ode45(@exam2,[0 10],[2 0.3]); y = x(:,1); plot(t,y) xlabel(‘time, sec.’) ylabel((‘y(t)’) M-file #2 function dx = exam2(t,x) dx=zeros(2,1); u=0.2; dx(1)=x(2)+1.01*u; dx(2)=-9*x(1)-1.01*x(2)+7.98*u end 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: 359 −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 250๐ฬ + 25๐ ๐(0− ) = 0 5 H1 H2 4 H2 Q t 50,000 3.1 (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? H1, H2, and Q 3 equations and 3 unknowns 3.2 (10%) Laplace transform each of these equations. -Q - 20(sH1 - 2)=0 Q - 40(sH2 - 5)=0 H1 - H2 = 250sQ + 25Q 3.3 (15%) Simplify these equations to a single equation for H2(s). Check your answer using the initial value theorem. ๐ป2 (๐ ) = 800∗1250๐ 2 +800∗125๐ +240 ๐ (800∗250๐ 2 +800∗25๐ +60) 5๐ 2 +0.5๐ +0.0012 = ๐ (๐ 2 +0.1๐ +0.0003) ๐ผ๐๐: ๐ ๐ป2 (๐ )๐ =∞ = 5 correct 3.4 (5%) Use the final value theorem to solve for the final value of H2(t). Does this make sense? ๐น๐๐: ๐ ๐ป2 (๐ )๐ =0 = 4 makes sense since between initial tank levels. 3.5 (5%) Draw an estimate plot of H2(t). Showing initial and final values and time to final value. Largest time constant = 10,000 sec. So, time to steady state = 50,000 sec. See above. 3.6 (10%) Suppose instead of Laplace transforming the original three equations, express them in state variable format. Define the state variables and write their derivative equations. What are the initial conditions of the state variables? ๐ฅ1 = ๐ป1 ๐ฅ1 (0) = 2 ๐ฅ2 = ๐ป2 ๐ฅ2 (0) = 5 ๐ฅ3 = ๐ ๐ฅ3 (0) = 0 ๐ฅ3 ๐ฅ3 ๐ฅฬ 1 = − ๐ฅฬ 2 = ๐ฅฬ 3 = 0.004๐ฅ1 − 0.004๐ฅ2 − 0.1๐ฅ3 20 40 Exam 6.c 1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to check your solution at t = 0 and at t = ∞. 2๐ฆฬ + 20๐ฆ = 40 ๐ฆ(0− ) = 1 2. Consider the differential equation for w(t) shown below with input u(t). ๐ค โ + 18๐คฬ + 105๐คฬ + 250๐ค = 75๐ขฬ + 500๐ข 360 (a) (5%) What is the transfer function relating W(s) to U(s)? (b) (10%) Assume ๐ 3 + 18๐ 2 + 105๐ + 250 = (๐ + 10)[(๐ + 4)2 + 32 ] What are the eigenvalues? What are the time constants? Damping ratio? ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ } = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) ๐ฟ{๐โ} = ๐ 3 ๐น(๐ ) − ๐ 2 ๐(0− ) − ๐ ๐ฬ(0− ) − ๐ฬ(0− ) (c) (10%) Suppose u(t) is a step input with magnitude of 3. Also, assume ๐ค(0− ) = 0, ๐คฬ (0− ) = 0, ๐คฬ (0− ) = 2. Find an equation for W(s); check your answer using the initial value and final value theorems. (d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the following form: ๐ค(๐ก) = ๐ + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + โ) ๐ =? ๐ =? ๐ =? ๐ =? ๐ =? (e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without first finding an equation for w(t). (f) (15%) Use the ‘simulation diagram’ approach to express the differential equation in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข Note, ๐คฬ is the output of interest. What are the initial conditions for your state variables if ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐คฬ (0− ) = 2 ๐ข(0− ) = 0 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 25๐ 361 H1 H2 Q 3.a (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? 3.b (10%) Laplace transform each of these equations. 3.c (10%) Simplify these equations to a single equation for Q(s). Check your answer using the initial and final value theorems. Exam 6.c Solution 1. (15%) Use Laplace transform to solve the following differential equation for y(t). Be sure to check your solution at t = 0 and at t = ∞. 2๐ฆฬ + 20๐ฆ = 40 ๐(๐ ) = 20 + ๐ ๐ (๐ + 10) ๐ฆ(0− ) = 1 ๐ฆ(๐ก) = 2 − ๐ −10๐ก ๐ฆ(0) = 1 ๐ฆ(∞) = 2 2. Consider the differential equation for w(t) shown below with input u(t). ๐ค โ + 18๐คฬ + 105๐คฬ + 250๐ค = 75๐ขฬ + 500๐ข a. (5%) What is the transfer function relating W(s) to U(s)? ๐บ(๐ ) = ๐ 3 75๐ + 500 + 18๐ 2 + 105๐ + 250 b. (10%) Assume ๐ 3 + 18๐ 2 + 105๐ + 250 = (๐ + 10)[(๐ + 4)2 + 32 ] What are the eigenvalues? What are the time constants? Damping ratio? Eigenvalues = -10 and -4 ±๐3 Time constants = 0.1 and 0.25 Damping ratio = 0.8 c. (10%) Suppose u(t) is a step input with magnitude of 3. Also, assume ๐ค(0− ) = 0, ๐คฬ (0− ) = 0, ๐คฬ (0− ) = 2. Find an equation for W(s); check your answer using the initial value and final value theorems. ๐(๐ ) = 227๐ + 1500 ๐ (๐ 3 + 18๐ 2 + 105๐ + 250) ๐ ๐(๐ )๐ =0 = 6 ๐ ๐(๐ )๐ =∞ = 0 d. (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the following form: ๐ค(๐ก) = ๐ + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + โ) 362 ๐=6 ๐= −10(227) + 1500 −770 = = 1.7111 2 2 −10((−10 + 4) + 3 ) −450 ๐ = 10 ๐=4 ๐=3 e. (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without first finding an equation for w(t). >> num = [227 1500]; >> den = [1 18 105 250 0]; >> G = tf(num,den); >> impulse(G) f. (15%) Use the ‘simulation diagram’ approach to express the differential equation in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข Note, ๐คฬ is the output of interest. ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐คฬ − 75๐ข 0 1 0 0 ๐ด=[ 0 ๐ต = [ 75 ] ๐ถ = [0 0 1] 0 1 ] −250 −105 −18 −850 What are the initial conditions for your state variables if ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐คฬ (0− ) = 2 ๐ข(0− ) = 0 ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 0 ๐ฅ3 (0− ) = 2 ๐ท = [75] 3. The equations for the water flowing through a long line between two tanks and the height of the water in the tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 ๐ป1 (0− ) = 2 ๐ป2 (0− ) = 5 ๐ป1 − ๐ป2 = 25๐ H1 H2 Q a. (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? H1, H2, Q b. (10%) Laplace transform each of these equations. −๐ − 20(๐ ๐ป1 − 2) = 0 ๐ − 40(๐ ๐ป2 − 5) = 0 ๐ป1 − ๐ป2 = 25๐ c. (10%) Simplify these equations to a single equation for Q(s). Check your answer using the initial value and final value theorems. The theorems confirm the equation for Q(s). 363 ๐(๐ ) = −120 1000๐ + 3 ๐(๐ก)๐ก=∞ = ๐ ๐(๐ )๐ =0 = 0 ๐(๐ก)๐ก=0 = ๐ ๐(๐ )๐ =∞ = −0.1 Exam 7.a 1. A spring-mass–damper system is shown below; the displacement of the mass is x. x spring damper mass input force Fi Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows: (1) Force balance on mass equation: (2) Spring force equation: (3) Damper force equation: 10๐ฅฬ + ๐น๐ + ๐น๐ − ๐น๐ = 0 ๐ฅ(0− ) = 0 ๐ฅฬ (0− ) = 0 ๐น๐ = 1000๐ฅ ๐น๐ = 100๐ฅฬ (a) (5%) List the unknowns in the equations. __________ Are there enough equations?____ (b) (5%) Assume the input Fi is an impulse 100๐ฟ(๐ก). Fi(s) = ? (c) (10%) Laplace transform each of the equations using Fi(s) from part b. (d) (10%) Solve the three equations for X(s). ๐ฟ{๐} = ๐น(๐ ) ๐ฟ{๐ฬ } = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ} = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ(0− ) 2. The equations for an inverted pendulum are shown below. The force Fi is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Fi on the cart. Assuming small angles, the differential equations for the pendulum and cart are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the force Fi is ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] 364 Ms ๏ฑ L z Mc Fi Assume if you Laplace transform these three equations with all initial conditions zero except ๐ฬ(0− ) = 0.01 and then solve for ๐(๐ ) you get ๐(๐ ) ≈ 0.01๐ + 0.08 (๐ + 7.8)[(๐ + 0.12)2 + (0.39)2 ] (a) (6%) What are the poles of ๐(๐ )? (b) (3%) What are the zeros of ๐(๐ )? (c) (8%) Pretend that the Laplace transform above is a transfer function with a unit impulse input. Write the MATLAB commands for getting a plot of ๐(๐ก). 3. Consider the following transfer function relating the output Y(s) to the input F(s) 10๐ 2 + 40๐ + 250 ๐(๐ ) = [ ] ๐น(๐ ) (๐ + 2)[2๐ 2 + 16๐ + 50] (a) (9%) What are the eigenvalues? (b) (6%) What are the time constants? (c) (3%) What is the damped natural frequency? (d) (3%) What is the undamped natural frequency? (e) (3%) What is the damping ratio? 4. (a) (5%) Assuming that x will become a constant as t→ ∞, find the final value of x(t) for the differential equation below. 2๐ฅฬ + 4๐ฅฬ + 2๐ฅ 3 = 16 ๐ฅ(0− ) = 3 ๐ฅฬ (0− ) = 0 (b) (10%) Obtain a linear approximation for the differential equation by approximating x3 with a straight line approximation. (c) (10%) Solve for X(s), the Laplace transform of x(t). (d) (4%) Check your equation for X(s) using the initial and final value theorems; if it doesn’t check, go back to part e and find your mistake! ๐ผ๐๐ ๐๐๐๐๐ก ๐ ๐น(๐ )๐ =∞ ๐น๐๐ ๐๐๐๐๐ก ๐ ๐น(๐ )๐ =0 365 Exam 7.a Solution 1. A spring-mass–damper system is shown below; the displacement of the mass is x. x spring damper mass input force Fi Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows: (1) Force balance on mass equation: 10๐ฅฬ + ๐น๐ + ๐น๐ − ๐น๐ = 0 ๐ฅ(0− ) = 0 ๐ฅฬ (0− ) = 0 (2) Spring force equation: ๐น๐ = 1000๐ฅ (3) Damper force equation: ๐น๐ = 100๐ฅฬ (a)(5%) List the unknowns in the equations. x, Fs, and Fd. Are there enough equations? yes (b) (5%) Assume the input Fi is an impulse 100๐ฟ(๐ก). Fi(s) = 100 (c) (10%) Laplace transform each of the equations using Fi(s) from part b. 10๐ 2 ๐ + ๐น๐ + ๐น๐ − 100 = 0 ๐น๐ = 1000๐ ๐น๐ = 100๐ ๐ (d) (10%) Solve the three equations for X(s). 100 ๐(๐ ) = 2 10๐ + 100๐ + 1000 2. The equations for an inverted pendulum are shown below. The force Fi is used to move the cart in order to keep the pendulum mass vertical. The pendulum angle ๐ is continuously measured and used to generate the force Fi on the cart. Assuming small angles, the differential equations for the pendulum and cart are ๐ฬ + 0.5๐งฬ − 4.9๐ = 0 ๐งฬ + 0.18๐ฬ + 0.09๐น๐ = 0 And the differential equation for the force Fi is ๐น๐ฬ + 8๐น๐ = −149.6[๐ฬ + 6๐] Ms ๏ฑ L z Mc Fi 366 Assume if you Laplace transform these three equations with all initial conditions zero except ๐ฬ(0− ) = 0.01 and then solve for ๐(๐ ) you get ๐(๐ ) ≈ 0.01๐ + 0.08 (๐ + 7.8)[(๐ + 0.12)2 + (0.39)2 ] (a) (6%) What are the poles of ๐(๐ )? -7.8, -0.12±๐0.39 (b) (3%) What are the zeros of ๐(๐ )? -8 (c) (8%) Pretend that the Laplace transform above is a transfer function with a unit impulse input. Write the MATLAB commands for getting a plot of ๐(๐ก). >> G=zpk([-8],[-7.8 -0.12+j*0.39 -0.12-j*0.39], 0.01); >> impulse(G) 3. Consider the following transfer function relating the output Y(s) to the input F(s) 10๐ 2 + 40๐ + 250 ๐(๐ ) = [ ] ๐น(๐ ) (๐ + 2)[2๐ 2 + 16๐ + 50] (a) (9%) What are the eigenvalues? -2, -4±๐3 (b) (6%) What are the time constants? 0.5 and 0.25 sec (c) (3%) What is the damped natural frequency? 3 rad/sec (d) (3%) What is the undamped natural frequency? 5 rad/sec (e) (3%) What is the damping ratio? 0.8 4. (a) (5%) Assuming that x will become a constant as t→ ∞, find the final value of x(t) for the differential equation below. 2๐ฅฬ + 4๐ฅฬ + 2๐ฅ 3 = 16 ๐ฅ(0− ) = 3 0 + 0 + 2๐ฅ 3 = 16 ๐กโ๐ข๐ ๐ฅฬ (0− ) = 0 ๐ฅ(∞) = 2 (b) (10%) Obtain a linear approximation for the differential equation by approximating x3 with a straight line approximation. Two points: (x,x3), (3,27) and (2,8) gives: ๐ฅ 3 ≈ 19๐ฅ − 30 2๐ฅฬ + 4๐ฅฬ + 2(19๐ฅ − 30) = 16 ๐๐ ๐ฅฬ + 2๐ฅฬ + 19๐ฅ = 38 (c) (10%) Solve for X(s), the Laplace transform of x(t). 38 3๐ 2 + 6๐ + 38 ๐ 2 ๐ − 3๐ + 2(๐ ๐ − 3) + 19๐ = ๐๐ ๐(๐ ) = ๐ ๐ (๐ 2 + 2๐ + 19) (d) (4%) Check your equation for X(s) using the initial and final value theorems; if it doesn’t check, go back to part e and find your mistake! ๐ผ๐๐ ๐๐๐๐๐ก ๐ ๐(๐ )๐ =∞ = 3 ๐น๐๐ ๐๐๐๐๐ก ๐ ๐(๐ )๐ =0 = 2 Both of these give the correct value. 367 Exam 7.b 1. Obtain a linear approximation for the following differential equation by obtaining a straight line approximation for √๐ฅ. Note, realizing that x will become a constant as t→ ∞, what is the final value of x? ๐ฅ(0− ) = 4.01 2๐ฅฬ + 4๐ฅฬ + 2√๐ฅ = 4 ๐ฅฬ (0− ) = 0 Ans: (8%) final value of x ______________? Ans: (8%) linear differential equation ______________________? ๐(๐ฅ) ≈ ๐(๐ฅ๐ ) + [ ๐๐ (๐ฅ − ๐ฅ๐ ) ] ๐๐ฅ ๐ฅ=๐ฅ๐ 2. (12%) Use the integral definition shown below of the Laplace transform to find the Laplace transform of the unit pulse shown below. Then, take the limit as b goes to zero to get the Laplace transform of a unit impulse. f(t) f(t) 1 b 0 limit as b → 0 0 t b unit pulse t unit impulse ∞ ๐น(๐ ) = ∫ ๐(๐ก)๐ −๐ ๐ก ๐๐ก 0 3. (12%) Fill in the table below for the inverse Laplace of the following ๐(๐ ) = (๐ + 5)(6๐ + 18) ๐ (๐ + 0.1)[(๐ + 3)2 + 22 ] ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (โ๐ก + ∅) a b c d g h 368 4. A spring-mass–damper system is shown below; the displacement of the mass is z. z spring mass damper input force Fi Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows (SI units): (1) Force balance on mass equation: (2) Spring force equation: (3) Damper force equation: 10๐งฬ + ๐น๐ + ๐น๐ − ๐น๐ = 0 ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 ๐น๐ = 890๐ง ๐น๐ = 100๐งฬ (a) (8%) What is the transfer function relating Z(s) to the input Fi(s)? (b) (5%) What are the eigenvalues of the system? (c) (8%) If the input force Fi is a step with magnitude 10 N, write some MATLAB code that will produce a plot of z(t). 5. The differential equation for the speed ๐ฃ of a sphere with aerodynamic drag is given below (SI units). Assume the sphere, initially at a height h of zero, is initially tossed upward and then falls to the earth; assume that the speed reaches the terminal speed before it hits the ground. ๐ฃฬ + 20|๐ฃ|๐ฃ = −50,000 ๐ฃ(0− ) = 60 ๐/๐ (a) (8%) Draw pictures of what you think the speed and height will look like as functions of time. Note, be sure to show initial and final values; you can guess the final time. Note, speed and height are positive upward. v(t ) h(t) v 0 t 0 t 369 (b) (14%) Complete the two M-files shown below for an ode45 numerical simulation to obtain plots of h(t) and ๐ฃ (t). Note, โฬ = ๐ฃ. % first M-file [t,x]=ode45(@testEqns,[0 ?],[ plot( ?) figure plot( ?) ?]); % second M-file function dx=testEqns(t,x); dx = zeros( dx(1) = ?,1); ? ? End 6. The transfer function in SI units for the bending stress P in an airplane wing associated with vertical movement u at the wing connection point is given below. vertical displacement, u ๏ฉ 3.5 x109 s 2 ๏น P( s) = ๏ช 2 ๏บU ( s ) ๏ซ s + 12 s + 900 ๏ป bending stress, P The bode plot of this transfer function is shown below. If the input u(t) is sinusoidal with an amplitude of 0.1 m, at what input frequency will the stress be maximum and what will be the amplitude of the stress? M dB =20Log10(M) 370 Bode Diagram 200 Magnitude (dB) 195 190 185 180 175 170 180 Phase (deg) 135 90 45 0 10 1 10 2 Frequency (rad/s) (5%) frequency of stress _________________ (10%) amplitude of stress ____________________ Exam 7.b Solution 1. Obtain a linear approximation for the following differential equation by obtaining a straight line approximation for √๐ฅ. Note, realizing that x will become a constant as t→ ∞, what is the final value of x? 2๐ฅฬ + 4๐ฅฬ + 2√๐ฅ = 4 ๐ฅ(0− ) = 4.01 ๐ฅฬ (0− ) = 0 Ans: (8%) final value of x ๐ฅ(∞) = 4 Ans: (8%) linear differential equation 2๐ฅฬ + 4๐ฅฬ + 0.5๐ฅ = 2 0 + 0 + 2√๐ฅ = 4 ๐กโ๐ข๐ ๐ฅ(∞) = 4 1 Since x is always in the neighborhood of 4, √๐ฅ ≈ √4 + 2√4 (๐ฅ − 4) = 0.25๐ฅ + 1 Thus, 2๐ฅฬ + 4๐ฅฬ + 2(0.25๐ฅ + 1) = 4 ๐๐ 2๐ฅฬ + 4๐ฅฬ + 0.5๐ฅ = 2 371 2. (12%) Use the integral definition shown below of the Laplace transform to find the Laplace transform of the unit pulse shown below. Then, take the limit as b goes to zero to get the Laplace transform of a unit impulse. f(t) f(t) 1 b 0 limit as b → 0 t b unit pulse 0 t unit impulse ∞ ๐น(๐ ) = ∫ ๐(๐ก)๐ −๐ ๐ก ๐๐ก 0 ∞ 1 −๐ ๐ก 1 −๐ ๐ก ๐ 1 1 −๐ ๐ก ๐น(๐ ) = ∫ ๐ ๐๐ก + ∫ 0๐ ๐๐ก = − [ ๐ ] = − ๐ −๐๐ ๐๐ ๐๐ ๐๐ 0 0 ๐ ๐ ๐ ๐๐๐๐๐ก๐→0 = 0 ๐๐ −๐๐ ๐๐ [ ] =1 0 ๐ ๐→0 3. (12%) Fill in the table below for the inverse Laplace of the following ๐(๐ ) = (๐ + 5)(6๐ + 18) ๐ (๐ + 0.1)[(๐ + 3)2 + 22 ] ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (โ๐ก + ∅) a 69.23 b 0 c -68.7 d 0.10 g 3 h 2 4. A spring-mass–damper system is shown below; the displacement of the mass is z. z spring damper mass input force Fi Assuming the mass slides on a frictionless surface, the equations that define the dynamics of this system are as follows (SI units): (4) Force balance on mass equation: 10๐งฬ + ๐น๐ + ๐น๐ − ๐น๐ = 0 ๐ง(0− ) = 0 ๐งฬ (0− ) = 0 (5) Spring force equation: ๐น๐ = 890๐ง (6) Damper force equation: ๐น๐ = 100๐งฬ (a) (8%) What is the transfer function relating Z(s) to the input Fi(s)? 372 10๐ 2 1 + 100๐ + 890 (b) (5%) What are the eigenvalues of the system? −5 ± ๐8 (c) (8%) If the input force Fi is a step with magnitude 10 N, write some MATLAB code that will produce a plot of z(t). >> G = tf(1,[10 100 890]); >> step(10*G) 5. The differential equation for the speed ๐ฃ of a sphere with aerodynamic drag is given below (SI units). Assume the sphere, initially at a height h of zero, is initially tossed upward and then falls to the earth; assume that the speed reaches the terminal speed before it hits the ground. ๐ฃ(0− ) = 60 ๐/๐ ๐ฃฬ + 20|๐ฃ|๐ฃ = −50,000 (a) (8%) Draw pictures of what you think the speed and height will look like as functions of time. Note, be sure to show initial and final values; you can guess the final time Note, speed and height are positive upward. A realistic first guess at the final time is 10 sec. When the speed becomes constant (terminal) 0 + 20|๐ฃ|๐ฃ = −50,000 gives v = -50 m/s v(t ) h(t) 60 0 v t 10 -50 0 t 10 (b) (14%) Complete the two M-files shown below for an ode45 numerical simulation to obtain plots of h(t) and ๐ฃ (t). Note, โฬ = ๐ฃ. ๐ฅ1 = โ ๐ฅ2 = ๐ฃ ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 − 20|๐ฅ2 |๐ฅ2 − 50000 ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 60 % first M-file [t,x]=ode45(@testEqns,[0 10],[ 0 plot( t,x(:,1)) figure plot( t,x(:,2)) 60]); % second M-file function dx=testEqns(t,x); dx = zeros(2,1); 373 dx(1) = x(2); dx(2)=-20*abs(x(2))*x(2)-50000; end 6. The transfer function in SI units for the bending stress P in an airplane wing associated with vertical movement u at the wing connection point is given below. vertical displacement, u ๏ฉ 3.5 x109 s 2 ๏น P( s) = ๏ช 2 ๏บU ( s ) ๏ซ s + 12 s + 900 ๏ป bending stress, P The bode plot of this transfer function is shown below. If the input u(t) is sinusoidal with an amplitude of 0.1 m, at what input frequency will the stress be maximum and what will be the amplitude of the stress? M dB =20Log10(M) Bode Diagram 200 Magnitude (dB) 195 190 185 180 175 170 180 Phase (deg) 135 90 45 0 10 1 10 2 Frequency (rad/s) (5%) frequency of stress ≈ 31 ๐๐๐/๐ 200 (10%) amplitude of stress 0.1 ∗ 10 20 = 0.1 ∗ 1010 = 109 ๐/๐2 374 Exam 7.c 1. The equations for the height H of the water in a tank and exit flow Q through a long line are listed below for SI units. Qi is an input flow into the tank. ๐๐ − ๐ = 4๐ปฬ ๐ป = 2๐ ๐ป(0− ) = 10 ๐ ๐(0− ) = 0 Qi H Q (a) (b) (c) (d) (e) (f) (g) (4%)There are 2 equations. What are the unknowns? (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10 m3/s. (6%) Check your equation for H(s) using the initial and final value theorems. (6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’ command. (3%) How long will it take for H to reach its final value within 1%? (6%) Draw an estimate of the plot of H(t). (5%) Use the residue theorem to find an equation for H(t). (h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t). (i) (6%) Draw a SIMULINK diagram for getting a plot of H(t). (2%) Explain how to enter the initial condition for H. (3%) Considering the name of your workspace, what commands are needed in the Command Window for getting the plot of H(t)? 2. A ball is dropped from a high altitude. The differential equation for the velocity of the ball before it hits the ground for SI units is shown below. ๐ฃฬ + 2๐ฃ|๐ฃ| = 0.5 ๐ฃ(0− ) = 0 ๐/๐ (a) (3%) What is the terminal value of the velocity (final value)? (b) (5%) Obtain a linear approximation for ๐ฃ|๐ฃ| and estimate the time required to reach the terminal velocity within 1%. (c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear differential equation. 375 function exam3 [t,x]=ode45(@exam3eqns,[0 10],[ ? plot( ? ) xlabel( ? ) ylabel( ? ) function dx = exam3eqns(t,x) dx=zeros( ? ,1) ]); ? end end 6๐ +15 3. ๐(๐ ) = [๐ 2 +2๐ +5] ๐(๐ ) (a) (9%) Express this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข A=? B=? C=? D=? (b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the inverse Laplace will be of the form ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + ๐) ๐ =? ๐ =? ๐ =? ๐ =? (c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ? 4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐, explain mathematically why it will fall. ๐ฬ − 64๐ = 0 ๏ฑ ๐ฟ(๐ฬ ) = ๐ ๐น(๐ ) − ๐(0− ); ๐ −๐๐ก ๐(๐ ) ๐(๐ ) | | sin [๐๐ก + ๐๐๐๐๐ ( ; ๐ = 0 ๐๐๐ ๐น๐๐, ๐ = ∞๐๐๐ ๐ผ๐๐ )] ๐ ๐ท(๐ ) ๐ท(๐ ) ๐ =−๐+๐๐ 376 Exam 7.c Solution 1. The equations for the height H of the water in a tank and exit flow Q through a long line are listed below for SI units. Qi is an input flow into the tank. ๐๐ − ๐ = 4๐ปฬ ๐ป = 2๐ ๐ป(0− ) = 10 ๐ ๐(0− ) = 0 Qi H Q (a) (4%) There are 2 equations. What are the unknowns? Q and H (b) (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10 m3/s. 10 − ๐ = 4(๐ ๐ป − 10) ๐ ๐ป = 2๐ Solving for H gives 10๐ + 2.5 ๐ป(๐ ) = ๐ (๐ + 0.125) (c) (6%) Check your equation for H(s) using the initial and final value theorems. FVT: sH(s)s=0 = 2.5/0.125 = 20 IVY: ๐ ๐ป(๐ )๐ =∞ = 10 (d) (6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’ command. >> G=tf([10 2.5],[1 0.125 0]); >> impulse(G) (e) (3%) How long will it take for H to reach its final value within 1%? 5*8 = 40 s (f) (6%) Draw an estimate of the plot of H(t). H, m 20 10 0 40 t, s 377 (g) (5%) Use the residue theorem to find an equation for H(t). ๐ป(๐ก) = 20 − 10๐ −0.125๐ก (h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t). H(0)=10 H(∞)=20 (i) (6%) Draw a SIMULINK diagram for getting a plot of H(t). (2%) Explain how to enter the initial condition for H. Double click on integrator and enter the initial condition of 10. clock initial condition 10 Qi 10 +- H๏ฆ 0.25 ๏ฒ H 0.5 Q Y mux workspace (3%) Considering the name of your workspace, what commands are needed in the Command Window for getting the plot of H(t)? >> plot(Y(:,1),Y(:,2)) 2. A ball is dropped from a high altitude. The differential equation for the velocity of the ball before it hits the ground for SI units is shown below. ๐ฃฬ + 2๐ฃ|๐ฃ| = 0.5 ๐ฃ(0− ) = 0 ๐/๐ (a) (3%) What is the terminal value of the velocity (final value)? 0 + 2๐ฃ|๐ฃ| = 0.5 ๐กโ๐ข๐ ๐ฃ = √0.25 = 0.5 ๐/๐ (b) (5%) Obtain a linear approximation for ๐ฃ|๐ฃ| and estimate the time required to reach the terminal velocity within 1%. The velocity starts at 0 and ends at 0.5; so, a 2-point straight line is ๐ฃ|๐ฃ| ≈ 0.5๐ฃ + 0 The differential equation becomes ๐ฃฬ + ๐ฃ = 0.5 thus the time constant is 1 s. So, it will take about 5 s to reach terminal velocity. (c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear differential equation. function exam3 [t,x]=ode45(@exam3eqns,[0 10],[ 0 ]); plot( t,x(:,1)) xlabel( ‘time, s’ ) ylabel( ‘velocity, m/s’) function dx = exam3eqns(t,x) dx=zeros( 1 ,1); dx(1)=0.5-2*x(1)*abs(x(1)); end end 378 6๐ +15 3. ๐(๐ ) = [๐ 2 +2๐ +5] ๐(๐ ) (a) (9%) Express this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข A=? B=? C=? D=? ๐ด=[ 0 1 0 ] ๐ต=[ ] −5 −2 1 ๐ถ = [15 ๐ฆ = ๐ถ๐ + ๐ท๐ข 6] ๐ท = [0] (b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the inverse Laplace will be of the form ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + ๐) ๐(๐ ) = [ 6๐ + 15 10 60๐ + 150 ] = + 2๐ + 5 ๐ ๐ [(๐ + 1)2 + 22 ] ๐ 2 ๐=3 ๐=0 ๐=1 ๐=2 (c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ? 6๐ + 15 ๐ฆ(๐ก) = 10 | 2 | sin(2๐ก + ∅) ๐ + 2๐ + 5 ๐ =๐2 6(๐2) + 15 = 10 | | sin(2๐ก + ∅) (๐2)2 + 2(๐2) + 5 15 + ๐12 15 + ๐12 )) = 10 | | sin (2๐ก + ๐๐๐๐๐ ( 1 + ๐4 1 + ๐4 = 10√ 241 12 4 sin (2๐ก + ๐ก๐๐−1 ( ) − ๐ก๐๐−1 ( )) 17 15 1 = 46.59sin (2๐ก − 0.651) 4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐, explain mathematically why it will fall. ๐ฬ − 64๐ = 0 The characteristic polynomial has real roots = ±8. So, the solution ๐(๐ก) = ๐๐ 8๐ก + ๐๐ −8๐ก will increase to infinity theoretically but in reality only till the pendulum hits the ground. ๏ฑ 379 Exam 8.a 1. H(s) is the Laplace transform of the height h of the water in a tank within a complex water system. 8๐ + 24 ๐ป(๐ ) = (๐ + 2)(๐ + 4) (a) Use initial value theorem to determine the height at t = 0. (b) Use the final value theorem to get a plot of the final value of the water height. (c) Estimate a plot of h(t). h(t) t 0 (d) Use the residue theorem to get an equation for h(t). (e) Substitute t = 0 into your equation for h(t) and determine if you get the same as found in (a). (f) Substitute t = ∞ into your equation for h(t) and determine if you get the same as found in (b). IVT ๐ ๐(๐ )๐ =∞ FVT ๐ ๐(๐ )๐ =0 {Residue of a 1st order pole –p} = [(s+p)X(s)est]s = -p 2. Consider the following differential equation for the position y of a mass in a suspension system. 2๐ฆฬ + 2.4๐ฆฬ + 18๐ฆ = 90 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 2 (a) What are the eigenvalues? (b) What is the undamped natural frequency ๐๐ ? (c) What is the damping ratio? (d) Estimate a plot of y(t). y(t) 0 t 380 (e) Laplace transform the differential equation and solve for Y(s). (f) Check your answer in (e) using the IVT and the FVT. 3. The differential equation for the downward velocity ๐ฃ of a sphere dropped from a tower is ๐ฃฬ + 0.2๐ฃ|๐ฃ| = 20 ๐ฃ(0− ) = 0 (a) What is the terminal (final) velocity? (b) Draw an estimate of the plot of ๐ฃ|๐ฃ| vs. ๐ฃ ; then obtain a straight line approx. for ๐ฃ|๐ฃ|, i.e. ๐ฃ|๐ฃ| ≈ ๐๐ฃ + ๐ ๐ =? ๐ =? vv v 0 (c) Replace ๐ฃ|๐ฃ| in the differential equation with your ๐๐ฃ + ๐ to get a linear differential equation. (d) Does your linear differential equation give the correct terminal velocity? (e) Using your linear differential equation, determine approximately how long it will take to obtain terminal velocity within 1%. (f) Estimate a plot of v(t). v(t) 0 t Exam 8.a Solution Exam 1 Solution MAE 3360 Sept. 21, 2017 1. H(s) is the Laplace transform of the height h of the water in a tank within a complex water system. 8๐ + 24 ๐ป(๐ ) = (๐ + 2)(๐ + 4) (a) (5%) Use initial value theorem to determine the height at t = 0. 381 8๐ 2 + 24๐ ๐ ๐ป(๐ ) = [ ] =8 (๐ + 2)(๐ + 4) ๐ =∞ (b) (5%) Use the final value theorem to get a plot of the final value of the water height. 8๐ 2 + 24๐ ๐ ๐ป(๐ ) = [ ] =0 (๐ + 2)(๐ + 4) ๐ =0 (c) (9%) Estimate a plot of h(t). h(t) 8 2.5 0 t (d) (10%) Use the residue theorem to get an equation for h(t). 8(−2) + 24 −2๐ก 8(−4) + 24 −4๐ก โ(๐ก) = ๐ + ๐ = 4๐ −2๐ก + 4๐ −4๐ก −2 + 4 −4 + 2 (e) (5%) Substitute t = 0 into your equation for h(t) and determine if you get the same as found in (a). โ(0) = 4 + 4 = 8 (f) (5%) Substitute t = ∞ into your equation for h(t) and determine if you get the same as found in (b). โ(∞) = 0 + 0 = 0 IVT ๐ ๐(๐ )๐ =∞ FVT ๐ ๐(๐ )๐ =0 {Residue of a 1st order pole –p} = [(s+p)X(s)est]s = -p 2. Consider the following differential equation for the position y of a mass in a suspension system. 2๐ฆฬ + 2.4๐ฆฬ + 18๐ฆ = 90 ๐ฆ(0− ) = 0 ๐ฆฬ (0− ) = 2 (a) (8%) What are the eigenvalues? −0.6 ± ๐√8.64 = −0.6 ± ๐2.939 (b) (3%) What is the undamped natural frequency ๐๐ ? ๐๐ = 3 (c) (3%) What is the damping ratio? 2๐ฟ๐๐ = 1.2 ๐กโ๐ข๐ ๐ฟ = 0.2 (d) (6%) Estimate a plot of y(t). y(t) 5 0 8.33 t (e) (7%) Laplace transform the differential equation and solve for Y(s). 382 90 4๐ + 90 ๐(๐ ) = 2 ๐ ๐ (2๐ + 2.4๐ + 18) (f) (6%) Check your answer in (e) using the IVT and the FVT. IVT ๐ ๐(๐ )๐ =∞ = 0 FVT ๐ ๐(๐ )๐ =0 = 0 3. The differential equation for the downward velocity ๐ฃ of a sphere dropped from a tower is ๐ฃฬ + 0.2๐ฃ|๐ฃ| = 20 ๐ฃ(0− ) = 0 (a) (5%) What is the terminal (final) velocity? 0 + 0.2๐ฃ|๐ฃ| = 20 ๐ ๐๐๐๐ ๐ฃ > 0, ๐ฃ = √100 = 10 (b) (7%) Draw an estimate of the plot of ๐ฃ|๐ฃ| vs. ; then obtain a straight line approx. for ๐ฃ|๐ฃ|, i.e. ๐ฃ|๐ฃ| ≈ ๐๐ฃ + ๐ ๐ =? ๐ =? v starts at 0 and ends at 10, a =10 and b = 0 2(๐ ๐ − 2) + 2.4๐ ๐ + 18๐ = vv v v ๏ป 10v 100 10 0 v (c) (5%) Replace ๐ฃ|๐ฃ| in the differential equation with your ๐๐ฃ + ๐ to get a linear differential equation. ๐ฃฬ + 0.2(10๐ฃ) = 20 (d) (2%) Does your linear differential equation give the correct terminal velocity? Yes (e) (2%) Using your linear differential equation, determine approximately how long it will take to obtain terminal velocity within 1%. Time constant = 0.5. Thus it will take about 2.5 s. (f) (7%) Estimate a plot of v(t). v(t) 10 0 2.5 t Exam 8.b 1. Consider the following differential equation for y(t). Be sure to check your solution at t = 0 and at t = ∞. 2๐ฆฬ + 20๐ฆ = 60 ๐ฆ(0− ) = 5 383 (a) (5%) Draw an estimate of the plot of y(t). (b) (5%) Find the Laplace transform for y(t), Y(s). Check your answer for Y(s) using the initial and final value theorems. (c) (5%) Find the inverse Laplace of Y(s). Check your equation for y(t) by setting t = 0 and t = ∞. 2. Consider the differential equation for w(t) shown below with input u(t). ๐ค โ + 104๐คฬ + 429๐คฬ + 2900๐ค = 25๐ขฬ + 5800๐ข (a) (5%) What is the transfer function relating W(s) to U(s)? (b) (10%) Assume ๐ 3 + 104 + 429๐ + 2900 = (๐ + 100)[(๐ + 2)2 + 52 ] What are the eigenvalues? What are the time constants? Damping ratio? (c) (10%) Suppose u(t) is a step input with magnitude of 4. Also, assume ๐ค(0− ) = 0, ๐คฬ (0− ) = 0, ๐คฬ (0− ) = 20 ๐ข(0− ) = 0. Find an equation for W(s); check your answer using the initial value and final value theorems. (d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the following form: ๐ค(๐ก) = ๐ + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + โ) ๐ =? ๐ =? ๐ =? ๐ =? (e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without first finding an equation for w(t). (f) (12%) Express the differential equation in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข Note, ๐ฬ is the output of interest. ๐ค โ + 104๐คฬ + 429๐คฬ + 2900๐ค = 25๐ขฬ + 5800๐ข ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐คฬ (0− ) = 20 ๐ข(0− ) = 0 (3%) What are the initial conditions for your state variables? (g) The equations for the water flowing through a long line between two tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 √๐ป1 − ๐ป2 = 25๐ ๐ป1 (0− ) = 10 ๐ป2 (0− ) = 2 ๐๐๐ ๐ป1 ≥ ๐ป2 384 H1 H2 Q 3.a (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? 3.b (16%) Realizing that this system has 2 first order differential equations, it is obvious that two state variables will be needed to perform an ode45 simulation of this system. What are the state variables and what are their derivative equations? 3.c (4%) When performing your ode45 simulation, what are the initial conditions for your state variables? Exam 8.b Solution 1. Consider the following differential equation for y(t). Be sure to check your solution at t = 0 and at t = ∞. 2๐ฆฬ + 20๐ฆ = 60 (a) (5%) Draw an estimate of the plot of y(t). ๐ฆ(0− ) = 5 5 3 0 0.5 t (b) (5%) Find the Laplace transform for y(t), Y(s). Check your answer for Y(s) using the initial and final value theorems. 5๐ + 30 ๐(๐ ) = ๐ผ๐๐: ๐ ๐(๐ )๐ =∞ = 5 ๐น๐๐: ๐ ๐(๐ )๐ =0 = 3 ๐ (๐ + 10) (c) (5%) Find the inverse Laplace of Y(s). Check your equation for y(t) by setting t = 0 and t = ∞. ๐ฆ(๐ก) = 3 + 2๐ −10๐ก ๐ฆ(0) = 3 + 2 = 5 ๐ฆ(∞) = 3 2. Consider the differential equation for w(t) shown below with input u(t). ๐ค โ + 104๐คฬ + 429๐คฬ + 2900๐ค = 25๐ขฬ + 5800๐ข (a) (5%) What is the transfer function relating W(s) to U(s)? 385 ๐ 3 (b) (10%) Assume 25๐ + 5800 + 104๐ 2 + 429๐ + 2900 ๐ 3 + 104๐ 2 + 429๐ + 2900 = (๐ + 100)[(๐ + 2)2 + 52 ] What are the eigenvalues? What are the time constants? Damping ratio? ๐ธ๐ ′ ๐ = −100, −2 ± ๐5 ๐๐๐๐ ๐๐๐๐ ๐ก๐๐๐ก๐ = 0.01, 0.5 ๐๐๐๐๐๐๐ ๐๐๐ก๐๐ = 0.371 (c) (10%) Suppose u(t) is a step input with magnitude of 4. Also, assume ๐ค(0− ) = 0, ๐คฬ (0− ) = 0, ๐คฬ (0− ) = 20 ๐ข(0− ) = 0. Find an equation for W(s); check your answer using the initial value and final value theorems. 120๐ + 23,200 ๐(๐ ) = ๐ผ๐๐: 0 ๐น๐๐: 8 ๐ (๐ + 100)[(๐ + 2)2 + 52 ] (d) (15%) It can be shown for the correct W(s) in (c) that the inverse Laplace w(t) is of the following form: ๐ค(๐ก) = ๐ + ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + โ) ๐=8 ๐ = 100 ๐=2 ๐=5 (e) (5%) Using W(s) from (c), write the MATLAB commands for getting a plot of w(t) without first finding an equation for w(t). >> n=[120 23200]; >> d=[1 104 429 2900 0]; >> g=tf(n,d); >> impulse(g) (f) (12%) Express the differential equation in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข Note, ๐ฬ is the output of interest. ๐ค โ + 104๐คฬ + 429๐คฬ + 2900๐ค = 25๐ขฬ + 5800๐ข ๐ค(0− ) = 0 ๐คฬ (0− ) = 0 ๐คฬ (0− ) = 20 ๐ข(0− ) = 0 ๐ฅ1 = ๐ค ๐ฅ2 = ๐คฬ ๐ฅ3 = ๐คฬ − 25๐ข 0 1 0 0 ๐ด=[ 0 ๐ต = ] [ 0 1 25 ] ๐ถ = [0 0 1] ๐ท = [25] −2900 −429 −104 3200 (3%) What are the initial conditions for your state variables? ๐ฅ1 (0− ) = 0 ๐ฅ2 (0− ) = 0 ๐ฅ3 (0− ) = 20 (g) The equations for the water flowing through a long line between two tanks are as follows: −๐ − 20๐ปฬ1 = 0 ๐ − 40๐ปฬ2 = 0 √๐ป1 − ๐ป2 = 25๐ ๐ป1 (0− ) = 10 ๐ป2 (0− ) = 2 ๐๐๐ ๐ป1 ≥ ๐ป2 386 H1 H2 Q 3.a (5%) List the unknowns in these equations. Do the number of equations match the number of unknowns? Q, H1, H2 yes 3.b (16%) Realizing that this system has 2 first order differential equations, it is obvious that two state variables will be needed to perform an ode45 simulation of this system. What are the state variables and what are their derivative equations? ๐ฅ1 = ๐ป1 ๐ฅ2 = ๐ป2 ๐ฅฬ 1 = −0.002√๐ป1 − ๐ป2 ๐ฅฬ 2 = 0.001√๐ป1 − ๐ป2 3.c (4%) When performing your ode45 simulation, what are the initial conditions for your state variables? ๐ฅ1 (0− ) = 10 ๐ฅ2 (0− ) = 2 Exam 8.c 1. The equations for the height H of the water in a tank and exit flow Q through a long line are listed below for SI units. Qi is an input flow into the tank. ๐๐ − ๐ = 4๐ปฬ ๐ป = 2๐ ๐ป(0− ) = 10 ๐ ๐(0− ) = 0 Qi H Q (a) (4%)There are 2 equations. What are the unknowns? (b) (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10 m3/s. (c) (d) (e) (f) (g) (6%) Check your equation for H(s) using the initial and final value theorems. (6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’ command. (3%) How long will it take for H to reach its final value within 1%? (6%) Draw an estimate of the plot of H(t). (5%) Use the residue theorem to find an equation for H(t). (h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t). (i) (6%) Draw a SIMULINK diagram for getting a plot of H(t). (2%) Explain how to enter the initial condition for H. (3%) Considering the name of your workspace, what commands are needed in the Command Window for getting the plot of H(t)? 387 2. A ball is dropped from a high altitude. The differential equation for the velocity of the ball before it hits the ground for SI units is shown below. ๐ฃฬ + 2๐ฃ|๐ฃ| = 0.5 ๐ฃ(0− ) = 0 ๐/๐ (a) (3%) What is the terminal value of the velocity (final value)? (b) (5%) Obtain a linear approximation for ๐ฃ|๐ฃ| and estimate the time required to reach the terminal velocity within 1%. (c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear differential equation. function exam3 [t,x]=ode45(@exam3eqns,[0 10],[ ? ]); plot( ? ) xlabel( ? ) ylabel( ? ) function dx = exam3eqns(t,x) dx=zeros( ? ,1) ? end end 6๐ +15 3. ๐(๐ ) = [๐ 2 +2๐ +5] ๐(๐ ) (a) (9%) Express this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข A=? B=? C=? D=? (b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the inverse Laplace will be of the form ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + ๐) ๐ =? ๐ =? ๐ =? ๐ =? (c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ? 4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐, explain mathematically why it will fall. ๐ฬ − 64๐ = 0 ๏ฑ 388 Exam 8.c Solution 1. The equations for the height H of the water in a tank and exit flow Q through a long line are listed below for SI units. Qi is an input flow into the tank. ๐๐ − ๐ = 4๐ปฬ ๐ป = 2๐ ๐ป(0− ) = 10 ๐ ๐(0− ) = 0 Qi H Q (a) (4%) There are 2 equations. What are the unknowns? Q and H (b) (6%) Laplace transform these equations; solve for H(s) assuming Qi is a constant of 10 m3/s. 10 − ๐ = 4(๐ ๐ป − 10) ๐ ๐ป = 2๐ Solving for H gives 10๐ + 2.5 ๐ป(๐ ) = ๐ (๐ + 0.125) (c) (6%) Check your equation for H(s) using the initial and final value theorems. FVT: sH(s)s=0 = 2.5/0.125 = 20 IVY: ๐ ๐ป(๐ )๐ =∞ = 10 (d) (6%) Write the MATLAB commands for getting a plot of H(t) using the ‘impulse’ command. >> G=tf([10 2.5],[1 0.125 0]); >> impulse(G) (e) (3%) How long will it take for H to reach its final value within 1%? 5*8 = 40 s (f) (6%) Draw an estimate of the plot of H(t). H, m 20 10 0 40 t, s (g) (5%) Use the residue theorem to find an equation for H(t). ๐ป(๐ก) = 20 − 10๐ −0.125๐ก 389 (h) (4%) Substitute t = 0 and t = ∞ into your equation for H(t) to check your equation for H(t). H(0)=10 H(∞)=20 (i) (6%) Draw a SIMULINK diagram for getting a plot of H(t). (2%) Explain how to enter the initial condition for H. Double click on integrator and enter the initial condition of 10. (3%) Considering the name of your workspace, what commands are needed in the Command Window for getting the plot of H(t)? >> plot(Y(:,1),Y(:,2)) 2. A ball is dropped from a high altitude. The differential equation for the velocity of the ball before it hits the ground for SI units is shown below. ๐ฃฬ + 2๐ฃ|๐ฃ| = 0.5 ๐ฃ(0− ) = 0 ๐/๐ (a) (3%) What is the terminal value of the velocity (final value)? 0 + 2๐ฃ|๐ฃ| = 0.5 ๐กโ๐ข๐ ๐ฃ = √0.25 = 0.5 ๐/๐ (b) (5%) Obtain a linear approximation for ๐ฃ|๐ฃ| and estimate the time required to reach the terminal velocity within 1%. The velocity starts at 0 and ends at 0.5; so, a 2-point straight line is ๐ฃ|๐ฃ| ≈ 0.5๐ฃ + 0 The differential equation becomes ๐ฃฬ + ๐ฃ = 0.5 thus the time constant is 1 s. So, it will take about 5 s to reach terminal velocity. (c) (8%) Complete the ode45 commands below to get a plot of the original nonlinear differential equation. function exam3 [t,x]=ode45(@exam3eqns,[0 10],[ 0 ]); plot( t,x(:,1)) xlabel( ‘time, s’ ) ylabel( ‘velocity, m/s’) function dx = exam3eqns(t,x) dx=zeros( 1 ,1); dx(1)=0.5-2*x(1)*abs(x(1)); end end 6๐ +15 3. ๐(๐ ) = [๐ 2 +2๐ +5] ๐(๐ ) 390 (a) (9%) Express this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข A=? B=? C=? D=? ๐ฆ = ๐ถ๐ + ๐ท๐ข 0 1 0 Using phase variables: ๐ด = [ ] ๐ต = [ ] ๐ถ = [15 6] ๐ท = [0] −5 −2 1 0 1 6 Using simulation diagram: ๐ด = [ ] ๐ต = [ ] ๐ถ = [1 0] ๐ท = [0] −5 −2 3 (b) (8%) Assume the input u(t) is a step input with magnitude 10. We know that the inverse Laplace will be of the form ๐ฆ(๐ก) = ๐๐ −๐๐ก + ๐๐ −๐๐ก sin (๐๐ก + ๐) ๐(๐ ) = [ 6๐ + 15 10 60๐ + 150 ] = + 2๐ + 5 ๐ ๐ [(๐ + 1)2 + 22 ] ๐ 2 ๐ = 30 ๐ = 0 ๐ = 1 ๐ = 2 (c) (6%) Assume u(t) = 10sin(2t). After all transients have died out, y(t) = ? 6๐ + 15 ๐ฆ(๐ก) = 10 | 2 | sin(2๐ก + ∅) ๐ + 2๐ + 5 ๐ =๐2 6(๐2) + 15 = 10 | | sin(2๐ก + ∅) (๐2)2 + 2(๐2) + 5 15 + ๐12 15 + ๐12 )) = 10 | | sin (2๐ก + ๐๐๐๐๐ ( 1 + ๐4 1 + ๐4 = 10√ 241 12 4 sin (2๐ก + ๐ก๐๐−1 ( ) − ๐ก๐๐−1 ( )) 17 15 1 = 46.59sin (2๐ก − 0.651) 4. (10%) Common sense tells us that the inverted pendulum shown below will fall from the vertical position if disturbed even slightly while at rest in the vertical position. Using the differential equation for ๐, explain mathematically why it will fall. ๐ฬ − 64๐ = 0 The characteristic polynomial has a positive real root = 8. ๏ฑ 391 Exam 9a 1. Consider the following differential equation for y(t). 4๐ฆฬ + 40๐ฆฬ + 400๐ฆ = 800 ๐ฆ(0− ) = 1 ๐ฆฬ (0− ) = 0 (a) (2%) What is the order of the differential equation? ______ (b) (2%) What is the input to the differential equation? _______ (c) (2%) What is the value of y(t) at time t = 0- ? _______ (d) (2%) Is the equation linear or nonlinear? __________ (e) (3%) What is the value of y(t) as t → ∞ ? ________ (f) (4%) What is the characteristic polynomial? ______________________________ (g) (6%) What are the eigenvalues? ____________________________ (Check your answer!) (h) (4%) What is the damping ratio? _______________________ (i) (3%) What is the undamped natural frequency? _____________ (j) (3%) What is the time constant? _____________ (k) (8%) Sketch an estimate of the solution y(t) of the equation below including the effects of the damping ratio and the time constant. y(t) 0 t ๐ 2 + 2๐ฟ๐๐ ๐ + ๐๐2 = 0 (๐ + ๐)2 + ๐๐2 = 0 2. The input to the following differential equation is a unit impulse denoted by ๐ฟ(๐ก). ๐ฆฬ + 7๐ฆฬ + 10๐ฆ = 5๐ฟ(๐ก) ๐ฆ(0− ) = 2 ๐ฆฬ (0− ) = 0 (a) (5%) What are the eigenvalues of this differential equation? ___________________ (b) (6%) Sketch below an estimate of the plot of y(t). y(t) 0 t (c) (4%) What is the Laplace transform of the unit impulse ๐ฟ(๐ก)? ______________ (d) (10%) Laplace transform the differential equation and solve for Y(s). (e) (6%) Use the initial value theorem (IVT) and the final value theorem (FVT) and your plot in part (b) to check your equation for Y(s). 392 (f) (10%)Use the residue theorem to find the inverse Laplace transform of Y(s) to get an equation for y(t). Substitute t = 0 and t = ∞ in your equation for y(t) to check your equation for y(t). ๐ฟ{๐ฬ} = ๐ ๐น(๐ ) − ๐(0− ) ๐ฟ{๐ฬ } = ๐ 2 ๐น(๐ ) − ๐ ๐(0− ) − ๐ฬ (0− ) FVT: lim ๐(๐ก) = ๐ ๐น(๐ )๐ =0 IVT: lim ๐(๐ก) = ๐ ๐น(๐ )๐ =∞ + ๐ก→∞ 0 ←๐ก 3. The input to the differential equation below is u(t) = 2sin(5t). The Laplace transform for u(t) is also shown below. 10 ๐ฆฬ + 10๐ฆ = ๐ข ๐ฆ(0− ) = 0 ๐(๐ ) = 2 ๐ + 52 (a) (6%) Find and equation for Y(s). (b) (4%) Write MATLAB commands for getting a plot of y(t). 4. A car initially moving with a speed of 10 m/s starts coasting up a hill. The equations defining the dynamics of the forward motion of the moving car are as follows: 1000๐ฃฬ + ๐๐ + ๐๐ = 0 sum of forces on the car ๐๐ = 20๐ฃ aerodynamic drag force ๐๐ = 10,000 gravity force due to hill (a) (6%) Laplace transform each of the equations. (b) (4%) Solve for the Laplace transform of the drag force Fd(s). Exam 9a Solution 393 394 Exam 9b 1. A schematic of a vertical pendulum is shown below. The angle ๐ is measured from the vertical and is positive clockwise. The differential equation for ๐ assuming small angles is ๐ฬ − 5๐ = 0 ๐ฬ(0− ) = 0 ๐(0− ) = 0.1 (a) (15%) Laplace transform the equation and then use the inverse Laplace to get ๐(๐ก). When you substitute t = 0, does your equation for ๐(๐ก) give the correct value? (b) (5%) Common sense tells us that if the pendulum starts at a non-zero angle, it will fall. Using your equations in (a), prove mathematically that it will fall. ๐ ๐ฟ{๐ฆ} = ๐(๐ ) ๐ฟ{๐ฆฬ } = ๐ ๐(๐ ) − ๐ฆ(0− ) ๐ฟ{๐ฆฬ } = ๐ 2 ๐(๐ ) − ๐ ๐ฆ(0− ) − ๐ฆฬ (0− ) 2. In order to keep the pendulum vertical and return it to vertical from an initial non-zero angle, as shown below, the pendulum is attached to a cart that moves laterally with displacement z. The lateral movement results from a force Fi acting on the cart; see the differential equation for the cart displacement shown below. The pendulum angle ๐ is continuously measured and used for the input to the differential equation for the force Fi; see the differential equation for Fi shown below. Thus, assuming small angles, the differential equations for the pendulum and cart are ๐ฬ − 5๐ = −0.5๐งฬ ๐๐๐ค ๐๐๐ข๐๐ก๐๐๐ ๐๐๐ ๐๐๐๐๐ข๐๐ข๐ ๐๐๐๐ ๐๐๐๐๐๐๐ ๐ง ๐งฬ = −0.2๐ฬ − 0.1๐น๐ ๐๐๐๐๐๐๐๐๐ก๐๐๐ ๐๐๐ข๐๐ก๐๐๐ ๐๐๐ ๐กโ๐ ๐๐๐๐ก ๐๐๐ ๐๐๐๐๐๐๐๐๐ก ๐น๐ฬ + 8๐น๐ = −150[๐ฬ + 6๐] ๐๐๐๐๐๐๐๐๐ก๐๐๐ ๐๐๐ข๐๐ก๐๐๐ ๐๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ ๐กโ๐ ๐๐๐๐ก Ms ๏ฑ L z Mc Fi 395 (d) (6%) What are the three unknowns in these three equations? (e) (9%) Convert these equations to algebraic equations by Laplace transforming each of the three equations assuming all initial conditions are zero except ๐(0− ) = ๐๐ . (f) (5%) Write symbolic math MATLAB commands for solving for ๐(๐ ). 3. The equations for a vehicle suspension are shown below. The input is the displacement u(t). The output of interest is y = v – u. We want to express the equations for this system in state variable format, i.e. ๐ฬ = ๐ด๐ + ๐ต๐ข ๐ฆ = ๐ถ๐ + ๐ท๐ข (a) (8%) Define a set of state variables for this system. Do not write their derivative equations. (b) (12%) Suppose you are able to find the transfer function G(s) for w; that is W(s) = G(s)U(s). You then have generated the frequency response for G(s) using the MATLAB command bode to get the plot shown below. What is the DC gain of the transfer function?_____ Explain why value of DC gain makes sense. What is the approximate gain of the transfer function at the sinusoidal input frequency of 7 rad/s? __________ Magnitude (dB) 40 Bode Diagram 20LogM=M in dB 20 0 -20 -40 Phase (deg) -60 0 -90 -180 -270 -360 0 10 1 10 Frequency (rad/s) 2 10 396 4. (20%) 5. (20%) Two water tanks are connected by a pipe. The input to the system is flow rate Qi. HL is the height of the water in the tank on the left and HR is the height of the water in the tank on the right. Qi HR HL Q The equations for this system are ๐๐ − ๐ − 4๐ปฬ๐ฟ = 0 ๐ป๐ฟ (0− ) = 3 ๐ ๐ − 4๐ปฬ๐ = 0 ๐ป๐ (0− ) = 5 ๐ ๐ = 0.025(๐ป๐ฟ − ๐ป๐ ) Define state variables for this system of equations and write the derivative equations, i.e. ๐ฅ1 =? ๐ฅ2 =? : โถ ๐ฅฬ 1 =? ๐ฅฬ 2 =? โถ โถ 397 Exam 9b Solution 398 399 400 Exam 9c 1. The differential equation for the bending stress p in SI units at the connection point of an airplane wing associated with vertical movement u of the fuselage is 2๐ฬ + 24๐ฬ + 1872๐ = 7๐ฅ109 ๐ขฬ (a) (5%) What is the transfer function for P(s)? That is, P(s) = G(s)U(s), G(s) = ? (b) (5%) Suppose u(t) is a step input with magnitude 0.5. Write MATLAB commands for getting a plot of p(t) using the command ‘step’. (5%) For the same step input, write MATLAB commands for getting a plot of p(t) using the command ‘impulse’. (c) (6%) What are the eigenvalues of this stress model? __________________________ 401 (d) (4%) Check your answer to part (c); otherwise, your answers in (e) will be wrong. (e) (16%) Suppose the input u(t) is a step with magnitude 0.5 m. It can be shown that the inverse Laplace transform solution to the differential equation above is of the following form: ๐(๐ก) = ๐๐ ๐๐ก sin (๐๐ก + ∅) ๐ =? ๐ =? ๐ =? ∅ =? Note, if your P(s) doesn’t give this p(t), stop and go back and find your error before proceeding. ๐ −๐๐ก ๐(๐ ) | | sin(๐๐ก + ๐) ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐(๐ ) ) ๐ = ๐๐๐๐๐ {( } ๐ท(๐ ) ๐ =−๐+๐๐ (f) The frequency response plot of the transfer function for p is shown below. At what input frequency of u(t) will the stress have the greatest amplification? (4%) ________ What is the amplification at this frequency? (4%) __________ (M dB = 20Log10M) If ๐ข(๐ก) = 0.1 sin(50๐ก), what will be the amplitude and frequency of p(t)? (8%)_____ Bode Diagram Magnitude (dB) 200 190 180 170 160 Phase (deg) 150 180 135 90 45 0 10 1 10 2 Frequency (rad/s) (g) (5%) Suppose the PSD of u(t), ๐บ๐ข๐ข (๐), is a zero-mean-band-limited white noise with magnitude A for 0 ≤ ๐ ≤ 100 โ๐ง. If the mean square value is ฬ ฬ ฬ ๐ข2 = 0.04, what is A? Draw a sketch of ๐บ๐ข๐ข (๐). (h) (10%) Suppose we want to generate values of u(kH) corresponding to the PSD in (g) to be used for the input to the differential equation in a simulation to get values of ๐(๐๐ป). Suggest and justify values for H and N where N is the number of values of 1 ๐ข(๐๐ป) to be generated for the simulation. Recall, 2๐ป is the maximum frequency in hz that will be generated and NH will be the total simulation time. 2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity ๐(0− ) = √1002 + 1202 = 156.2 m/s. The differential equation for the vertical displacement can be shown to be 402 ๐ฆฬ + 0.005๐๐ฆฬ ≈ −10 ๐ฆ(0− ) = 2 ๐ ๐ฆฬ (0− ) = 100 ๐/๐ and the differential equation for the horizontal displacement can be shown to be ๐คฬ + 0.005๐๐คฬ = 0 ๐ค(0− ) = 0 ๐ ๐คฬ (0− ) = 120 ๐/๐ where the velocity V of the ball is ๐ = √๐ฆฬ 2 + ๐คฬ 2 (d) (12%) Define state variables xi and write the ๐ฬ ๐ equations for an ode45 numerical simulation to get plots of y(t) and w(t). y w (e) (13%) Complete the MATLAB code below for an ode45 simulation of these equations. [t,x]=ode45(@eqns,[0 10],[ ]); y= ; w= ; plot(t , w , ’r’ , t , y , ’k:’ ) % plot y(t) and w(t) xlabel( ‘ time, s’ ) ylabel( ‘ displacements, m’ ) legend(‘w(t)’,’y(t)’) function dx=eqns(t,x) dx=zeros( , 1); V= dx(1)= end (f) (3%) Draw a sketch of what you think the plot of y(t) v. w(t) will look like. w(t) 403 Exam 3 Solution MAE 3360 Nov. 26, 2019 1. The differential equation for the bending stress p in SI units at the connection point of an airplane wing associated with vertical movement u of the fuselage is 2๐ฬ + 24๐ฬ + 1872๐ = 7๐ฅ109 ๐ขฬ 2 7๐9๐ (a)(5%) What is the transfer function for P(s)? That is, P(s) = G(s)U(s), ๐บ(๐ ) = 2๐ 2 +24๐ +1872 (b)(5%) Suppose u(t) is a step input with magnitude 0.5. Write MATLAB commands for getting a plot of p(t) using the command ‘step’. >> G=tf(0.5*[7e9 0 0],[2 24 1872]); >> step(G) (5%) For the same step input, write MATLAB commands for getting a plot of p(t) using the command ‘impulse’. Considering that U(s)=0.5/s and thus, P(s)=G(s)U(s) >> P=tf(0.5*[7e9 0],[2 24 1872]); >> impulse(P) (c)(6%) What are the eigenvalues of this stress model? 2(๐ 2 + 12๐ + 936) = 2(๐ + 6 + ๐30)(๐ + 6 − ๐30) ๐ธ๐ ′ ๐ = −6 ± ๐30 (d)(4%) Check your answer to part (c); otherwise, your answers in (e) will be wrong. (e)(16%) Suppose the input u(t) is a step with magnitude 0.5 m. It can be shown that the inverse Laplace transform solution to the differential equation above is of the following form: ๐(๐ก) = ๐๐ ๐๐ก sin (๐๐ก + ∅) ๐ =? ๐ =? ๐ =? ∅ =? Note, if your P(s) doesn’t give this p(t), stop and go back and find your error before proceeding. ๐ −6๐ก 0.5 ∗ 7๐9๐ ๐ ๐(๐ก) = | | sin(30๐ก + ๐) ๐ = ๐๐๐๐๐ {[ ] } 30 2 1 ๐ =−6+๐30 ๐ =−6+๐30 ๐(๐ก) = (1.7847๐9)๐ −6๐ก sin (30๐ก + 1.7682) 404 (f) The frequency response plot of the transfer function for p is shown below. At what input frequency of u(t) will the stress have the greatest amplification?(4%) ≈ 30 ๐๐๐ ๐ What is the amplification at this frequency? (4%) 200 dB, gain = 10200⁄20 = 1010 If ๐ข(๐ก) = 0.1 sin(50๐ก), what will be the amplitude and frequency of p(t)? (8%) amplitude = 0.1*1010 = 109 , frequency = 50 rad/s Bode Diagram Magnitude (dB) 200 190 180 170 160 Phase (deg) 150 180 135 90 45 0 10 1 10 2 Frequency (rad/s) (g) (5%) Suppose the PSD of u(t), ๐บ๐ข๐ข (๐), is a zero-mean-band-limited white noise with magnitude A for 0 ≤ ๐ ≤ 100 โ๐ง. If the mean square value is ฬ ฬ ฬ ๐ข2 = 0.04, what is A? Draw a sketch of ๐บ๐ข๐ข (๐). 100A=0.04 Thus, A = 0.0004 Guu(f) A 0 100 f, hz (h) (10%) Suppose we want to generate values of u(kH) corresponding to the PSD in (g) to be used for the input to the differential equation in a simulation to get values of ๐(๐๐ป). Suggest and justify values for H and N where N is the number of values of ๐ข(๐๐ป) to be 1 generated for the simulation. Recall, 2๐ป is the maximum frequency in hz that will be generated and NH will be the total simulation time. 1 ๐ก๐ ๐๐๐๐๐ข๐๐ ๐๐๐ ๐๐๐๐ข๐ก ๐๐๐๐๐ข๐๐๐๐๐๐ , ≥ 100 ๐โ๐ข๐ , ๐ป ≤ 0.005 ๐ 2๐ป 1 But, to be more conservative, it is recommended that ๐ป ≤ 10∗100 = 0.001 1 ๐ก๐ ๐ ๐๐ก๐๐ ๐๐ฆ ๐กโ๐ ๐๐๐๐๐๐ฃ๐๐๐ข๐ ๐๐๐๐ข๐๐๐๐๐๐๐ก๐ , ๐ป≤ = 0.003269 10√936 So, H = 0.001 satisfies both requirements. The time required for a simulation to reach the stationary portion of p(t) is about 5*(1/6) = 0.83 s. So, the simulation should last at least 2 s which means N > 2/0.001 = 2000. But N must be a power of 2; so, N = 2048 or 4096, etc. 2. A cannon ball is fired at an angle as shown below. The ball exits the cannon with a velocity ๐(0− ) = √1002 + 1202 = 156.2 m/s. The differential equation for the vertical displacement can be shown to be ๐ฆฬ + 0.005๐๐ฆฬ ≈ −10 ๐ฆ(0− ) = 2 ๐ ๐ฆฬ (0− ) = 100 ๐/๐ and the differential equation for the horizontal displacement can be shown to be ๐คฬ + 0.005๐๐คฬ = 0 ๐ค(0− ) = 0 ๐ ๐คฬ (0− ) = 120 ๐/๐ 405 where the velocity V of the ball is ๐ = √๐ฆฬ 2 + ๐คฬ 2 (a) (12%) Define state variables xi and write the ๐ฅฬ ๐ equations for an ode45 numerical simulation to get plots of y(t) and w(t). x1 = y x2 = ๐ฆฬ x3=w x4 = ๐คฬ ๐ = √๐ฅ22 + ๐ฅ42 ๐ฅฬ 1 = ๐ฅ2 ๐ฅฬ 2 = −10 − 0.005๐๐ฅ2 ๐ฅฬ 3 = ๐ฅ4 ๐ฅฬ 4 = −0.005๐๐ฅ4 (b)(13%) Complete the MATLAB code below for an ode45 simulation of these equations. [t,x]=ode45(@eqns,[0 10],[ 2 100 0 120]); y= x(:,1); w= x(:,3); plot(t , w , ’r’ , t , y , ’k:’ ) % plot y(t) and w(t) xlabel( ‘ time, s’ ) ylabel( ‘ displacements, m’ ) legend(‘w(t)’,’y(t)’) function dx=eqns(t,x) dx = zeros( 4 , 1); V = sqrt(x(2)^2+x(4)^2); dx(1) = x(2); dx(2)= -10 - 0.005*V*x(2); dx(3) = x(4); dx(4) = -0.005*V*x(4); end (c)(3%) Draw a sketch of what you think the plot of y(t) v. w(t) will look like. y(t) 2 0 w(t) 406 Exam #1 MAE 3360 Oct 8, 2020 1. The 2-mass system shown below with force input Fi is defined by the following two simultaneous equations shown below. ๐๐ฒฬ + ๐๐๐ฒฬ + ๐๐๐๐ฒ = ๐๐๐ณ + ๐๐ณฬ ๐๐′๐ฌ: ๐ฒ(๐− ) = ๐ ๐ฒฬ (๐− ) = ๐ ๐๐๐ณฬ + ๐๐ณฬ + ๐๐๐ณ = ๐๐๐ฒ + ๐๐ฒฬ + ๐ ๐ข ๐๐′๐ฌ: ๐ณ(๐− ) = ๐ ๐ณฬ (๐− ) = ๐ y z force input Fi (a) (2%) What does it mean for the two equations to be ‘simultaneous’? ______________________________________________________________ (b) (2%) What are the unknown variables in these equations? ____________ (c) (2%) Are the equations algebraic or differential? ________ (d) (2%) How many state variables are needed to simulate this system? ______ (e) (2%) Is the system linear or nonlinear? __________ (f) (6%) If the input Fi is a constant equal to 90, solve for the final values of z and y? z final = ____________ y final = _____________ Equations: Final Value Theorem: sF(s)s=0 Initial Value Theorem: sF(s)s=∞ ๐ ๐ ๐(๐) ≈ ๐(๐๐ ) + [ ] (๐ − ๐๐ ) ๐ ๐ ๐๐ ๐ณ{๐(๐)} = ๐(๐) ๐ณ{๐ฬ (๐)} = ๐๐(๐) − ๐(๐− ) ๐ณ{๐ฬ (๐)} = ๐๐ ๐(๐) − ๐๐(๐− ) − ๐ฬ (๐− ) 2. (a) (4%) What are the MATLAB commands for entering the following transfer function into MATLAB? Y(s) = G(s) U(s) where 407 ๐๐๐ + ๐๐ ๐ฎ= ๐ ๐๐ + ๐๐๐ + ๐๐๐๐ + ๐๐๐ + ๐๐ (b) (2%) What is the DC gain of this transfer function? _______________ (c) (2%) What is the meaning of the DC gain? ________________________________ ______________________________________________ 3. (6%) Get the coefficient in front of ๐ฏฬ equal to 1 and then express the following differential equation in state variable format for an ode45 simulation; don’t forget, there can’t be an input derivative in the ๐ฑฬ equations. The input is u(t) = 4. Determine the initial conditions for the state variables. ๐๐ฏฬ + ๐๐ฏฬ + ๐๐๐ฏ = ๐๐๐ฎ + ๐๐ฎฬ ๐ฏ(๐− ) = ๐ ๐ฏฬ (๐− ) = ๐. ๐ ๐ฎ(๐− ) = ๐ ๐ฑ ๐ = _____ ๐ฑ ๐ = _____ ๐ฑฬ ๐ = ____ ๐ฑฬ ๐ = ________ ๐ฑ ๐ (๐− ) = ____ ๐ฑ ๐ (๐− ) = __ 4. The following differential equation has been expressed in state variable format ๐ฬ + ๐๐ฬ + ๐๐๐ = ๐ ๐(๐ − ) = ๐ ๐ฬ (๐− ) = ๐ 408 ๐๐ = ๐ ๐๐ = ๐ฬ ๐ฬ ๐ = ๐๐ ๐ฬ ๐ = −๐๐๐๐ − ๐๐๐ The following ode45 file has been written to simulate, solve, and plot an output-of-interest for this differential equation. Note, an output-of-interest is any variable that we want plotted. function testproblem [t,x]=ode45(@eqns,[0 3],[3 1]); plot(t,x(:,1)) xlabel('time, s') ylabel('output of interest') grid function dx = eqns(t,x) dx = zeros(2,1); dx(1) = x(2); dx(2) = - 36*x(1) - 2*x(2); end end (6%) Draw an estimate of the plot that will be generated using this MATLAB code; be sure to label the axes. Be specific: put numbers on the axes for (a) initial and final values (b) approximate time to final value (c) estimate the degree of oscillation if any using the damping ratio. 5. Consider the following differential equation for y with input u: ๐๐ฬ + ๐๐๐ฬ + ๐๐๐ = ๐๐๐ฬ + ๐๐๐ 409 (a) (4%) What is the characteristic polynomial for this differential equation?___________ (b) (4%) What are the eigenvalues? ______________________ (c) (2%) What is the undamped natural frequency? ____ (d) (2%) What is the damping ratio? ____ (e) (2%) What is the time constant? ______ 410 6. The schematic of a spring and mass system is shown below. z u The displacement of the mass at the top end of the spring is z and the input displacement at the bottom of the spring is u. The equations for this system are as follows: (๐) ๐๐๐ณฬ + ๐ ๐ฌ = ๐ (๐) ๐ ๐ฌ = ๐๐๐๐(๐ณ − ๐ฎ) (a) ((4%) What are the unknowns? ____________ (b) (8%) Find the transfer function for Fs. That is, ๐ฎ(๐) = ๐ต(๐) ๐ซ(๐) N(s) = _____________ ๐ ๐ฌ (๐ฌ) = ๐(๐ฌ)๐(๐ฌ) D(s) = ______________ 411 7. The schematic of a spring-mass-damper system is shown below. z u The displacement of the mass is z and the input displacement is u. The Laplace transform for Z(s) is ๐๐๐ฌ + ๐๐๐ ๐(๐ฌ) = [ ๐ ] ๐(๐ฌ) ๐๐ฌ + ๐๐๐ฌ + ๐๐ (a) (4%) Assume the input is a step with magnitude of 4 at t = 0. What is the equation for Z(s) after inserting the U(s) for the step input? ๐(๐ฌ) = ๐(๐ฌ) ๐(๐ฌ) N(s) = _________________ D(s) = __________________ (b) (8%) Use the residue theorem to find the inverse Laplace transform of Z(s) to get an equation for z(t). ๐(๐) = ___________________________________ (c) (2%) Substitute t = ∞ into your equation for z(t) found in (b). ๐(๐)๐=∞ =______________ (d) (2%) Does your z(t) with t = ∞ give the same answer as the final value theorem? ___________ 8. The schematic of a spring-mass-damper system is shown below. 412 z u The displacement of the mass is z and the input displacement u(t) = 4sin(10t). The Laplace transform of u(t) is ๐ผ(๐) = ๐ ๐(๐ ) = [ ๐๐ ๐๐ + ๐๐๐ 10๐ + 200 ] ๐(๐ ) 5๐ 2 + 35๐ + 50 (a) (8%) What are the MATLAB commands for generating a plot of z(t) using the command impulse? (b) (2%) Explain why this provides the plot of z(t) without having to find the inverse Laplace of Z(s). 9. The schematic of a suspension system is shown below. At time t = 0, the mass is setting at rest on the spring and damper. At time t = 0, someone strikes the 413 top of the mass with a hammer producing the input force F(t) shown below causing the mass to move with displacement z(t) which is positive down. (a) (6%) Considering the initial and final values of z as determined by the equations below, estimate a plot of the resulting z(t) on the graph shown below. Hint: What is F for t → ∞? F F(t) (hammer strike) 0 t z 0 Time t z(t) ๐๐๐ฬ + ๐ญ๐ + ๐ญ๐ − ๐ญ − ๐๐ = ๐ ๐(๐− ) = ๐ ๐ฬ (๐− ) = ๐ Force balance on mass ๐ญ๐ = ๐๐๐ฬ damper force ๐ ๐ญ๐ = ๐๐๐ spring force (b) (8%) Draw a sketch of z3 v. z and then obtain an appropriate straight-line approximation for z3 to use for z3 in the equation for Fs. z3 0 z 414 Exam #2 MAE 3360 Nov. 24, 2020 1. Consider the following differential equation with input r(t): ๐ฆฬ + 4๐ฆฬ + 25๐ฆ = 50๐ (a) (5%) What is the transfer function for y? transfer function = r(t) (b) (4%) What is R(s)? ___________ 2 1 0 t ∞ Note, ๐ (๐ ) = ∫0 ๐(๐ก)๐ −๐ ๐ก ๐๐ก (c) (7%) What are the MATLAB commands for getting a plot of y(t) using the impulse command? 2. (7%) Consider the following differential equation with input r(t) and zero initial conditions: 415 ๐ฆฬ + 2๐ฆ = 10๐ ๐(๐ก) = 0.5๐ ๐๐(2๐ก) ๐ (๐ ) = 0.5 2 ๐ 2 + 4 What is the equation for y(t) for t > 3 s? ๐ −๐๐ก ๐(๐ ) ๐(๐ ) ๐ ๐๐ [๐๐ก + ๐๐๐๐๐ ( | | ) ] ๐ ๐ท(๐ ) ๐ =−๐+๐๐ ๐ท(๐ ) ๐ =−๐+๐๐ 3. Consider the following differential equation with input r(t). 2๐ฆฬ + 4๐ฆ = 8๐ฬ + 12๐ ๐ฆ(0− ) = 1 r(t) 3 416 (a) (7%) Solve for the Laplace transform of y(t), Y(s). ๐ฟ{๐ฬ (๐ก)} = ๐ ๐น(๐ ) − ๐(0− ) 0 t (b) (5%) Apply the final value theorem. Does it give the correct final value? FVT: sF(s)s=0 (c) (5%) Apply the initial value theorem. Explain why it doesn’t give a number that agrees with the initial value, y(0-) = 1. IVT: ๐ ๐น(๐ )๐ =∞ 4. (8%) Use the residue theorem to solve for w(t) if ๐ค(๐ ) = [ the FVT and the IVT to check your answer. [(๐ + 12๐ +18 ]. ๐ (2๐ +4) ๐)๐น(๐ )๐ ๐ ๐ก ]๐ =−๐ Use 417 5. Assume the eigenvalues for a system are −3 ± ๐4 ๐๐๐ − 10 ± ๐√300. The PSD of a stochastic input u(t) to a system is shown below. u(t) is to be generated using the MATLAB function SochInput.m. ๐บ๐ข๐ข (๐) 10 4 0 2 Freq. increment โ๐ = 10 1 ๐๐ป max freq. = f, hz 1 2๐ป Total time = NH 1 10๐ (a) (3%) Based on the eigenvalues, the time increment H should be less than or equal to what value when generating u(t)? ______________ 418 Be sure to explain your answer showing all calculations. (b) (3%) Based on the input PSD, the time increment H should be less than or equal to what value when generating u(t)? ___________ Be sure to explain your answer and show all calculations. (c) (3%) Realizing that the number of data points to be generated for the stochastic input u(t) must be a power of 2, what is the smallest value of N that should be considered in order to observe and evaluate the stationary response of this system due to the input u(t)? _________ Be sure to explain your answer and show all calculations. (d) (2%) Realizing that 1/(NH) will be the frequency increment, โ๐, how many points between 2 and 10 hz (frequency range shown on PSD plot) will be generated using your N and H? _____ 419 (e) (2%) Is the answer in (d) enough points for an accurate representation of the PSD when generating u(t)? ______ Why? (f) (3%) Based on the plot of the PSD, what is the mean square value of u(t)? ______________ (g) (3%) Based on the plot of the PSD, what is the mean value of u(t)? ___________ 6. A very hot steel ball is placed in a pan of cold water. The equations that define the thermal dynamics of this system are shown below. q is the heat transfer rate from the ball at temperature TB to the water at temperature TW. Note, this is an initial condition response problem since there is no input. −10−3 ๐ = ๐ฬ๐ต 10−4 ๐ = ๐ฬ๐ ๐๐ต (0− ) = 60 ๐๐ (0− ) = 5 ๐๐ต − ๐๐ = ๐ (a) (12%) Express these equations in state variable format assuming q is the output of interest, i.e. ๐ฬ = ๐ด๐ ๐ฆ = ๐ถ๐ ๐ด =? ๐ถ =? 420 (b) (4%) What are the initial conditions for the state variables? ๐ฅ1 (0− ) = ๐ฅ2 (0− ) = 7. The schematic of a suspension system is shown below. The road profile u(t) is the input. (8%) Define state variables for this system; you do not need to write the state variable derivative equations. x1 = x2 = x3 = x4 = (5%) Assume the output of interest y is the acceleration ๐คฬ . In terms of your state variable definitions above, what are C and D if the output of interest is y = CX + Du ? C= D= 421 (4%) Assume the system is initially at rest. If u(t) is a step input at t = 0, draw an estimate of the decrease in gap size y(t) = v(t) – w(t) as a function of time. y(t) 0 t 422 Exam 1 MAE 3360 March 2, 2021 1. The initial height H of the water in a tank is defined by the equations shown below. At time = 0, water starts flowing out of the tank through a hole in the bottom. H(t) H 0 time Q (๐) ๐๐๐ฏฬ = −๐ธ ๐ฏ(๐− ) = ๐ ๐ (๐) ๐ธ = ๐√๐ฏ ๐๐ /๐ (a) (2%) What are the unknowns in the equations? _______ (b) (4%) On the graph above, estimate a plot of the height H(t) of the water as a function of time. (c) (2%) What is the order of this system? ________ (d) (2%) Is the system linear or nonlinear? ________ (e) (4%) Using Euler’s integration with a time increment of 0.1 seconds, determine H at time t = 0.1 seconds, i.e. H(0.1) = ? 4.0__ 3.99___ 3.98___ 3.97___ 3.96___ 3.95___ 3.94___ 3.93___ 3.92___ 3.91___ (f) (5%) Using separation of variables, determine the solution H(t) to these equations for t ≥ 0 and for H(t) ≥ 0. H(t)=? (2−0.5t)2___ (2−0.1t)2___ (2−0.2t)2___ (4−0.1t) ___ (4−0.2t)___ 4(1−0.1t)2___ 423 (g) (2%) Using your solution in (f), does H(t) give the correct value at t=0? (h) (4%) Using your separation of variables solution in (f), what is H(t) at t = 0.1 s? 3.99__ 3.98__ (1.99)2__ (1.98)2__ (1.97)2___ (1.96)2___ (1.95)2___ (1.94)2___ 2. At time t =0 the height H of water in a tank is 4 m. At t=0 water starts flowing into the tank at a constant rate of 6 m3/s and flowing out with a flow rate of Qo. The equations for this system are (1) 10๐ปฬ = 6 − ๐๐ ๐ป(0− ) = 4 (2) ๐๐ = 2√๐ป 10 m3/s H(t) H 0 time (a) (5%) The height of the water in the tank will eventually reach a constant level (final value); what is this constant level? H(∞) = 1__ 2__ 3__ 5__ 6__ 7__ 8__ 9___ 10___ (b) (3%) On the graph above, draw a sketch of an estimate of H(t) for ๐ก ≥ 0. (b) (5%) If the final value of H(t) was 16 (it’s not), what would be a good straight-line approximation for √๐ป? That is √๐ป ≈? 1 12 ๐ป+ _____ 7 7 1 10 ๐ป+ _____ 7 7 1 4 ๐ป + _____ 6 3 1 6 ๐ป + _____ 5 5 424 3. At time t =0 the height H of water in a tank is 4 m. At t=0 water starts flowing into the tank at a constant rate of Qi(s) = 2 m3/s and flowing out with a flow rate of Qo. The equations for this system are (1) 10๐ปฬ = ๐๐ − ๐๐ ๐ป(0− ) = 4 (2) ๐๐ = 0.2๐ป 2 m3/s H(t) H 0 time (a) (3%) Draw an estimate of H(t) on the graph above. (b) (7%) Laplace transform the equations and solve for H(s). 42 _____ 10๐ + 0.2 0.4๐ + 0.2 _____ ๐ (๐ + 0.02) 4๐ + 0.2 _____ ๐ (๐ + 0.02) 6 _____ 10๐ + 0.2) (c) (5%) Use the final value theorem on your answer to part (a) as a check to see if your answer in (a) is correct. lim ๐ป(๐ก) = lim ๐ ๐ป(๐ ) ๐ก→∞ If ๐ =0 ๐ณ{๐(๐ก)} โ ๐น(๐ ) then ๐ฟ{๐ฬ (๐ก)} = ๐ ๐น(๐ ) − ๐(0− ) 425 4. A mass is placed on a platform supported by a spring. The equations for the system are listed below. mass time 0 y y ๐ฐ๐ช′ ๐: ๐๐ฬ + ๐ญ๐ + ๐ญ๐ = ๐๐ ๐(๐− ) = ๐ ๐ ๐ญ๐ = ๐. ๐๐ฬ ๐ญ๐ = ๐๐๐๐ ๐ฬ (๐− ) = ๐๐/๐ ๐ ๐๐๐๐๐๐ ๐๐๐๐๐ ๐๐๐๐๐๐ ๐๐๐๐๐ (a) (3%) Determine the damping ratio of this system. 0.1 ___ 0.02___ 0.50___ 0.8___ 1.0___ 1.5____ −0.1___ −0.5____ −0.02___ (b) (3%) What is the time constant of this system in seconds? 2____ 0.2____ 0.5____ 5____ 10_____ 25_____ (c) (4%) Considering the initial and final values, the damping ratio ๐น, the damped natural frequency ๐๐ and the time constant ๐, on the graph above, draw an estimate of y(t). Equations: ๐๐ + ๐๐น๐๐ ๐ + ๐๐๐ = (๐ + ๐น๐๐ + ๐๐๐ )(๐ + ๐น๐๐ − ๐๐๐ ) ๐๐ = ๐๐ √๐ − ๐น๐ ๐ ๐ = ๐น๐ ๐ 426 ๐๐๐+๐๐๐ 5. (5%) For ๐(๐) = ๐(๐๐๐ +๐๐๐+๐๐) , which of the following inverse Laplace transforms qualify for y(t)? Note: sin(−0.9273) = −0.8 and ๐ฅ๐ข๐ฆ ๐(๐) = ๐ฅ๐ข๐ฆ ๐๐ญ(๐) + ๐=∞ ๐ ←๐ ๐ + ๐. ๐๐−๐๐ ๐๐๐(๐๐ − ๐. ๐๐๐๐)____ ๐ + ๐. ๐๐−๐๐ ๐๐๐(๐๐ − ๐. ๐๐๐๐)____ ๐ + ๐. ๐๐−๐๐ ๐๐๐(๐๐ − ๐. ๐๐๐๐)____ ๐ + ๐. ๐๐−๐๐ ๐๐๐(๐๐ − ๐. ๐๐๐๐)____ ๐. ๐๐−๐๐ ๐๐๐(๐๐ − ๐. ๐๐๐๐)____ For ๐. ๐๐−๐๐ ๐๐๐(๐๐ − ๐. ๐๐๐๐)____ −๐ ± ๐๐, sum of residues equals ๐ −๐๐ก ๐ ๐๐ ๐๐(๐๐ก + ๐) 427 6. The ball with radius r shown below rolls without slip up and down the inner walls of a stationary barrel with radius R. The equations for the angular position of the ball ๐ฝ are ๐ฝฬ + ๐. ๐๐ฝฬ + ๐๐๐๐๐ฝ = ๐ ๐ฐ๐ช′ ๐: ๐ฝ(๐− ) = ๐. ๐๐๐๐ . (≈ ๐๐๐ ๐๐. ) ๐ฝฬ(๐− ) = ๐ ๐๐๐ ./๐ ๐ r R (a) (8%) The differential equation for ๐ฝ is 2nd order and thus, for a numerical simulation, two first order state variable differential equations for the derivatives of the state variables will be required in terms of the two state variables ๐๐ and ๐๐ , i.e. ๐ฑ๐ =? _______ ๐ฑ๐ =? _______ ๐ฑ๐ (๐− ) =? ________ ๐ฑ๐ (๐− ) =? ________ ๐ฑฬ ๐ = ๐๐ฎ๐ง๐๐ญ๐ข๐จ๐ง ๐จ๐ ๐ฑ๐ & ๐ฑ๐ =? ______________ ๐ฑฬ ๐ = ๐๐ฎ๐ง๐๐ญ๐ข๐จ๐ง ๐จ๐ ๐ฑ๐ & ๐ฑ๐ =? ________________________ (b) Complete the ode45 MATLAB code below for simulating this system. (1) (4%) [t,x]=ode45(@eqns,[0 50], [ ? (2) (6%) function dx = eqns(t,x) dx = zeros(? , 1); dx(1) = ? dx(2) = ? end ?]) ____ _____ _______________ ________________ ________________ 428 7. (5%) Use the residue theorem to express the following Laplace transform in partial fraction format. ๐๐๐ฌ๐ + ๐๐๐๐ฌ + ๐๐๐ ๐ฌ(๐๐ฌ + ๐)(๐ฌ + ๐๐) 5 10 2 + + ______ ๐ ๐ + 10 ๐ + 2 10 5 2 + + ______ ๐ ๐ + 10 ๐ + 2 5 2 10 + + ______ ๐ ๐ + 10 ๐ + 2 2 10 5 + + ______ ๐ ๐ + 10 ๐ + 2 5 10 5 + + ______ ๐ ๐ + 10 ๐ + 2 The residue for a 1st order pole -p of Y(s) is (s+p)Y(s)s = -p 429 8. (a) (3%) y(t) is shown on the graph to the right. What is the Laplace transform Y(s) = ? y(t) ๐ ๐ ____ ๐ ๐+๐ ____ ๐ ๐+๐ ___ 2___ ๐ ๐ ____ 1___ ๐ ๐+๐ ๐−๐๐ ____ 2 1 0 t (b) (3%) z(t) is shown in the graph to the right. What is the Laplace transform Z(s) = ? z(t) ๐ ____ ๐ ๐ ๐+๐ ____ ๐ ๐+๐ ___ 2___ ๐ ๐ ____ 1___ ๐ ๐+๐ ๐−๐๐ ____ ๐๐น(๐) 0 (c) (3%) ๐(๐) = ๐๐−๐๐ ๐ ๐ ____ ๐ ๐+๐ ____ ๐ ๐+๐ t V(s) = ? ___ 2___ ๐ ๐ ____ 1___ ๐ ๐+๐ ๐−๐๐ ____ ∞ ๐ฟ{๐(๐ก)} = ∫ ๐(๐ก)๐ −๐ ๐ก ๐๐ก 0 430 Exam #2 MAE3360 April 27, 2021 1. The barrier design specifications are to stop a car with a maximum deceleration not greater than 4 g’s while avoiding a total collapse of the barrier (D=10 m). If the barrier totally collapses before the forward velocity goes to zero, there will likely be very high g’s and damage to the car. Obviously, the possibility of satisfying the design specifications depends on the size and speed of the car. y D K b Impact Barrier System The differential equation for the displacement of the car y(t) if y(0-) is zero at the position of the car when it hits the bumper is shown below for ๐(๐) < ๐๐ & ๐ฬ (๐) > ๐ ๐๐๐๐๐ฒฬ + ๐๐, ๐๐๐๐ฒฬ + ๐๐๐, ๐๐๐๐ฒ = ๐ ๐(๐− ) = ๐ ๐ฬ (๐− ) = ๐๐ (10%) What is the Laplace transform for ๐ฬ (๐)? 30 30๐ 30๐ 2 30 (๐) 2 (๐) 2 (๐) 2 (๐) ๐ + 30๐ + 900 ๐ + 30๐ + 900 ๐ + 30๐ + 900 ๐ (๐ 2 + 30๐ + 900) 431 2. A pile driver is used to drive the pile shown below into the ground. The input is the pounding force F on the top of the pile. The frequency response for the transfer function for the force f at the ground is shown below. F M /2 z 2K b Bode Diagram 20 M 10 w M /2 Magnitude (dB) 0 K -10 -20 -30 -40 -50 0 -45 b -90 Phase (deg) 2K -135 -180 -225 -270 -315 1 10 f 2 3 10 10 Frequency (rad/s) (10%) If the pounding force is a sine wave with amplitude of 1000 N, what is the largest possible peak amplitude of the ground force? ________ (a) 1000 N (b) 20,000 N (c) 10,000 N (d) 100 N (e) 2000 N (f) 200,000 N 432 3. The forward moving mass contacts the bumper compressing water in the cylinder and forcing water out through the orifice. Denote the pressure in the cylinder by Pc and the displacement of the mass by y; y(0-)=0 and ๐ฬ (๐− ) = ๐ฝ๐. Q do Initial Velocity Vo M D L The equations for this system assuming the mass is in contact with the bumper at t=0 are: ๐ ๐ธ = ๐ช๐ ๐จ๐ √ ๐ท๐ ๐ท๐ ≥ ๐ ๐ ๐จ(๐ณ − ๐) ๐ทฬ๐ ๐๐ (๐− ) = ๐ ๐ท๐ ๐ด๐ฬ + ๐จ๐ท๐ = ๐ ๐ฒ(๐− ) = ๐ ๐ฒฬ (๐− ) = ๐ −๐ธ + ๐จ๐ฬ = (1) (3%) This system of equations is linear ______ or nonlinear. _______ (2) (8%) What are the state variables for an ode45 simulation? _________ (๐) ๐, ๐ท๐ , ๐ธ (๐) ๐, ๐ธ, ๐ทฬ๐ (๐) ๐, ๐ฬ , ๐ฬ (๐ ) ๐ฬ , ๐ท๐ , ๐ธ (๐) ๐, ๐ฬ , ๐ท๐ (๐) ๐, ๐ฬ , ๐ท๐ , ๐ธ 433 4. A hot steel ball with initial temperature 100 โ is placed in a large pan of cold water with a temperature Tw that remains approximately constant at 20 โ. A simple model for the thermodynamics in terms of the heat transfer q in J/s from the ball to the water is given below. q −๐ = ๐๐๐๐ปฬ๐ ๐๐(๐ป๐ − ๐ป๐ ) = ๐ (1) (5%) What will be the final temperature of the ball? _____ (a) 100 โ (b) 120 โ (c) 20 โ (d) 60 โ (e) 25 โ (2) (5%) Approximately how long will it take for the ball temperature to become constant? ______ (a) 100 s (b) 500 s (c) 25 s (d) 20 s (e) 1000 s 434 5. (8%) Consider the following differential equation for z(t) with input u(t). Assuming the output of interest is ๐ = ๐ − ๐ , which set of matrices are valid for the state variable equations? ๐ฟฬ = ๐จ๐ฟ + ๐ฉ๐ ๐ = ๐ช๐ฟ + ๐ซ๐ ๐๐๐ฬ + ๐๐๐ฬ + ๐๐๐ = ๐๐๐ฬ + ๐๐๐ (๐) ๐ ๐จ=[ −๐ (๐) ๐จ=[ (๐) (๐ ) (๐) (๐) ๐ ] −๐ ๐ฉ=[ ๐ ๐ ] −๐ −๐ ๐ ๐จ=[ −๐ ๐ ๐จ=[ −๐ ๐จ=[ ๐ ] −๐ ๐ ] −๐ ๐ ๐ ] −๐๐ −๐๐ ๐ ๐จ=[ −๐๐ ๐ ] −๐๐ ๐ ] −๐๐ ๐ ๐ฉ=[ ] ๐ ๐ฉ=[ ๐ ] −๐๐ ๐ ๐ฉ=[ ] ๐ ๐ ๐ฉ=[ ] ๐ ๐ฉ=[ ๐ ] −๐๐ ๐ช = [−๐ ๐ช = [๐ ๐] ๐ซ = [๐] ๐] ๐ซ = [๐] ๐ช = [๐ ๐] ๐ช = [−๐ ๐ซ = [−๐] ๐] ๐ช = [๐๐ ๐ช = [−๐ ๐ซ = [๐] ๐๐] ๐] ๐ซ = [๐] ๐ซ = [๐] 435 6. (8%) The PSD of a stochastic process y(t) is shown below. Plots for estimates of y(t) are shown in the 2nd figure. Which plot in the 2nd figure most likely corresponds to the PSD? ________ Gyy(f) 9๐ฟ(๐) 9๐ฟ(๐ − 1) 0 1 frequency f, hz 8 a b c d e 6 4 y(t) 2 0 -2 -4 -6 0 0.2 0.4 0.6 0.8 1 Time, s 1.2 1.4 1.6 1.8 2 7. (8%) A random process x has a uniform probability density function between 0 and 100. What is the probability that a sample of x is some value between 40 and 60? ______ (a) 10% (b) 20% (c) 40% (d) 60% (e) 80% (f) 90% 8. (8%) A band limited white noise has a single sided PSD of 100 over the frequency range of 1 to 26 hz. What is the standard deviation of this stochastic process? (a) 2500 (b) 5 (c) 25 (d) 50 (e) 100 (f) 10 436 9. (10%) Which of the plots below is the solution to the following differential equation? Legend is hard to read. Mark correct plot with an arrow. ๐๐ฬ + ๐. ๐๐ฬ + ๐๐๐ = ๐๐ ๐(๐− ) = ๐ ๐ฬ (๐− ) = ๐ Impulse Response 3 2.5 Amplitude 2 1.5 1 (a) (b) (c) (d) (e) 0.5 0 0 0.5 1 1.5 2 2.5 3 3.5 4 Time (seconds) 10. (3%) A zero-order-hold is an algorithm for A/D conversion? True ___ 11. (3%) The inverse Z-transform of z-KX(z) is x(t – KT)? True _____ False _____ False _____ 437 12, (3%) The Laplace transform is used to convert linear and nonlinear differential equations into algebraic equations. True _______ False _________ 13. For days, the water flow into a tank has been constant. The differential equation for the height H of the water in the tank is ๐๐๐๐ฬ + ๐๐√๐ = ๐๐๐ H 4 3 16 9 H H H 3 9 H (1) (3%) After several days, what is the height of the water in the tank? ______ (a) 3 m (b) 9 m (c) 40 m (d) 120 m (e) 200 m (f) 5 m (2) (5%) Assume the level H has been constant for several days (part (1) above) when someone pours a cup of water into the tank. Approximately how long will it take for H(t) to return to the level prior to the additional cup of water? (a) 150 s (b) 3 s (c) 200 s (d) 30 s (e) 60 s (f) 1000 s 438