This is the idl code used to produce the solution/graph to the given problem by using the Separation of Variables Method.


PRO series1
   str1=''
   V0 = 1.
   a = 1.
   nterm = 27
   phi=fltarr(11,11)
            
   for iterm=1,nterm,2 DO BEGIN
      An = 4.*V0/(iterm*!pi*sinh(iterm*!pi))
      print,"For n=",iterm,", An is ",An
      for ix=0,10 DO BEGIN
         x=ix/10.*a 
         FOR iy=0,10 DO BEGIN
            y = iy/10.*a
            ;y=1.
            phi(ix,iy) = phi(ix,iy) + An*sin(iterm*!pi*x/a)* $
               sinh(iterm*!pi*y/a)
         ENDFOR
      ENDFOR
      surface,phi, $
         title="Graph of Potential Using the Series Method", $
         xtitle="x axis",ytitle="y axis",ztitle="Potential"
      read,str1

   ENDFOR
    write_gif,'idl2.gif',tvrd()   
   save
END