# Joey Reichert # 640:640 Spring 2013 # May 2, 2013 # hw27.txt # I give permission to post Help27:=proc() : print(""): end: # Problem #1 # Finish implementing the finding of Waldorp equilibria, by writing # a procedure Waldorp(J,R,DelayJ,y,S,Sspec) # (as described on the webpage) # I'm not completely understanding the difference between S # and J here...It is certainly the case that J gives the edges # of the graph, but doesn't S do the same? Or does S contain # all of the paths? It seems as though the notation being used # in the article is causing some confusion for me, and I'm not sure # how to avoid use of matrices in the eigenvalue equations # Hx = f and Ax = y, which is also the first place where the constraint # x would appear... #C27a.txt: May 2, 2013, Traffic flow (under construction) Help:=proc(): print(` PotF(J,R,DelayJ,y,x) `): end: JR1:=Optimization[Minimize]: G1:=[{2},{1,3},{1,2}]; J1:=[[1,2],[2,1],[2,3],[3,2],[3,1]]; S1:=[[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]; R1:=[[1,2],[1,2,3],[2,1],[2,3],[3,1],[3,2,1],[3,2],[3,1,2]]; DelayJ1:=[10*y+4,35,12*y+15,40*y+11,50*y+1]: #IsEdgeRoute(Edge,Route): Is Edge part of Route IsEdgeInRoute:=proc(Edge,Route) local i: member(Edge, {seq([Route[i],Route[i+1]],i=1..nops(Route)-1)}): end: #PotF(J,R,DelayJ,y,x): the Traffic potential function with #edges J1 and Routes R1 PotF:=proc(J,R,DelayJ,y, x) local W,j,z: #W is for Wait (Wisecrack due to Pat Devlin) W:=add( int(DelayJ[j], y=0..z[j]) , j=1..nops(J)): end: