1 GROUP HOMEWORK 5 AERE573 Fall 18 Due 11/16(F NAMES The homewor aresses he esimaion o he 1-D posiion an velociy o a lexible robo arm m or which a moel is shown a righ The lui has a mean viscosiy ha is inclue as a par o ( he viscous amping coeicien c However, he lui also has urbulence ha resuls in zeromean lucuaing loaing o he mass The ynamical moel or Figure 1 was evelope in he lecure noes enile Kalman Filering wih Known Forcing Funcion This moel is: r c ( where I mr n n n n r I ( / (, n / I, an c / I ( Figure 1 Arm moel The ynamical moel or Figure 1 was evelope in he lecure noes enile Kalman Filering wih Known Forcing Funcion The associae anser uncions are: ( s ns n ( s ( r / I H1( s an H( s ( s s s F s s s n n ( n n Numerical Inormaion: 5 r/ s, 5, n r 1 m, an I 1 g m A Moel or (: Clearly he mass will experience a mean rearing momen when in a uniorm low iel I will also experience perurbaions ue o he unseay naure o he iel In he presence o low Reynols number (RN (smooh low, he orce on he mass can be assume o have low specal banwih As he RN increases, his banwih will increase Furhermore, as he op plo a righ shows, he rag orce on he mass will begin o experience low ampliue oscillaions A high RN he small perioic oscillaions will evolve ino a sizeable sochasic sucure, as shown in he lower plo a righ We can moel he rag orce in each o hese Reynols number regimes as ollow: R1: (Low RN ( ~ C Gauss Marov(, where STR BW STR is he vorex sheing requency assoociae wih he Souhal number, which or a sphere is STR STRD / ( U [hps://enwiipeiaorg/wii/souhal_number ] Here, D is he sphere iameer, an U is he mean low velociy n R: (Me RN ( ~ C Orer Gauss Marov( res STR R3: (High RN ( ~ C Gauss Marov( BW STR Figure Drag coeicien C ( [hp://wwwicmil/ic//ullex/u/a494935p ] c c Hence, in regions (R1 an (R3 we have Fs ( In (R we have Fs ( wih s s s BW res res NOTE: These anser uncions o no inclue C This is a saic rag ha will be balance ou by a saic orque associae wih Hence, we are conucing a perurbaion analysis o he sysem in Figure 1 Numerical Inormaion: In his homewor we will ocus on region (R, wih 11 an 1 res n
(a(5ps Use he c comman in relaion o ( H ( s 1 o arrive a relaing ( an Use Nyquis requency N ra / s Soluion: [See coe @ (a] H ( z 1 From his, recover he ierence equaion (b(5ps I he riving whie noise ha resuls in requencies he magniue o Soluion: ( ( has variance Show ha his requires c ( u Inres r Suppose ha we require ha a very low o o (c(5ps Se 1 ( /18 17 ra Obain he anser uncions H ( z ( z / F( z an H ( z F( z / U( z 3 Soluion: [See coe @ (c] ((5ps Deine he sae x 1( 1( 1 ( ( 1 ( ( 1 Use he numerical inormaion in ( o arrive a he explici escripion o x Ax Bu Then give he C an D maices associae wih ( Cx Du Soluion: [See coe @ (] u u u ( 1 ( ( 1 ( (e(ps Simulae he sae an measuremen process or a oal o 55 ime sep Then iscar he irs 5 poin Give plos o an Soluion: [See coe @ (] ( ( Figure (e Plos o ( (le an ( (righ Commens: The mos challenging par o Kalman ilering is o arrive a a real-worl moel or he processes o be involve In his lecure we have move owar such a moel By varying parameers we can simulae all manner o urbulence, an all manner o weighs, siness, amping, ineria, ec in relaion o he penulum Having such a moel is
a naural guie o eveloping he sae an measuremen moels neee in he KF We will now procee o emonsae his DEVELOPMENT OF THE KALMAN FILTER EQUATIONS In he above moel: x 1( 1( 1 ( ( 1 ( ( 1 u ( 1 ( u( 1 u( an 3 ((5ps Explain why he sae inpu Explanaion: u is no in a orm ha is suiable o be he KF sae inpu (g(5ps In relaion o he KF sae equaion x 1 Fx Gu, le x ( ( 1 ( ( 1 an le u u( 1 u( Give he numerical values or F an G Answer: (h(5ps Noice ha he process Gu is never acually compue All ha is require by he KF is Q Cov( Gu For Cov( u I4 4, show ha Q GG / T Then compue is numerical value Soluion: (i(5ps The KF sae iniial coniion will be se o x coniion Then procee o arrive a he expression or Explanaion: P Explain why his is he mos logical iniial in erms o cross- an auo-correlaions Soluion: (j(5ps To compue he value or P irecly is a nonivial as [These are correlae ARMA(, processes] As an alernaive, recall ha Rx( E( x 1x1 an ha x 1 Fx Gu Subsiue his laer expression ino each elemen o he ormer, in orer o arrive a he relaion R ( FR ( F Q [Hin: E( xu E( ux, an ae avanage o (h] Soluion: x x
4 ((5ps Use he Malab coe lyap o obain he numerical value or Soluion: See coe @ (] R x ( (l(ps A KF coe or wss processes is inclue in he Appenix Use i o arrive a wo plos; one wih overlai an ; he oher wih overlai ( an ( ( ( [See Appenix @ (l] Figure ( KF esimaes overlai agains ( (le an ( (righ (m(5ps You shoul have oun ha he plos o ( an ( are exacly he same Explain why his is o be expece Explanaion: (n(5ps You shoul have also oun ha, wih he excepion o he irs ew poins, he plos o ( an ( are also essenially he same Explain why his is also o be expece To his en, begin by compuing he noncausal Wiener iler H ( ha gives he bes ( H( ( Soluion:
CONCLUSION Given all o he above, i is reasonable o as why a KF approach is even use or such a simple problem Aer all, even i he eerminisic inpu is inclue, since we now i, as well as he anser uncion ha relaes i o, an since ( ( (, we can simply subac rom he measure in orer o arrive a a ( perec esimae o ( ( ( All o his is ue The value o he KF meho is ha i allows us o move closer o a real-worl seing where, or example, we have (i aiive measuremen noise, (ii inexac esimaes o he ue anser uncions, (iii sensors which, hemselves have anser uncions, an (iii slow-ime-varying anser uncions 5
A Noe on Compuing Auo- an Cross-Power Specal Densiies As simple as he Malab lyap soluion is, i lacs insigh ino he naure o he elemens o P R x ( From (1 i is clear ha hose elemens are auo- an cross-correlaions a lags zero an one So, one migh as: How can we arrive a hese correlaions via ps inormaion We now presen a meho ha recovers all auo/cross-correlaions base on pss 1 Recall: Y ( z H( z F( z an c1 1 c u gives F( z U( z H ( ( 1 u z U z 1c z c z 1 Hence, Y ( z H( z H ( z U( z H( z U( z From he Wiener-Kinchine Theorem we hereore have: ( u ( ( u( u S z E H z U z H z (i: (ii: u y ( ( ( ( ( ( ( u( u S z E Y z F z E H z F z F z H z H z y ( ( ( ( ( ( ( ( u( u S z E Y z Y z E H z F z H z F z H z H z (iii: For numerical values, we can compue he quaniies an hen recover he associae correlaion uncions Noe ha his is no necessary in relaion o (i, as we have a irec meho o solving or he auocorrelaion or an AR( process NOTE: To recover he coeicien o a anser uncion H, ype: [num,en]=aa(h, v 6 The coe below recovers correlaion uncions rom pss speciie via anser uncions %PROGRAM NAME: psxcorrm %This coe recovers Rxy rom Sxy in iscree-ime omain %============================================ %Examples: m=1; %TF1: H1=([1 ],[1,-9],1; %Transer Funcion [H1n,H1]=aa(H,'v'; H1nw=(H1n,m; H1w=(H1,m; H1w=H1nw/H1w; %TF: %H=H1; %For Auocorrelaion H=([1 ],[1,-4],1; %For Crosscorrelaion [Hn,H]=aa(H,'v'; Hnw=(Hn,m; Hw=(H,m; Hw=Hnw/Hw; %Cross-Specum % Cross-Correlaion S1=H1w*conj(Hw; R1=real(i(S1; igure(1 plo(r1,'*' ile('crosscorrelaion or Two Speciie TFs' gri Commen: I chece o mae sure ha he imaginary pars o he i s were zero They were
7 Appenix Malab Coe %PROGRAM NAME: hw5m %(a: I=1; r=1; wn=; %(b: %(c: %(: %(e: no=55; n=5; igure(1 plo(,h ile('plo o hea(' xlabel('time (sec' ylabel('degrees' gri igure( plo(, ile('plo o (' xlabel('time (sec' ylabel('newons' gri %======================================== % **** KALMAN FILTERING SECTION **** %======================================== %(g: %Consucion o F an H Maices: %(h: %Consucion o Q an R Maices: %Measuremen Array: z=h; %(: %Iniial Coniions: xha_ol=zeros(4,1; P_ol= %+++++++++++++++++++++++++++++ %(l: % PROGRAM NAME: wssm % This program compues he Kalman iler sae esimae % or wss sae an measuremen processes % MODEL: % x( = F x(-1 + w(-1 % z( = H x( + v( % REQUIRED INPUT: % F=nxn sae ansiion maix % Q=nxn cov maix or nx1 sae whie noise
% H=mxn sae/msmn maix % R=mxm cov maix or mx1 msmn noise % xha_ol(1=iniial sae esimae % P_ol(1=iniial err_ol nxn cov maix % max = max ime over which o compue xha( % {z(:=1,max}=m x max msmn vecor % ********************************* nx=lengh(f; I=eye(nx; nps=lengh(z; K=[]; xha=[]; max=nps; or =1:max K= P_ol*H'*(H*P_ol*H' + R^(-1; K=[K,K]; zha_ol = H*xha_ol; xha=xha_ol + K*(z(-zha_ol; xha=[xha,xha]; zha( = H*xha; P=(I-K*H*P_ol; xha_ol=f*xha; P_ol=F*P*F' + Q; en igure( vec=1:nps; vec=t*vec; plo(vec,z,vec,zha,'r' legen('h','hha' gri ha = xha(3,:; igure(3 plo(vec,,vec,ha,'r' legen('','ha' gri 8