ME Homework #6 State Space Representation Last Updated September 6 6. From the homework problems on the following pages 5. 5. 5.6 5.7.
5.6 Chapter 5 Homework Problems 5.6. Simulation of Linear and Nonlinear Models (Sections 5.-5.4) 5. Consider an automobile travelling on level and sloped ground shown below. The automobile starts from rest on a horixontal path at x=. After travelling some distance it enters the slope inclined at the angle. After reaching the top of the slope it again travels on a horizontal path. Be aware that the coordinate x(t) represents the distance along the path. P 5. F x (x) x= a. Given that the automobile is driven forward by a force F that is always parallel to the ground show that a model for the automobile is F W sin ( x) cx mx where the damping coefficient c models the total frictional force on the automobile. In the model (x)= on the horizontal segments and (x)= is a constant on the slope. b. The weight of the automobile is lb the damping coefficient c is c=5 lbs/ft the inclination of the slope segment is = o and the force F is F=5 lb. Given that the slope begins at a distance of x= ft and ends at a distance of x=4 ft simulate the model over the time range t sec. You may assume that the automobile begins the simulation from rest. Plot the distance x and velocity x versus time. If the weight of the automobile is 5 lb and the damping coefficient is c= lbs/ft you should get the results shown in the code check shown on the following page.
Code Check for part b of Problem 5. Displacement (ft) 4 Path Displacement (ft) 5 5 Velocity 5 Velocity (Mph) 5 5 5
5. Consider again the example rotational system modelled in Section.4. The input is a specified rotational motion (t) of the left end of the flexible shaft of stiffness kt. a. Show that a simplified model of the system can be derived as I m r k x cx k r kt x ( ). r T t b. Given that m= kg I=kgm r= cm kt=5nm k=5 N/m and c= Ns/m simulate the system over the time range t5 sec using initial conditions of m and m/s. Over this time range the specified rotational motion will be (t)=45 o (.785 rad) for t5 sec and (t)=- o (.564 rad) for t> 5 sec. As a check on your code you should obtain the plot shown below when k= N/m and c= Ns/m. x( ) x( )
Code Check for part b of Problem 5... x (m). -. 4 5. xd (m/sec). -. -. 4 5 5. Consider the translational mechanical model shown at the right. The mass m is coupled to ground with the spring k and damper c and is coupled to mass m by the damper c. A specified force F(t) is applied to mass m. P 5. c k x=+ x m F(t) c x=+ m x a. Derive the equations of motion for the masses m and m. b. Place the model in general state space format.
c. Using k=5 kn/m c=5 Ns/m m=4 kg c=5 Ns/m m=kg and initial conditions of x()=. m x= m x () x () m/s simulate the system over the time range t sec with F(t)=. After your simulation plot the displacements x(t) and x(t) of the masses m and m versus time. As a code check with k= kn/m your results will look like the plots shown below. Code check for part c of Problem 5...5 x (m) -.5 -..5.5 x (m) -.5 -..5.5 d. Using the same parameters as in part c excepting initial conditions of x()=x()=m x ( ) x () and a specified force of F(t)=sin(t)N for t / sec F(t)=N for t>/ sec repeat the simulation. After your simulation plot the displacements x(t) and x(t) of the masses m and m versus time. e. Using the same parameters as in part c excepting initial conditions of x()=x()=m x ( ) x () and a specified force of F(t)=N for t / sec F(t)=-N for / t / sec. After your simulation plot the displacements x(t) and x(t) of the masses m and m versus time. 5.4 Consider the simulation of the circuit modeled in Section... It is shown in Figure.8. A model for the circuit (.6.7) was shown to be V V d V V V C L dt L V V dv L RL dt where V(t) was a specified applied voltage and V(t) V(t) were the voltages at the nodes shown in Figure.8. 4
a. Place the model in general state space format. b. Using L=.5mH L=.mH C=5F RL=8 simulate the circuit with V(t)= and initial conditions of V()=V V()=V and V/s over the time range t ms. After your simulation plot V(t) and V(t) versus time. To check your code when RL=6 your simulation should look like the plots shown below. Code check for part b of Problem 5.4 V () V (Volts).5 -.5-4 6 8 Time (ms) V (Volts).5 -.5-4 6 8 Time (ms) c. Using the same parameter values as in part b simulate the circuit using the initial conditions V()=V()=V V () V/s and a specified voltage of V(t)=V for t>. d. Using the same parameters as in part b simulate the circuit using the initial conditions V()=V V()=V and V () V/s and a specified voltage of V(t)=V for t 4ms and V(t)= elsewhere. After your simulation plot V(t) and V(t) versus time. 5.5 Consider the simulation of the electromechanical system modeled in Section.5.. The system is shown in Figure.. A model for this system was derived to be di V ( t) Ri L K b dt r r r Kti k T x Ia I I r r r r cx k r T r x r r m r I x 5
Code check for part b of Problem 5.5.5 x (m) (deg) i (Amps) 4 5 5 5 5 5 5.5 -.5 5 5 5 where V(t) was the specified voltage applied to the permanent magnet electric motor (t) was the angular displacement of the armature and x(t) was the displacement of the rack. a. Place the model in general state space format. b. Using R= Kt=.5 Nm/A Kb=.5 Vs L=mH Ia=.5kgm I=.75kgm I=.kgm I=.75kgm m=kg r=.5m r=.5m r=.m kt=5nm c=4ns/m and initial conditions of x()= m x( ) m/s ()=rad () rad/sec and i()=a simulate the system over the time range t sec. The voltage supplied to the motor is to be V(t)=V for t<s and V(t)= for t>s. After the simulation plot x(t) (t) and i(t) versus time. To check your code when r=.m your simulation should look like the plots shown on the next page. c. After your simulation from part b plot the internal force F(t) and the angular displacement (t) versus time. 6
5.6 Consider the simplified model of a vehicle bumper and seat-belted passenger shown at the right. The vehicle is modeled by the mass m the bumper is modeled by the spring k and damper c the occupant is modeled by the mass m and the seat belt is modeled by the spring k and damper c. Your objective is to simulate the collision of the car with the vertical wall. This is performed by assuming that the inertial displacements x and x are zero at the instant of impact. Assume that the speed of the P 5.4 x= + x vehicle is 6 mph to the left at the instant of collision. Note that the simulation will be valid if the displacement x remains such that -<x< ft. The car and occupant weigh lb and 5 lb respectively. a. Derive the equations of motion for m and m. b. Place the model in general state space format and ABCD state space format. For the ABCD format identify two {C} matrices one for an output y(t) defined as the relative distance between the car and occupant and the other for an output y(t) being the force of the seatbelt on the occupant. For this problem what is the input u(t) for the system? c. Specify the proper initial conditions that will simulate the collision of the car and occupant with the wall. d. Simulate the collision over a time interval of.5 sec. In your simulation plot the displacements x and x versus time the relative displacement y=x- x versus time and the force of the seatbelt on the occupant versus time. Include a printout of the Matlab code that you used for the simulation. For your simulation use the following parameter values: k=5 klb/ft c=5 lbs/ft k= klb/ft c= lbs/ft. To check your code a simulation using k= klb/ft c=5 lbs/ft k=5 klb/ft c=5 lbs/ft is shown below. c k foot t= m m x x= + c k 7
Code check for part d of Problem 5.6 Displacement (in) Displacement (in) Inertial Coordinates of Car and Occupant x x -....4.5 Relative Displacement Between Car and Occupant.5....4.5 Force of Seat-Belt on Occupant Max Force On Occupant=55.4997 lb Force (lb) 4 -....4.5 e. What is the maximum relative displacement between car and occupant and the maximum force exerted by the seat belt on the occupant? 5.7 Consider a mass-spring damper similar to that discussed in Section... Only now the spring will be nonlinear. In this case the model for the spring is F k kx x. This form of a spring is known as a softening spring. Given this model for the spring Newton s nd law for the mass-spring-damper becomes m x cx kx x F cos t 8
where m c k are the mass damping coefficient and stiffness and F are the amplitude and frequency of an applied harmonic force. The model for this mass-spring-damper is known as one version of a Duffing oscillator. a. Given that m= kg c= Ns/m k= N/m = N/m and F= N simulate the system over the time range t sec using initial conditions x( ). m and m/s. After your simulation plot and versus time t. As a code check when c=4 Ns/m you should obtain the result shown below. x( ) Code check for part a of Problem 5.??.5 x(t) Code Check: c=4 q ()=-. q ()= x(t) q -.5 - -.5 5 5 5 q - 5 5 5 b. Repeat part a only now use initial conditions of x( ) m and x ( ) 8 m/s and a time range of t.45 sec. What do you think will happen if the time range is extended past.45 sec? c. Now simulate the system over the same time range with F= N =5.4 rad/sec when t6 sec and F= N for t>6 sec and initial conditions of x( ) m and x ( ) m/s. 9
5.8 Consider the spring-loaded wheel described in Problem.. It was claimed in the problem statement that a model for the motion of the wheel could be derived as ( ) d l o T t c cos T kr I R d R / d R / dsin where T(t) is a specified torque applied to the wheel. a. Place the system model in general state space format. b. For R=.5m d=.5m I= kgm ct= Nms lo=.4 m k= N/m initial o conditions ( ) 7.59 () and T(t)=5 Nm for t<sec and T(t)= for t> sec simulate the system over the time range t sec. After your simulation plot the angular position and angular velocity of the wheel versus time. To check your code when k=5 N/m your code should provide a simulation like that shown below. Code check for part b of Problem 5.5 5 T=5 Nm for Sec Theta (deg) -5 ThetaDot (deg/sec) - 4 6 8 5-5 - 4 6 8 c. Repeat the preceding simulation only now with and T(t)= Nm for t<sec and T(t)= for t> sec.
5.9 A small gantry crane is used to P 5.9 move parts. A diagram of the x crane is shown at the right. The part of weight lb and mass m is suspended from the gantry by a cable of length l= ft. The horizontal displacement of the gantry is x and the angular rotation of the mass m relative to vertical is as shown. It is assumed that the mass of the gantry is negligible and the horizontal acceleration is specified. Using the methodology discussed in Section.5. to model the inverted pendulum the dynamic model for the angular movement of the mass m is I c mgl sin a( t) ml cos o T a( t) x where Io=ml is the moment of inertia of the mass about the pivot point on the gantry and ct= lbs models rotational friction of angular motion. a. An engineer wishes to move the part to the right. To achieve this motion the engineer specifies the following acceleration of the gantry a(t)=5 ft/s t< sec a(t)= ft/s t> sec. Simulate the angular movement of the mass m using initial conditions of zero angular displacement and velocity. Plot the angular displacement and angular velocity over the time range t sec for this maneuver. To check your code when the part m weighs lb your simulation should give the results shown??. b. At t= sec and t= sec how far has the gantry travelled and what is the velocity of the gantry? Hint: a simulation is not required you may use elementary kinematics to answer this question. c. Repeat part a with the acceleration at the start of the time interval only now include a deceleration a(t)=-5 ft/s in the interval 8.5<t<9.5 sec. And perform your simulation over the time range t5 sec. d. At t= sec and t=9.5 sec how far has the gantry travelled and what is the velocity of the gantry? Hint: a simulation is not required you may use elementary kinematics to answer this question.
5. Consider the moving-pivot inverted pendulum considered in Section.5.. A diagram of the moving-pivot inverted pendulum is shown in Figure.. In 4 6 8 Section.5. a model (.8.8) mgl sin c I m x T mxl cos O l sin l cos cx F( t) M x. was derived. In this model (t) was the angular displacement of the stick and x(t) was the horizontal displacement of the cart. A gneral state-space representation (4.4-4.44) for the moving-pivot inverted pendulum was derived in Section 4.. to be q q q q 4 q q ml cosq mgl sin q c q I mlq sin q cq F( t) 4 Ang Disp (deg) Ang Vel (deg/sec) Code check for part a of Problem 5.9 Gantry Pos (m) - 4 6 8 5 Accel Time= sec Accel Dist=.5 ft Vel After Accel=5 ft/sec -5 4 6 8 5 M mi ml M mmgl sin q c q ml cosq mlq sin q cq F( t) T 4 T o o M mi ml 4 o cos cos 4 q q 4. where the state assignments were q x q x q and q 4. Simulate the system over a time range of using parameter values of m= kg l= m ct=.5 Nms Io= kgm M=5 kg and c= Ns/m. For your simulation use initial conditions of t sec initial conditions of q()= m q()= m/s q()= rad q4()= rad/sec and a force F(t) on the cart as F(t)= t< sec F(t)= N
q 4 (deg/sec) q (deg) q (m/sec) q (m) F (N) t sec and F(t)= for t> sec. After your simiultion plot F(t) q(t) q(t) q(t) and q4(t) versus time. As a code check if l= m and M=7 kg you should obtain the results shown below. Code check for Problem 5. 5 4 6 8 4 6 8 5 4 6 8 4 6 8 4 - -4 4 6 8 4 6 8-4 6 8 4 6 8 5-5 4 6 8 4 6 8
5. Consider the two masses m P 5.7 and m coupled by the three Fy springs k k and k as Fy shown at the right. The k k k Fx Fx system is viewed from m above and the movement of m masses m and m as occurs on a frictionless horizontal plan. The specified forces Fx(t) Fy(t) and Fx(t) Fy(t) can act on the masses m and y m respectively. Part a y shows the system in the position of static equilibrium and part b x x shows the system when the masses have moved distances x y and x y from the position of static equilibrium. The forces exerted by the springs of stiffness k k and k exert forces on the masses m and m along the lines oriented by the angles and respectively measured counter-clockwise positive. It is assumed that the springs are neither extended or compressed when at the length x in the position of static equilibrium. A model for the system can be derived by writing Newton s second law for the translation of each mass in the x- and y-directions. The instantaneous lengths l l and l of the springs of stiffnesses k k and k are calculated to be l l x x y l x x x y y x x y. Then the scalar force Fk Fk and Fk exerted by the springs of stiffnesses k k and k are F k l x F k l x F k l. k k k x The forces Fk Fk and Fk act in the x and y directions oriented by the angles and respectively. From the geometry of part b of Figure 5.7 the cosine and sine of angles and are observed to be x x y cos sin l l x x cos l x x cos l x y sin y sin l. y l 4
x (m) y (m) x (m) y (m) Newton s second law for translation of each mass in the x- and y-directions are m x F m x k F k cos F cos F k cos k cos m y F m y k F sin F k sin F k sin k sin. a. Simulate the system with m=m=kg k=k=k=n/m x=.5m Fx(t)=Fy(t)=Fx(t)=Fy(t)= and initial conditions x()=x()=m x ( ) x () m/s y()=.m y()=-.5m y ( ) y () m/s over the time range t sec. After your simulation plot x(t) x(t) y(t) and y(t) versus time. To check your code when k=k=k=4n/m your plots should look like those shown below. Code check for part a of Problem 5.....5 -.5 -. Time (s). -. Time (s). -..5 -.5 -. Time (s) -. Time (s) b. Repeat part a only now use the initial condition x()=.m and the remaining initial displacements and velocities zero. c. Repeat part a only now use zero initial displacements and velocities Fy(t)=N for t sec Fy(t)= for t> and Fx(t)=Fx(t)=Fy(t)=. 5
5.6. Presentation of Simulation in Phase Plane (Sections 5.5-5.6) 5. Consider again the spring-loaded wheel considered in Problem 5.8 only now the applied torque T(t)=. Simulate the system 7 times using the initial conditions shown below. In the table the units on angular displacement and angular Simulation IC 4 5 6 7 8 9 () () - 4 6 8 - - - - - - - -8-6 Simulation IC 4 5 6 7 () () - -4-6 -8 - - - 8 6 velocity are radians and radians/sec respectively. Present the results of the simulations in the phase plane i.e. a plot with angular displacement on the horizontal axis and angular velocity on the vertical axis. You will find it useful to perform each simulation over the time range t sec. As a code check when k=5nm and I=.5kgm your plot should look like that shown on the next page. 6
Code check for Problem 5. 5 q (rad/sec) -5 - - -5 - -5 5 5 q (rad) 5. Consider again the mass-spring-damper from Problem 5.7 with the nonlinear spring with F=. Using the same parameters m= kg c= Ns/m k= N/m = N/m simulate the system 8 times using the initial conditions shown below. The table also contains a recommended end for the time range for each simulation. Simulation IC 4 5 6 7 8 9 4 x() -.5..7.4...4.5.7.8.5 4. 5. 5.7 x() -8-8 -8-8 -8-8 -8-8 -8-8 -8-8 -8-8 tend.5.6.8. 5 5 5..5.5.4..5.5 Simulation IC 5 6 7 8 9 4 5 6 7 8 x().5. -.7 -.4 -. -. -.4 -.5 -.7 -.8 -.5-4. -5. -5.7 x () 8 8 8 8 8 8 8 8 8 8 8 8 8 8 tend.5.6.8. 5 5 5..5.5.4..5.5 Present the simulations in the phase plane with x on the horizontal axis and x on the vertical axis. As a code check when c=4 Ns/m your results should look like the plot shown on the next page??. 7
Code check for Problem 5. Duffing Oscillator: m= c=4 k= ( =.6 =.6) =- n 8 6 4 q (deg/sec) - -4-6 -8-6 -4-4 6 q (deg) 8