/* EQPLOT.G: program to plot equilibriun of differentiated products duopoly Nash equilibrium between Optus and Foxtel John Rust, University of Maryland, July 2004 */ library pgraph; declare x,y,cv,wxy; declare a_o="init"; declare b_o,a_f,b_f,c_o,c_f,n,debg,debg_e,ngrids,multp,findall; declare sa_steps,sa_tol,ctol,maxnewts,gridtol; #IFUNIX #ELSE pqgwin many; #ENDIF proc (0)=eqplot; local x,y,d,i,p_f,parms; if (a_o $== "init"); #include setup.gpr; else; {parms,p_f}=fileinfo("parms.fmt"); if (strlen(parms) > 0); "loading saved parameters in parms.fmt"; load parms; a_o=parms[1]; b_o=parms[2]; c_o=parms[3]; a_f=parms[4]; b_f=parms[5]; c_f=parms[6]; n=parms[7]; endif; endif; p_f=equil; "Ploting equilibrium with p_f="$+ftos(p_f,"*.*lf",5,2); x=seqa(0,3*p_f/500,500); y=zeros(rows(x),1); i=1; do until i > rows(x); {y[i],d}=br2_f(x[i]); i=i+1; endo; _pdate=""; _pgrid=0|0; _pltype=6|6; _plwidth=5|5; axmargin(1,3.25,1,1); title("Nash Equilibria to Duopoly Pricing Game"); xlabel("Price of Foxtel"); ylabel("Price of Foxtel (best response^2)"); #IFUNIX let cv = 100 100 640 480 0 0 1 6 15 0 0 2 2; wxy = WinOpenPQG(cv,"Optimal Bid Function",""); call WinSetActive(wxy); #ENDIF xy(x,y~x); #IFUNIX call WinSetActive(1); #ENDIF endp;