EE 539 Homeworks Sprng 08 Updated: Tuesday, Aprl 7, 08 DO NOT DO HOMEWORK UNTIL IT IS ASSIGNED. THE ASSIGNMENTS MAY CHANGE UNTIL ANNOUNCED. For full credt, show all work. Some problems requre hand calculatons. In those cases, do not use MATLAB except to check your answers. It s OK to talk about the homework beforehand. BUT, once you start wrtng the answers, MAKE SURE YOU WORK ALONE. The purpose of the Homework s to evaluate you ndvdually, not to evaluate a team. Cheatng on the homework wll be severely punshed. The next page must be sgned and turned n at the front of ALL homeworks submtted n ths course.
Homework Pledge of Honor On all homeworks n ths class - YOU MUST WORK ALONE. Any cheatng or colluson wll be severely punshed. It s very easy to compare your software code and determne f you worked together It does not matter f you change the varable names. Please sgn ths form and nclude t as the frst page of all of your submtted homeworks....... Typed Name: Pledge of honor: "On my honor I have nether gven nor receved ad on ths homework. Sgnature:
EE 539 Homework State Varable Systems, Computer Smulaton. Smulate the van der Pol oscllator y" ( y ) y' y 0 usng MATLAB for varous ICs. In each case below, frst use ICs of y(0)=0, y'(0)= 0.5. Then use ICs of y(0)=4, y'(0)= 4. Plot y(t) vs. tme t and also the phase plane plot y'(t) vs. y(t). a. For = 0.05. b. For= 0.9.. Do MATLAB smulaton of the Lorenz Attractor chaotc system. Run for 50 sec. wth all ntal states equal to 0.5. Plot states versus tme, and also make 3-D plot of x, x, x3 usng PLOT3(x,x,x3). x ( x x x ) x 3 bx3 xx use = 0, r= 8, b= 8/3. rx x x x 3 3
EE 539 Homework Graph Laplacan Egenvalues For the followng graphs, take all edge weghts equal to /. (a) Wrte the adjacency matrx A and the graph Laplacan L. (b) Fnd the egenvalues of L and plot n the complex s-plane. (c) Compare the Fedler e-vals. (d) Fnd the left egenvector w of L for 0. (e) Fnd the Fedler e-vector v. 3. Drected Tree graph. (Formaton graph) 4 5. Undrected Tree graph. 6 3. Star K,5 4. Star wth extra edges 5. Drected 6-cycle (6-perodc graph) 6. 6-cycle C 6 (-regular graph). 7. Path P 5. 4
EE 539 Homework 3 Consensus and Graph Egenvalues. Contnuous-Tme Consensus Smulate the contnuous-tme consensus protocol x u a ( x x ). j j jn for all the graphs on Homework. Take all edge weghts equal to. For each case, plot all the states versus tme.. Consensus for Formaton Control Let each node have the vehcle dynamcs gven by x Vsn y V cos wth ( x( t), y( t )) the poston and ( t) the headng. Ths corresponds to moton n the (x,y) plane wth velocty V as shown. All nodes have the same velocty V. Take a flock of 6 nodes wth the strongly connected communcaton graph structure shown. Run the contnuoustme local votng protocol on the headngs of the nodes as a ( ) j j jn Take all the edge weghts equal to. Set the ntal headngs random between 0 rads. Now, you have 3 states runnng at each node: () t,( x(), t y()) t. Plot the sx headngs vs tme. They should reach the weghted average consensus. Plot the sx postons ( x( t), y( t )) of the nodes n the plane vs tme. They should eventually all go off n the same drecton. Graph for formaton control. 5
EE 539 Homework 4 Dscrete-tme Consensus. Dscrete-Tme Consensus Smulate the DT consensus protocol usng the normalzed form protocol x( k) x( k) aj( xj( k) x( k)) x( k) ajxj( k) d jn d jn on graphs 3 and 7 from Homework. Take all edge weghts equal to //. For each case, plot all the states versus tme. Start wth random ntal condton states between -, +. 6
EE 539 Exam Takehome exam Formaton Control. Formaton control wth desred poston offsets. The Newton s moton dynamcs for moton n the plane are gven by x v x 0 v0 v u v 0 u0 wth vector poston x R, velocty v R, and acceleraton nput x [ p q ] T where ( p ( t), q ( t )) s the poston of node n the (x,y)-plane. u R. Take Defne the formaton control protocol as poston and velocty local neghborhood feedback u ckp aj( xj j x ) g( x0 x ) jn ckd aj(v jv) g(v 0 v) jn wth couplng gan c 0, and the constant desred poston offset n the formaton of node from the leader node. The pnnng gans g are only nonzero for a small subset of the nodes n the graph. Select PD control gans Kp I, Kd I. Smulate the above systems. Take the formaton graph shown wth 4 agents, whch x 0 contans a spannng tree. Take edge weghts and pnnng gans as ½. Select large enough to get stablty. The desred poston offsets are - 4 vectors to specfy the desred x and y poston of node. Take the desred poston offsets as 3 the 4 corners of a square around the leader Communcaton Graph,, 3, 4 The leader has the same dynamcs as the agents wth u 0 0, x0(0) (0,0), v0(0) (,). Select random ntal postons and veloctes for the agents n the square [, ] [, ]. Smulate and plot postons n the -D plane. Verfy that formaton consensus s reached. 7
EE 539 Homework 5 Moble Robot Control & Potental Felds. Potental Feld. Use MATLAB to make a 3-D plot of the potental felds descrbed below. You wll need to use plot commands and maybe the mesh functon. The work area s a square from (0,0) to (3,3) n the (x,y) plane. The goal s at (0,0). There are obstacles at (3,) and (6,7). Use a repulsve potental of K / r for each obstacle, wth r the vector to the -th obstacle. For the target use an attractve potental of Kr, T T wth rt the vector to the target. Adjust the gans to get a decent plot. Plot the sum of the three potental felds n 3-D.. Potental Feld Navgaton. For the same scenaro as n Problem, a moble robot starts at (0,0). The front wheel steered moble robot has dynamcs x V cos cos y V cos sn V sn L wth (x,y) the poston, the headng angle, V the wheel speed, L the wheel base, and the steerng angle. Set L= 4. a. Compute forces due to each obstacle and goal. Compute total force on the vehcle at pont (x,y). b. Desgn a feedback control system for force-feld control. Sketch your control system. c. Use MATLAB to smulate the nonlnear dynamcs assumng a constant velocty V and a steerable front wheel. The wheel should be steered so that the vehcle always goes downhll n the force feld plot. Plot the resultng trajectory n the (x,y) plane. 3. Extra Credt - Swarm/Platoon/Formaton. Do what you want to for ths problem. The ntent s to focus on some sort of swarm or platoon or formaton behavor, not the full dynamcs. Therefore, take 6 vehcles each wth the smple pont mass (Newton s law) dynamcs x Fx / m y Fy / m wth (x,y) the poston of the vehcle and Fx, F y the forces n the x and y drecton respectvely. The forces mght be the sums of attractve forces to goals, repulsve forces from obstacles, and repulsve forces between the agents. Make some sort of nterestng plots or moves showng the leader gong to a desred goal or movng along a prescrbed trajectory and the followers stayng close to hm, or n a prescrbed formaton. Obstacle avodance by a platoon or swarm s nterestng. 8
EE 539 Homework 6 Tme-varyng Graph Topologes. Dscrete-Tme Consensus wth Varyng Graph Topology We want to smulate DT consensus for the normalzed protocol systems x( k) x( k) aj( xj( k) x( k)) d jn x( k) ajxj( k) d jn The global form of ths s x( k) x( k) ( I D) Lx( k) ( I D) ( I A) x( k) Fx( k) a. Smulate ths algorthm for the strongly connected dgraph shown above. Start wth random ntal condtons between -, +. Take edge weghts of. b. Shown below are three dsconnected graphs whose unon s the orgnal strongly connected graph. Smulate the DT protocol for the case of tme-varyng protocols x( k) F( k) x( k) ( I D( k)) ( I A( k)) x( k) where F(0) corresponds to graph G, F() to Graph G, F() to G3, and then ths cycle 3 3 s repeated. Use the same ntal condtons as n part a. Plot the states vs. tme. Verfy that consensus s acheved. Are the consensus values the same as n Problem a? Graph G Graph G Graph G3 c. Repeat for a dfferent order of swtchng between the three graphs. Use the cycle 33333 33333 ad nfntum. Use the same ntal condtons as n part a. Compare to part a. Is the consensus value the same? 9
. Gossp Algorthms Use the same strongly connected graph as n problem. Smulate the gossp algorthm for average consensus. That s, at each step, select an edge at random. Update the states of the two nodes joned by the edge accordng to x j x x j x x x, xj xj Start wth random ntal condtons. Plot the states vs. tme. Verfy that consensus s reached. The consensus value should be the average of the ntal states. 0
. Parallel Soluton of Equatons EE 539 Exam Parallel Algorthms We want to solve the equaton Lx b where 0 0 0 0 0 0 0 0 0 0 0 0 L, b 0 0 0 0 0 0 0 0 0 0 0 0 a. Invert L to solve the equaton. b. Use the Jacob method to solve the equaton. Note that ths s the Laplacan matrx from the book Example. wth a added to element (,). See Fg.. What does t mean? Parallel Processng to Solve Electrc networks. Undrected graph Consder the electrc crcut shown n Fg. where all the edges represent conductances of unt (ohm - ) and there are two external voltage sources y 0 v, y 0v. Use the algorthm x a ( x x ) b ( y x ) j j k k jn to compute the steady-state voltages nduced at each node. Plot the voltages vs. tme. 3. Undrected graph, only one V source Repeat for the case where y 0v and there s no source y. Note that ths s not the same as y 0v. Plot the voltages vs. tme. Verfy that all nodes reach consensus at the value y 0v. 4. Drected Graph. Repeat for the drected graph shown n Fg. 3, where all edges have weghts of. Plot the voltages vs. tme. They should reach steady-state. What does t mean to have a crcut wth drected edges? Does Krchhoff s current law hold at steady-state- the sum of currents nto each node equals zero?
EE 539 Exam 3 Graph Laplacan Potental for Cyber-Physcal Systems Ths exam explores more about the Graph Laplacan Potental usng 3D Plots. We consder a Cyber-physcal system wth a cyber communcaton graph and a physcal poston confguraton. The Graph Laplacan Potental s gven by V a ( x x ) j j j Let us call the partal potental of agent as V ( x ) a ( x x ) j j j So that V V( x) Consder the communcaton graph shown. Consder the agents as vehcles wth postons ( p, q ) n the (x,y) plane so that p x q Let the agents be postoned at fxed locatons x, x, x 3, x 4, x5, x 6 0 0. Plot the partal potental V ( x ) as x vares over the square from (-0,-0) to (0,0) n the (x,y) plane. All other agents reman fxed at ther locatons. Adjust the vew angle of the graph to get a good pcture.. Repeat for V6( x 6) as x 6 vares. 3. Defne the related quantty as the product of terms gven by V( x ) a ( x x ) j j j a. Plot ( ) V x as x vares over the square from (-0,-0) to (0,0) n the (x,y) plane, as above. b. What s ths quantty? What does t mean?