application of an interactive ode simulation program

Upload: barbararope

Post on 03-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Application of an Interactive Ode Simulation Program

    1/6

    . - : cu r r i c u l um )

    APPLICATION OF AN INT ERACTIVE

    ODE SIMULATION PROGRAM

    IN PROCESS CONTROL EDUCATION

    Mor d echai Sh acham is P rofesso r a nd Head ofthe Chem ical Engin eeri ng Department at the BenGurion Un iversity of the Negev , Beer Sheva , Israel . He rece ived his BSc a nd DS c from theTechnion , Israel Institute of Te chnology . His resea rch interests inclu de ap plied numerica l methods , computer-aided instruction , chemical p rocess si mulation, d esign , a nd optim izatio n , an dexpert syste ms .

    Ne ima Brauner received her B Sc a nd MScfrom the Technion , Israel I nstitute of Technology , an d he r Ph D from the University of TelAviv. Sh e i s c urrently A ssociate P rofessor i n th eFluidMe chanics a ndHe at Transfer Dep artment.Sh e teaches c ourses in Massa nd H eat Tran sfer a nd Pr ocess Control . Her main researchinterests include two-phase flows a nd transportphe nomena in thin films .

    vent of user-friendl y , int eractive s imulation p ackages, a ndas a result many of them pu t too mu ch e mphasi s on lin earsys tems and lin earization methods . Most c urrent ma thematica l and co ntrol packages e mploy num erical so lution m eth

    ods which can so lve si multaneou s nonl inear ordina ry differential eq uation (ODE) sy stems as ea sily as they solve linearones. Th at mean s that t he traditio nal depe nden ce on linearizat ion co uld and shou ld be reeva luated and subs tantia llyreduced .

    An other c urriculum revisio n wo uld be in th e required u seof b lock diagram s w ithin th e control package . S uch di agrams w ere ab solutely necessary w hen analog co mputerswere used , a nd they ca n be very helpful in demo nstratingthe beh avior of lin ear sys tems; but th ei r i mportance shouldbe c arefully r eevaluated in li ght of the new si mulation p ackages. Th e di f ferential eq uation s (which are the bas is for theblock diag ram s) c an now be i nse rted direc tly int o the simu -

    Michael B. Cutli p rec eived h is BChE and MSfrom The Ohio S tate Uni versity and his PhD fromthe Uni versity of Colorado . He has taught at theUniver sity of Connecticut for the last twenty -fiveyears , serv ing as Department Hea dforn iney ears .His rese arch interes ts include catalytic and ele ctrochem ical r eaction eng ineering , and he is coauth or o f the PO LYMATH numerical anal ysiss oftware .

    Copyright Ch E D ivis ion of ASEE 1994

    N . BRA UNER, M. SHA CHAM, l M.B. CUTLlp 2Tel-Aviv Uni versityTel-Aviv , 6997 8, Israel

    1 Ben -Guri on U niversity of the N egev , Beer-Sheua , 84105 I srael2 Uni versity o f Connecticut , St orrs , CT 0 6269

    In a pa per tit led "Proce ss Co ntrol Education in th e Year2000 ,"[1 stro ng emp hasis was p ut on the imp ortance ofmathematical mod el ing a nd co mputer simul atio n wi th

    int eractive g raphics as key pedagogical tools in b oth thepre sent a nd the future o f p roce ss co ntrol education. S inceco mputer simul atio n has been used i n co ntrol educ ation fo rat lea st tw enty year s now , it is valid to ask what ha s changedand wh at a dditional rol es an int eractive s imulation pa ckagecan pl ay i n proc ess co ntrol education.

    In th e pas t the m ost co mmonly u sed packages have be enco ntrol-oriented p ackage s such as AC S[2) or indu strial co ntrol sys tems. !" Th ese package s are appropriate for demonstrating th e behavior of practical co ntrol sys tems and arequit e s uited fo r use a s "add ons " for a tradition al controlco urse . A major deficiency, however, is that th ese programsbeha ve as a black b ox , g iving r esults w hen input i s pro videdbut h iding the mathematical mode l from th e use r.

    Th ere a re now ava ilable so me n ew i nteractive sim ulationpackage s which acce pt th e mathematical model of the co ntrol sys tem as input in addition t o the num erical dat a of thepro ces s. Th e user mu st provide t he mo del , thu s c reating th edesirabl e co nnection b etween co ntrol th eor y a nd p racticalapplication . Us ing this type of pac kage ca n beco me an inte

    gral p art of the control co urse and n ot ju st a n add-on a s ithas been i n th e past wi th th e o lder p ackage s.

    In orde r t o tak e full advantage o f th e many desirabl ecapabilities o f the new s imulation too ls, however, the content of th e traditi onal und ergraduate co ntrol co urse shouldbe substantially r evised. On e of the needed rev ision s, forexa mple, is a reduced e mpha sis on lin ear sys tems th eory .Most proce ss co ntrol t extbook s we re written b efore the ad-

    130 Chemi ca l Engi neerin g Education

  • 7/28/2019 Application of an Interactive Ode Simulation Program

    2/6

  • 7/28/2019 Application of an Interactive Ode Simulation Program

    3/6

    Solutions

    2. Controller Tunin g

    Tune the PI controller u sing As trorn 's "ATV" method !" andthe Ziegler-Nichol 's!" p.m ) settings.

    K, = 1000 - 10 ,000, K, = a - 5,000 without ('tm , 'td = 0) andwith ('tm = 0 min, 'td= I) measuremen t deadtime.

    The e qualio ns:dCen p) .t d{') = (UC J ( 1i- 1e np)+q>r rhovedC er r su ll)/ d (t)=tr - l l'ldC ll ) I'dCt )= ( Ienp- th -( 1/ 2).d te llpdt )12 /1uc'50 0rhovc= 4000, c ' IOOOOor'BO, r 'Oq=1OOOO .ke l Cr - til) +I::r . er r suns 'ep" (. - 1l +abs( ,-I) It

  • 7/28/2019 Application of an Interactive Ode Simulation Program

    4/6

    83.20

    87.00

    Figure 3 give s the history of the integration erro r. Th e informat ion i n this c hart ca n be used to asse ss th e acc uracy of theresults and reduce the fi nal t ime if more acc urate resu lts areneeded . User option s sh own at the bottom include d isplay aswell a s change , s to rage , and re trieval op tions . T he d isplayoption s include graph ical ("g") or tab ular ("t") present at ion

    and output of the re sults to a DOS fi le (lid "). If graphicaldi sp lay of t he tempera ture i s se lected , the grap h shown in

    Figure 4a appear s, indicating th a t for th e specif ied p arameter va lues th e response is indeed un stable .

    The mat hematical mode l can be made more rea lis tic b yintro ducing Eq. (7 ) into i t to prevent th e heat i nput fro mbeco ming negative. The grow th ra te of the osc illations ismore modera te in thi s case, as s hown i n Fig ure 4b, bu t th esys tem is s ti ll un stable .

    This fir st part of the examp le pro blem ca n be used as anintro du ctory exa mp le i n a n undergraduate pr ocess co ntrolcourse . Stu den ts can introd uce changes t o th e sy stem andobs erve for th e fir st t ime the differe nce b etween sys temswith a nd without control, P vs. P I co ntroller, effec t of system parameter s ( time c onsta nt s, dead time ) an d can fa miliarize them selves with th e co ncep ts of offset , sta bi lity , etc.Mo st of these co ncept s are shown in t he tex tboo ks , but th efact that the student can intro duce the desired c hange andimmediate ly o bserve t he res ults ca n co ntribute co nsiderablyto a n under standing of t he ma terial.

    2. Controller tunin g using Astrii m's "A TV,,/8/ methodWhen usi ng thi s me thod , a re lay of height, h, is in serted

    as a feedback co ntroller. This n onl inear co ntroller w ill ca use

    the system to prod uce l imit cycle of th e co ntrolled va riable.The rela y type change of the manip ulated variab le is achievedby two equa tions s im ilar to Eq . (7 ) which ge nerate ( 1,0) and(- 1,0 ) va lues according to the sig n of th e erro r. Th e e quation s typed into POLYMAT H for t his assig nment are shownin Tab le I for parameter va lues (td = I ; tm = 0). A smallchange in the co ntroller set-po int is introduced (T R is increa sed to 8 1C) . The beha vio r of the manip ulat ed an d co ntrolled variab le during the IIATV " proce dure i s s hown inFigur e 5. The period of the l imi t cycle i s the ul timate per iodcPu). Thu s, th e ultimate freq uency i s

    21t(() = - (8)

    u Puand th e ult imate gain is

    x, = ~ (9)a1t

    where a is th e ampl itude of th e primary harmonic of th eo utput.

    The ultimate per iod and ga in , as found above , ca n be usedwith t he sta nd ard tuning fo rmulas. Th e process res ponse toa 33% step c hange in th e inle t temperature obta ined w ith aPI co ntroller tun ed using the Zi egler -Nicho ls co ntrollerse ttings I6p223] is shown in Figure 6.

    t (min)

    2.000 4. 000 6 .000 8. 000 10. 000

    81.&0

    80 .00

    76 .80

    78. 10

    4b . Hea t supply lim ited

    to positive va luesT (OC)

    T ABL E 1Con tr oller T uning Us ing As t r orn's "ATV" Method

    72 00

    4a . No lim it onhea t supply 81.00

    75.00

    78.00T(C)

    8tOO

    a n d s e t e r r s um(O) =O .- To c h e ck t h e r e s p o n s e wi t h d i f f e r e n t k c a n d k r

    s e t t i ng s ch an g e e qu a t i on s ( 6 ) a nd (8 ) .

    (1 ) d ( t emp) / d ( t )=d tempdt(2 ) d(tm) / d ( t )= ( t emp - tm - ( tau / 2 ) *d t em p d t ) *2 / t a u( 3) wc=5 00(4 ) r h ov c=4 000(5 ) e r r = 81- tm(6 ) h=40 0 0( 7) m1=(e r r+abs ( e r r ) ) / ( 2 *er r+ 0. 000001)(8 ) m2 = ( e r r - a b s ( e r r ) ) / ( -2*er r+0 . 00 0001)(9 ) q= 10 00 0+h *m1+h *m2(10) d tempd t =(wc*(60 - t e mp)+q) / r h o v c(11) t a u = l

    t (O)= 0, t e mp( O)= 80 , tm(O)= 80t ( f ) = 1 0

    - This s e t o f e q u a t i ons w i l l gene r a t e t h e l i m i tc y c l e i n t h e measu red temp e r a t u r e us ing t h eab o ve method .

    - To obse rve t h e r e s p onse wi t h p r op o r t i o n a lco n t r o l whe n kc i s s e t t o t h e u l t im a t e ga inc h a n ge eq ua t i o n s 5-1 2 a s fo l lows:

    (5 ) d ( e r r s um) /d ( t ) = t r - tm(6 ) k c= 8 4 5 0(7 ) t r=80(8 ) k r =O(9 ) q= 1 000 0+ k c * ( t r - t m ) +k r *e r r s um(10 ) ti =6 0- 2 0(11) d tempd t =( wc* ( t i - t emp)+q ) / r h o vc(12) t au= l

    Fi gu r e 4 . Respons e of th e temp eratur e in th e s tirr ed tankto -20 C s tep chang e in feed temp eratur e.

    (for a co mputer with a co- processor ).

    Fig ure 3 shows a d isplay of partial results w hich in cludesa table of in itial, mi nima l, max imal , and final val ue s of a llhe var iable s. Ob serving thi s table shows immediately t hatth e mo de l is unr ealist ic s ince t he hea t input , q, becomesne gative at a particular point.

    The bar chart near t he bottom of th e screen shown in

    Spri ng / 994 / 33

  • 7/28/2019 Application of an Interactive Ode Simulation Program

    5/6

    Fig ure 5. Chan ge of th e ma n ipu lat ed variab le an d th econtrolled variabl e in "ATV " tunin g .

    (I I)

    t (min )

    . " ~1 . 1081 .0 080 .6 0

    8 0 .2 0~

    9 . 8 00 .0 0 0 2 . 000 1 . 000 6 . 000 8 . 000 10 .0 00

    ""[UJJJI I1. 30 01.1 000 . 9 000 .7 00

    0 . 500

    5a. M anipulatedvariabl e(q"1O 4)

    5b. Controlle dvaria ble (Tn)

    79.20T (DC)

    78. 40

    77.60

    76.800.000 3.000 6.0 00 9.000 12.000 15.000

    l (min )

    Fig ure 6 . Response of th e heating tan k wi th P I con trollera n d Zi egler-Nichols s e ttins .

    Chemical Engine er ing Education

    80.80

    80.00

    where R 1 = 2 h ~/ 2 / c.

    Equations ( 10) and ( I I) ca n be introd uc ed int o thePO LYMATH ODE so lver wit h onl y s ligh t m odification.

    Th e re spo nse to red uction of th e in let flow to 10 cfm i sshown in Figure 9 .

    We kn ow th at lin eari zation is likel y to y ield close approximation of the dynamics of th e sy s tem near the statearo und which the l inearization is done . Indeed , when t hereis a 10% change in th e inl et flow , responses of the nonlinearand lin ea r ized sys tems are very si milar. Th e initi al s lo pe i sth e same , and th e differe nce b etween the proce ss gain s thatare calculated u sing the tw o model s is o nly 5%. But u singthe lin earized model f ar fro m th e s tead y sta te m ay give v eryunr easonable res ult s. If , for exa mple , the tank 's wa ll is m uchhigher th an the s teady-state l evel a nd one t ries to predict the

    maximal inlet flowra te th at ca n be used wi thout tank ov e rflow , th e diff erence between the pr edictions by the twomodels c an be co nsiderable. A n ev en m ore int eresting resultoccurs when th e inlet flowr ate is dra sticall y reduced - t h elineari zed mod el may pr edi ct a negative level a t th e newsteady state, whic h i s of co urse i mpossi ble . Such i s the

    3. Reset Windup

    Th e model e quations for the case wh ere the o utput fromthe heater is limited a nd th ere is a substantial d rop i n th ein let t emperature are very s imilar to th e sys tem shown inFigu re I , e xcept that a n equation s imilar t o Eq. (7) has to beadded t o l imi t the hea ter 's o utput.

    Th e simulation re sults show tha t the PI co ntro ller o n th eheatin g co il wi ll ca use the h eat o utp ut to r ea ch i ts m aximalvalue shortly after the inl et temperatur e is reduced. Sin cethe heat o utput i s not e no ug h f or reaching the se t-pointtemperature, the erro r term i n th e integral p art of the controller co ntinues t o increase unt il the inl et temp erature isrestored to its s teady-state va lue. B ecause of this acc umulated error term , th e co ntroller k eeps the heat s upply a t it smaximum l on g a fter th e restorati on o f th e inlet t emp erature.Thi s c ause s the o ut le t t emp erature to r each a mu ch hi ghervalu e than th e set p oint , as shown in Fi gu r e 7a .

    M any ind ustrial co ntrollers h a ve a nti-wi ndup p rovisions.Th is fea ture ca n be demonstr ated in thi s ex a mple b y sw itching o ff th e e rror accumulation wh en the required heat supp ly exceeds the b ound s. The outl et temperatur e response isshown in Fi gure 7b . In thi s cas e the outlet temperat ure willrapidl y reach the se t-point va lue , after th e in le t t emp eratureis restored to the s teady-state va lue.

    EXAMPLE 2Dynamics o f a Nonlinear Liquid-Level SystemThe liquid -level c ontrol sys tem i s frequ e ntly used in pro

    ce ss cont rol textbooks to d emonstrate the differ ence betwe en lin ear a nd n onlinear sys tems '!"..6 .P.72) wh ere e mphasisis put on l inearization of th e nonlinear sys tem aro und th esteady state.

    For thi s exa mple, co nsider th e sys tem, show n in Fi gu r e8, which co nsists of a tank of constant cro ss sectional ar ea ,A , into wh ich a valv e wi th flow re sistance characteri stics,qo(t) = ch 1/2, is a ttac hed , whe re h is the liquid l evel in th etank and c is a constant. Th e flo w rate int o the tank, q , varieswith time.

    Th e foll owing numerical and steady-state values a re appropriate :

    A = I ft 2; C = 20 ft 2.5 / min ; qs = 60 cfm; h , = 9 ftUsing these num erical v alues , th e response o f th e sys tem t osma ll and l arge ( up to 90 % ) step changes in th e inl et f1owrat e should b e o bs er ved and th e re sponse using the nonlin ear and lin eari zed model should b e compared.

    Sol ution

    The equati on repre senting the liquid-le vel sys tem i s

    q - ch " 2 =A dh (10)dt

    The equation can b e linearized around th e s teady state

    134

  • 7/28/2019 Application of an Interactive Ode Simulation Program

    6/6

    8 1.00

    99.00

    REFERENCES

    1. Edgar , T .F ., "Process Control Education in the Year 2000 ,"Chem . Eng. Ed. , 24 , 72 (1990)

    2. Kopp el , L.B. , and G.R. Sullivan , "Use of IBM 's AdvancedControl S ystem in Und ergrad uate Process Control E ducation," Ch em . En g . sa ; 20 , 70 (1986)

    3 . Buxton , B., "Impact of Packa ged Software for Process Contro l and Chemical Engine erin g Education and Research,"Chem. En g . Ed. , 19 , 144 (198 5)

    4. Sha cha m, M ., a nd M .B . Cutlip , "A Simu lation Package forth e PLATO S ystem, " Computers and Chem . En g., 6 , 209(1982)

    5. Fo ss, AS ., "UC ONLINE : Berk eley's Multiloop Com pu te rControl Program ," Chem. En g. Ed. , 21 , 122 (1987)

    6 . Coughanowr, D .R., Pr ocess Systems Analysis an d Control ,McGraw -Hill Book Co. , New Yo rk (199 1)

    7. Hitt ner, P.M. , and D.B. Gree nberg , "We Ca n Do P rocessSimulation : UCAN -II ," Ch em . Eng. Ed ., 14 , 138 (1980)

    8 . Astrorn a nd H agglund , Proc eeding s of th e 1983 IFAC Co nference, San Franci sco, CA (1983)

    9. S mith , C.A, and AB . Corripio, Prin ciples and Pra ctice ofAutomati c P rocess Co ntrol , J ohn Wiley & Son s, New York(1985 ) 0

    CONCLUSIONS

    tern w hich ca n be r ep r esented by a l inear model and lin eariza tion o f a nonlinear model. Lin earization can repr esentth e sys tem well on ly n ea r the point of lin earization .

    It is alway s adv isabl e to compare results from th e nonlin earand lineari zed models in o rd er t o be ab le to a ppreciate th ema gnitude o f error int rodu ced by lin earization.

    Results o btained fro m computer solution mu st a lways b ecaref ully checked . Equat ion s used o uts ide th e bounds oftheir va lidity, or nu merical i nteg ration e rrors, m ay lead toincorrect o r e ven absurd re sult s.

    We hav e demon strated s everal intere sti ng applications ofan int eractive ODE simulation program in t his paper. Experience ha s shown th e following important benefit s of u singsuch program s in p rocess control :

    J. There a re many aspec ts o f dynamic pro cess behaviorthat ca n be s tudied only by using nonlin ear mod els

    that includ e,fo r exampl e, limits o n va riables.2 . Int eractive s imulation complements ana lytical meth

    ods very ni cely by ensuring b etter und erstand ing andallo wing mor e realistic prob lems to be co nsidered.

    3. The s trengths and weaknesses o f anal ytical so lutionsa nd num erical s imulation can b e clearly demonstra ted.Thi s is imp ortant ill parti cular w hen lin earizing nonlin ea r eq uations where th e restrictions o f th e linearized model mu st b e well und erstood.

    Th e ex amples and exe rcises given in Fig ure I and Tab le Ican b e put int o immedi ate use in the cla ssroo m. Addit ionalexamp les of app lying an O DE solver for co mparing analy tical and numerical solutions and for more com plex phenomenon could not be included in thi s paper beca use of spacelimitation s. Information on the se exa mples ca n be o btainedfrom an yone o f th e auth ors.

    Key1- N onlinear model2- Linearized m odel

    nonli nearresista nce

    I~ I

    " qo (t)

    2."00 3.000

    t (min)

    h (t)

    l. 0 0 0 10 . 0 00

    12

    69.00

    T ("C) 7 ' . 0 072 . 00

    -6.000.000 0 .600 1.2 00 1.800

    t (min)

    - 3.00

    9.00

    6.00

    q (t)

    3.00h (ft)

    0.00

    7b . Limit on e ... oointegral error 80 .0 0

    Fig ure 7. Outl et temp erature in the h eat ed tank with an dwithout limit on th e in tegral error.

    Fig ure 8 . Liquid-l evel sys tem with n onlinear resistence.

    75 .00

    7a. No limit onin tegral e rror 93 .0 0

    87. 00

    T ("C)

    situat ion in Figure 9 . The nonlinear model pr edicts the newsteady-state level a s 0 .25 ft and th e lin earized mod el pr edicts -6 ft as the new level.

    It s hould be noted that reducing the flowrate ev en furthermay cause difficultie s with even the nonlin ea r model. Because of integration error s , h ma y becom e a s mall n egati ve

    number , which make s it impo ssible to calculat e the h "2 term.Thi s can be pr evented by puttin g a limit on h by applying anequation simil ar to Eq . (7) . Th e sa me m ethod can be usedwhen the linearized model i s so lved b y numerical simulaio n, but not when it i s solved anal ytically.

    A comparison of the nonlinear and line arized solutions bystudents sho uld reinforc e the following co nclusions:

    It is important to r emember th e d ifference between a sys-

    Figure 9. Response of liquid l evel to re duction of th e inl etflow rat e to 10 cfm.

    Spring 1994 135