You are on page 1of 5

Simulation of Dynamic Responses of the First

and Second Order Linear Systems


WeiLin
DepartmentofBiomedicalEngineering
StonyBrookUniversity

Instructors Portion
Summary
ThisexperimentrequiresthestudenttouseLabVIEWtosimulatethe
dynamicresponseofthefirstandsecondorderlinearsystems.Students
shouldbefamiliarwiththefollowingLabVIEWprogrammingelements.
1.
2.
3.
4.
5.
6.
7.

LabVIEWloopstructure
LabVIEWformulanode
LabVIEWgraph
LabVIEWWaveformfunctions
LabVIEWsignalsimulationexpressVI
LabVIEWwriteLabVIEWmeasurementfileexpressVI
LabVIEWConvertfromDynamicDataexpressVI

Uses
Thislectureappliestoallcoursesofvirtualinstrumentation.

Equipment List

Computers

LabVIEW7Express

LabVIEW Users Manual. April 2003

LabVIEW Introduction Course - Six Hours.

References

SubmittinganExperiment

LabVIEW Introduction Course - Three Hours

Students Portion
Introduction
ThestudentsshouldlearnthebasicLabVIEWprogrammingtechniques
throughthisproject.TheywillcreatetwoVIsthatsimulatethedynamic
responsesofthefirstandsecondorderlinearsystems.Theywillbe
familiarwithLabVIEWexecutioncontrols,graphandtheuseofexpress
VIs.

Objectives

Loopexecutioncontrol
LabVIEWformulanode
LabVIEWgraph
LabVIEWWaveformfunctions
LabVIEWexpressVIs

Theory
Thelinearderivativeequationscanbeusedtorepresentthedynamicsof
linearsystem.Thetypicalrepresentationofthefirstordersystemisas
following.
dy (t )
y (t ) x(t )
dt

(1)

y ( n) y ( n 1)
y ( n) x ( n )
t

(2)

Whereisthetimeconstant,x(t)istheinputandy(t)istheoutput.The
discreteformoftheaboveequationisshownbelow.

or
y ( n)

y ( n 1) x( n)

t t

(3)

Equation3istheiterationusedinthesimulationofthedynamicresponse
ofthefirstordersystem.
Thetypicalrepresentationofthesecondordersystemisasfollowing.

SubmittinganExperiment

1 d 2 y (t ) 2 dy (t )

y (t ) x(t )
n dt
n2 dt 2

(4)

Thenistheundampednaturalfrequencyandtheisthedampingratio.

Thediscreteformoftheaboveequationis:
1 y ( n) 2 y (n 1) y ( n 2) 2 y (n) y ( n 1)

y (n) x ( n)
n
t
n2
t 2

(5)
or
y ( n)

1
21 n t y(n 1) y(n 2) n2 t 2 x(n)
t 2 n t 1
2
n

(6)
Equation6istheiterationusedinthesimulationofthedynamicresponse
ofthesecondordersystem.

Lab Procedure
Experiment1,Simulatethedynamicresponseoffirstordersystem
1. LaunchLabVIEW.
2. CreateablankVI.
3. Thefrontpanelshouldhaveatleastannumericcontroltoinputthe
timeconstantandthegraphindicatortoshowtheresult.
4. DroptheSimulatedSignalexpressVIandchoosethesignaltype
assquarewave,frequencyas1Hz,samplefrequencyas1000Hz
andnumberofdatapointsas500.
5. UseConvertfromDynamicDataVItoconvertthedatafromthe
SimulatedSignalexpressVItosinglewaveformdata.
6. Usewaveformfunctiontoextractthewaveformdataandthetime
intervalofthewaveform.
7. UseFORlooptoiteratetheoutputdataofthefirstordersystem.
8. Usetheformulanodetoprogramthealgorithmbasedonequation
3.
9. Usewaveformfunctiontocreatethewaveformdatafromthe
outputdataandthetimeintervaloftheinputwaveform.
10. UseBuildArrayfunctiontocreateanarraythatconsistsofthe
inputandoutputwaveforms.

SubmittinganExperiment

11. Usegraphindicatortoshowtheinputandoutputwaveforms.
12. UseWriteLabVIEWMeasurementFileVItosavethedataina
file.
13. RuntheVIusingthefollowingtimeconstants:0.01,0.03,0.05,
0.07and0.1,andsavetheresultstofiles.

Experiment2,Simulatethedynamicresponseofsecondordersystem
1. LaunchLabVIEW.
2. CreateablankVI.
3. Thefrontpanelshouldhaveattwonumericcontroltoinputthe
undampednaturalfrequencyandthedampingratioandthegraph
indicatortoshowtheresult.
4. DroptheSimulatedSignalexpressVIandchoosethesignaltype
assquarewave,frequencyas0.1Hz,samplefrequencyas1000Hz
andnumberofdatapointsas5000.
5. UseConvertfromDynamicDataVItoconvertthedatafromthe
SimulatedSignalexpressVItosinglewaveformdata.
6. Usewaveformfunctiontoextractthewaveformdataandthetime
intervalofthewaveform.
7. UseFORlooptoiteratetheoutputdataofthesecondordersystem.
8. Usetheformulanodetoprogramthealgorithmbasedonequation
6.
9. Usewaveformfunctiontocreatethewaveformdatafromthe
outputdataandthetimeintervaloftheinputwaveform.
10. UseBuildArrayfunctiontocreateanarraythatconsistsofthe
inputandoutputwaveforms.
11. Usegraphindicatortoshowtheinputandoutputwaveforms.
12. UseWriteLabVIEWMeasurementFileVItosavethedataina
file.
13. RuntheVIusingthe1Hzasundampednaturalfrequencyandthe
followingdampingratio:0.2,0.5,0.7,1,1.5and2,andsavethe
resultstofiles.

Lab Report
Thelabreportshouldcontainthefollowing;
1.
2.
3.
4.

SubmittinganExperiment

Theexperimenttitle
Theexperimentobjective
Derivetheequation3fromequation1,equation6fromequation4
Explainthedynamicresponseofthefirstordersystemusing
experimentdataandhowtheyarerelatedtothetimeconstant.

5. Explainthedynamicresponseofthefirstordersystemusing
experimentdataandhowtheyarerelatedtothedampingratio.
6. TwoVIsfromthetwoexperiments.
Pleasesubmitthereportthroughemail.

SubmittinganExperiment

You might also like