Transcription of Simple Vibration Problems with MATLAB (and Some Help …
1 Simple Vibration Problems with MATLAB (andSome Help from MAPLE)Original Version by Stephen KuchnickiDecember 7, 2009 ContentsPrefaceix1 Introduction12 SDOF Undamped Oscillation33 A Damped SDOF System114 Overdamped SDOF Oscillation175 Harmonic Excitation of Undamped SDOF Systems236 Harmonic Forcing of Damped SDOF Systems337 Base Excitation of SDOF Systems398 SDOF Systems with a Rotating Unbalance519 Impulse Response of SDOF Systems6110 Step Response of a SDOF System6711 Response of SDOF Systems to Square Pulse Inputs7712 Response of SDOF System to Ramp Input8913 SDOF Response to Arbitrary Periodic Input9514 Free Vibration of MDOF Systems10115 Damping of MDOF Systems11316 A Universal Vibration Solver12317
2 Modeling a van der Pol Oscillator13318 Random Vibration and Matlab141vviCONTENTS19 Randomly-Excited Du ng Oscillator14920 Monte Carlo Simulation of a Random System15721 Conclusion165 PrefaceThis document is companion to the text: Mechanical Vibration : Analysis, Un-certainties and Control, by Haym Benaroya and Mark Nagurka, CRC Press2010; contact: 1 IntroductionThis document is intended as a companion toMechanical Vibration : Analy-sis, Uncertainties, and Controlby Haym Benaroya and Mark Nagurka. Thiscompanion draws heavily upon the MATLAB software package, produced by theMathWorks, Inc. We do not intend to teach MATLAB in this work; rather, wewish to show how a vizualization tool like MATLAB can be used to aid in solutionof Vibration Problems , and hopefully to provide both the novice and the experi-enced MATLAB programmer a few new tricks with which to attack their problemsof (MatrixLaboratory) was born from the LINPACK routines writtenfor use with C and Fortran.
3 The MATLAB package provides both command-lineand programming language interfaces, allowing the user to test Simple state-ments at the command prompt, or to run complicated codes by calling a func-tion name. MATLAB is excellent for handling matrix quantities because it as-sumes every variable is an array. Thus, calling on the multiplication operatoralone causes MATLAB to attempt matrix, not scalar multiplication. Also, Mat-lab includes special array operators that allow multiplication of arrays on anelement-by-element basis. For example, if we set the variablea= [1 2 3]andb= [4 5 6];we can perform the matrix multiplications:c=a b0( )d=a0 b( )(Note that the apostrophe is the transpose operator in MATLAB .)
4 The resultcwould be a scalar (speci cally,32):The variabledwould contain a 3-by-3matrix, whose rows would be scalar multiples ofb:However, what if the valuesstored inaare three masses, and those inbtheir corresponding accelerations?If we wished to nd the force on each mass, we would need to multiply the rst element ofaby the rst element ofb;and so on for the second and thirdelements. MATLAB provides array multiplication for such an instance:e=a: b( )12 CHAPTER 1 INTRODUCTIONTake special note of the period betweenaand the asterisk. This tells Matlabto ignore its usual matrix multiplication rules, and instead createeby multi-plying the corresponding elements ofaandb:The result here would bee= [410 18]:This is one of the more useful specialized commands in MATLAB , and onewe will use frequently.
5 Other commands will be discussed as they vast majority of these examples will use MATLAB in its programmingmode. The general format is to introduce a problem, with reference to thetext where applicable, and to show the analytic solution (if derivable). Several gures follow each example, showing results of each Vibration problem underdi erent sets of parameters and making use of MATLAB s integrated graphicscapabilities. Finally, the MATLAB code used to generate the gures is presented,with comments explaining what was done, why it was done, and other waysit could have been done in MATLAB . The code should look somewhat familiarto those who have used C and Fortran in the past; MATLAB s language sharesseveral common structures with both of these languages, making it relativelyeasy for an experienced C or Fortran programmer to learn distinction to make with MATLAB programming is betweenscriptm- lesandfunctionm- les.
6 Both are sets of commands that are saved in a le. Thedi erences are that variables used in a script le are retained in the Matlabworkspace and can be called upon after the script completes. Variables within afunction m- le cannot be used outside of the function unless they are returned(much like C functions or Fortran subroutines). Additionally, a function mustbegin with the linefunctionoutput=function_name(var1;va r2;:::varN).This line tells the MATLAB interpreter that this le is a function separate fromthe workspace. (Again, the form should look familiar to Fortran and C pro-grammers.)Chapter 2 SDOF UndampedOscillationThe simplest form of Vibration that we can study is the single degree of freedomsystem without damping or external forcing.
7 A sample of such a system is shownin Figure A free-body analysis of this system in the framework of Newton ssecond law, as performed in Chapter 2 of the textbook, results in the followingequation of motion:m::x+kx= 0:( )(In general, we would have the forcing functionF(t)on the right-hand side;it s assumed zero for this analysis.) Dividing through bym;and introducingthe parameter!n=pk=m;we obtain a solution of the formx(t) =Asin(!nt+ );( )or, in terms of the physical parameters of the system, we havex(t) =p!2nx2o+ _x2o!ncos(!nt tan 1_xo!nxo):( )From this, we see that the complete response of an undamped, unforced, onedegree of freedom oscillator depends on three physical parameters:!
8 N,xo, and_xo: the natural frequency, initial velocity, and initial displacement, 2 SDOF UNDAMPED OSCILLATIONF igure : Typical single degree of freedom free the de nition of the natural frequency, we see that it is inversely pro-portional topm, and is directly proportional topk. Variation of mass orsti ness, then, will cause a variation in the frequency of Vibration . The graphson the following pages demonstrate these sensitivities. Figure shows thevariation of the vibrational characteristics for an increasing mass while sti nessremains constant. Figure shows how the oscillatory behavior changes forincreasing sti ness with mass constant.
9 For both Figures and , the initialvelocity used was_xo= 1, and the initial displacementx0= 3. Note that thefrequency decreases with increasing mass, but increases with increasing sti ness,as at Equation , it is evident that the phase angle and maximumamplitude are also functions of the natural frequency. Again, referring to , the maximum amplitude decreases with increasing mass, due to the corre-sponding reduction in natural frequency. As a result, the phase shift diminishes,with the peak of oscillation becoming nearer tot= 0. Note that the maximumdisplacement would occur att= 0if the initial velocity were zero.
10 It is easilyveri ed that, for this case, the parameterA(from Equation , above) reducestoxo, and the phase angle becomestan 1(0=x2o), or0 .In Figure , the maximum amplitude increases with increasing sti ness,due to the increase in natural frequency. The phase angle also increases withthe sti ness, so the maximum amplitude of oscillation occurs at an increasinglylater time with increasing sti MATLAB code used to produce the graphs follows. Theinputstate-ments in the rst few lines demonstrate one type of interactive programmingavailable in MATLAB . The portion of the statement inside the quotation markswill appear on the screen when the program is run, so user prompts are easilyadded and explained.