Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326...

12
EGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical System Building on the dynamic model development from previous HW, the Simulink model is:

Transcript of Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326...

Page 1: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

ContinuingExercise1–Three-MassTranslationalMechanicalSystemBuilding on the dynamic model development from previous HW, the Simulink model is:

Page 2: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

Typical behavior is shown below. These plots show the natural response to all three masses having an initial displacement.

Natural Response of each Mass, Position and Velocity

Note that the problem asks you to analyze the natural response and forced response separately, by plotting first with the input but no initial conditions, and then with the initial conditions but no input.

Page 3: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

The next set of plots show the forced response when the system has a single input:

Forced Response of each Mass, Position and Velocity, with no initial stored energy (no initial displacement)

Observe that the response of the system – natural and forced, and therefore the complete response as well, is an oscillation within a decaying exponential. The eigenvalues and eigenvectors are shown in the next problem. The eigenvalues are seen to be in three sets of complex conjugate pairs, all of which have negative real part. Using information from this week in class: This confirms our observation of oscillations within the decaying exponential. The third set of eigenvalues, -0.1412 ± 2.6537i, is the dominant pair, with the largest value for the real part. This means the other two oscillations will decay away more quickly than this third mode, which defines the dominant behavior.

Page 4: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

% MSDdetail_HW7_script.m % script for text problem CE2.1 with 3 masses and 4 springs % % Author: J Cardell % Date: March 2017 % DEFINE CONSTANTS, INITIAL CONDITIONS and SYSTEM MATRICES % Constants / Parameters k1 = 10; % spring constant, N/m k2 = 20; k3 = 30; k4 = 40; c1 = 0.4; % damping coefficient, Ns/m c2 = 0.8; c3 = 1.2; c4 = 1.6; m1 = 1; % mass, kg m2 = 2; m3 = 3; %% Part (i)a - Zero Initial State % System inputs u1 = 0; u2 = 0; u3 = 0; % Initial conditions – variables used inside the ‘integrator’ blocks v1_0 = 0; % velocity initial conditions v2_0 = 0; v3_0 = 0; pos1_0 = 0.005; % displacement initial conditions pos2_0 = 0.010; pos3_0 = 0.015; % SIMULATE THE DYNAMIC SYSTEM % and use 'linmod2' to extract the system matrices sim('MSDdetail_HW7'); set_param('MSDdetail_HW7','StartTime','0','StopTime','25') % PLOT SYSTEM BEHAVIOR figure hold on % Define vectors to be used for output plot t = v1.time; pos1 = p1.signals.values; pos2 = p2.signals.values; pos3 = p3.signals.values; vel1 = v1.signals.values; vel2 = v2.signals.values; vel3 = v3.signals.values; % Create and label plot of system behavior subplot(3,2,1) plot(t, pos1, 'b-', 'LineWidth', 2) title('Position Mass 1 - Natural Response') xlabel('t (sec)'); ylabel('y (m)') subplot(3,2,2) plot(t, vel1, 'r-', 'LineWidth', 2) title('Velocity Mass 1') xlabel('t (sec)'); ylabel('y (m/s)') subplot(3,2,3) plot(t, pos1, 'b-', 'LineWidth', 2) title('Position Mass 2') xlabel('t (sec)'); ylabel('y (m)') ( …etc. to get remaining plots)

Page 5: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

Matrix Exponential for Time t = 10 seconds For determining the value of the state vector at time = 10 seconds, the Matlab script could include: % Question in CE2.1a - for i(b) only, check state vector values at t=10 % seconds using the matrix exponential disp('Matrix Exponential State vector at time t = 10 seconds, for problem CE2.1a i(b)') % The A matrix, multiplied by t (= 10 seconds) and then vector % multiplied by the initial conditions state vector. x10 = expm(10 * A) * [pos1_0; v1_0; pos2_0; v2_0; pos3_0; v3_0] OUTPUT: Matrix Exponential State vector at time t = 10 seconds, for problem CE2.1a i(b) x10 = 0.0006 -0.0073 0.0007 -0.0085 0.0005 -0.0053 This shows the position and velocity for each mass decaying away, and approaching steady-state, as is consistent with the plots for time t = 10 seconds. The specific ordering the state vector and the initial conditions is dependent upon how you define the state variables and order your state vector.

Page 6: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

Problem CE 2.1b The modal matrices from Matlab are: A (the system matrix) = 0 1.0000 0 0 0 0 -30.0000 -1.2000 20.0000 0.8000 0 0 0 0 0 1.0000 0 0 10.0000 0.4000 -25.0000 -1.0000 15.0000 0.6000 0 0 0 0 0 1.0000 0 0 10.0000 0.4000 -23.3333 -0.9333 M = (the modal matrix, with columns equal to the eigenvectors) -0.0152 - 0.1122i -0.0152 + 0.1122i -0.0160 - 0.1558i -0.0160 + 0.1558i -0.0112 - 0.2097i -0.0112 + 0.2097i 0.7605 0.7605 0.8010 0.8010 0.5581 + 0.0000i 0.5581 - 0.0000i 0.0115 + 0.0848i 0.0115 - 0.0848i -0.0031 - 0.0300i -0.0031 + 0.0300i -0.0128 - 0.2405i -0.0128 + 0.2405i -0.5748 -0.5748 0.1540 + 0.0000i 0.1540 - 0.0000i 0.6401 0.6401 -0.0053 - 0.0389i -0.0053 + 0.0389i 0.0109 + 0.1062i 0.0109 - 0.1062i -0.0079 - 0.1478i -0.0079 + 0.1478i 0.2639 + 0.0000i 0.2639 - 0.0000i -0.5458 + 0.0000i -0.5458 - 0.0000i 0.3934 + 0.0000i 0.3934 - 0.0000i eigVal = -0.9023 + 6.6560i 0 0 0 0 0 0 -0.9023 - 6.6560i 0 0 0 0 0 0 -0.5231 + 5.0873i 0 0 0 0 0 0 -0.5231 - 5.0873i 0 0 0 0 0 0 -0.1412 + 2.6537i 0 0 0 0 0 0 -0.1412 - 2.6537i B_hat = 0.2626 + 0.0356i -0.1985 - 0.0269i 0.0911 + 0.0124i 0.2626 - 0.0356i -0.1985 + 0.0269i 0.0911 - 0.0124i 0.2530 + 0.0260i 0.0486 + 0.0050i -0.1724 - 0.0177i 0.2530 - 0.0260i 0.0486 - 0.0050i -0.1724 + 0.0177i 0.1749 + 0.0093i 0.2006 + 0.0107i 0.1233 + 0.0066i 0.1749 - 0.0093i 0.2006 - 0.0107i 0.1233 - 0.0066i

Page 7: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

C_hat = -0.0152 - 0.1122i -0.0152 + 0.1122i -0.0160 - 0.1558i -0.0160 + 0.1558i -0.0112 - 0.2097i -0.0112 + 0.2097i 0.0115 + 0.0848i 0.0115 - 0.0848i -0.0031 - 0.0300i -0.0031 + 0.0300i -0.0128 - 0.2405i -0.0128 + 0.2405i -0.0053 - 0.0389i -0.0053 + 0.0389i 0.0109 + 0.1062i 0.0109 - 0.1062i -0.0079 - 0.1478i -0.0079 + 0.1478i So the dynamic system model in MODAL FORMAT is

z =

-0.9023 + 6.6560i 0 0 0 0 0 0 -0.9023 - 6.6560i 0 0 0 0 0 0 -0.5231 + 5.0873i 0 0 0 0 0 0 -0.5231 - 5.0873i 0 0 0 0 0 0 -0.1412 + 2.6537i 0 0 0 0 0 0 -0.1412 - 2.6537i

!

"

#########

$

%

&&&&&&&&&

z

+

0.2626 + 0.0356i - 0.1985 - 0.0269i 0.0911 + 0.0124i 0.2626 - 0.0356i - 0.1985 + 0.0269i 0.0911 - 0.0124i 0.2530 + 0.0260i 0.0486 + 0.0050i - 0.1724 - 0.0177i 0.2530 - 0.0260i 0.0486 - 0.0050i - 0.1724 + 0.0177i 0.1749 + 0.0093i 0.2006 + 0.0107i 0.1233 + 0.0066i 0.1749 - 0.0093i 0.2006 - 0.0107i 0.1233 - 0.0066i

!

"

#######

$

%

&&&&&&&

u

y =

-0.0152 - 0.1122i -0.0152 + 0.1122i -0.0160 - 0.1558i -0.0160 + 0.1558i -0.0112 - 0.2097i -0.0112 + 0.2097i 0.0115 + 0.0848i 0.0115 - 0.0848i -0.0031 - 0.0300i -0.0031 + 0.0300i -0.0128 - 0.2405i -0.0128 + 0.2405i -0.0053 - 0.0389i -0.0053 + 0.0389i 0.0109 + 0.1062i 0.0109 - 0.1062i -0.0079 - 0.1478i -0.0079 + 0.1478i

!

"

####

$

%

&&&&

z

+ [0]

DISCUSSION: As with the class examples, this system model has six modes of behavior (occurring in 3 conjugate pairs), each of which defines an independent dynamic subsystem, governed by one eigenvalue. The state vector moves in the vector space defined by the eigenvector basis set.

Page 8: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

RomeoandJuliet Zero-input response (natural response):

A = úû

ùêë

é- 0 1

1 1 , Initial conditions: x(0) = [0.1 0.1]

For this system matrix, you find the λ’s are a complex conjugate pair, and the eigenvectors are complex. The system oscillates, and since the real part of λ is > 0, there is exponential growth.

A = úû

ùêë

é-

-1 11 1

, Initial conditions: x(0) = [10 10]

This system has a zero eigenvalue. Since the initial condition (initial state vector) is

aligned with the eigenvector that is associated with this zero eigenvalue, the state vector stays aligned with this eigenvector for all time. With λ = 0, the exponent, e0 = 1 shows that the system neither grows, nor decays, but is stationary.

If ANY OTHER initial condition is used (other than one aligned in this direction), then the λ = 2 mode will dominate the system behavior after some finite amount of time passes à the state vector will approach the dominant mode asymptotically.

A = úû

ùêë

é-

--1 11 1

, Initial conditions: x(0) = [1 0.1]

The eigenvalues are equal in magnitude but opposite in sign, so the mode associated with the negative eigenvalue decays away, and the system becomes aligned with the eigenvector associated with the positive eigenvalue, and exhibits exponential growth. This eigenvector has one state variable positive and the other negative (depending upon whether the state vector is 0 or 180 degree phase with the eigenvector as Matlab reports it. Recall that eigenvectors are only defined within a scalar multiple, including a negative scalar.) This means that either Romeo will be increasing in love and Juliet will fall increasingly out of love, OR Romeo will be falling more and more out of love as Juliet falls increasing in love. The initial state vector (initial conditions) will determine which is the final result. Total Response with System Input (‘open loop input or open loop control’)

See the attached figures for possibilities of Romeo and Juliet system behavior. The figures show the input, the R and J vectors plotted versus time, and the R and J vectors plotted against each other (R vs. J), in state space.

Given the different α, β, γ, δ parameter values, along with different inputs, the systems below settle into a different final, steady state, behavior, which is that Juliet’s feelings mirror, but lag a little behind Romeo’s feelings. Thus there are times when they

Page 9: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

are both in love or both out of love, but the dynamics of the system drive them to be constantly moving through interest in the relationship, to lack of interest. Forever. Alas. Perhaps this is what would have happened if they had not ended in tragedy. The final system shows unstable behavior, as the out-of-phase swings of positive and negative feelings grow in intensity each cycle.

The second and third systems also show an initial transient behavior, as they listen to their friends’ advice, while still settling to the final steady-state behavior proscribed by the eigenvalues and eigenvectors à i.e., characteristic behavior inherent in the system. The only way to override this inherent, characteristic behavior is to have constant input from friends, that would push the system behavior (or control it) into the desired behavior.

Page 10: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

Romeo and Juliet, not listening to friends

0 5 10 15-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1Input into Romeo and Juliet feelings

Romeo inputJuliet Input

0 5 10 15-1.5

-1

-0.5

0

0.5

1

1.5Romeo and Juliet's Feelings

Romeo feelingsJuliet feelings

-1.5 -1 -0.5 0 0.5 1 1.5-1.5

-1

-0.5

0

0.5

1

1.5The State Vector: Romeo and Juliet in state space

Page 11: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

Romeo and Juliet, only Romeo listening to friends, A = [0 1; -1 0]

Romeo and Juliet… asymptotic stability, approaching R = J = 0, A = [0.001 1; -0.5 -0.75]

0 5 10 150

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5Input into Romeo and Juliet feelings

Romeo inputJuliet Input

0 5 10 15-10

-8

-6

-4

-2

0

2

4

6

8Romeo and Juliet's Feelings

Romeo feelingsJuliet feelings

-10 -8 -6 -4 -2 0 2 4 6 8-10

-8

-6

-4

-2

0

2

4

6

8The State Vector: Romeo and Juliet in state space

0 5 10 150

1

2

3

4

5

6

7

8

9

10Input into Romeo and Juliet feelings

Romeo inputJuliet Input

Page 12: Continuing Exercise 1 – Three-Mass Translational ...jcardell/Courses/EGR326/hw/HW7soln.pdfEGR 326 HW 7 Solutions March 2017 Continuing Exercise 1 – Three-Mass Translational Mechanical

EGR 326 HW 7 Solutions March 2017

Romeo and Juliet… Unstable relationship, A = [0.001 1; -0.5 +0.75]

0 5 10 150

1

2

3

4

5

6

7

8

9

10Input into Romeo and Juliet feelings

Romeo inputJuliet Input