derv:=proc(neqn,t,u,ut) # # Function derv computes the derivative vector # of the linear PDE problem # # Type variables local xl, xu, dx, dxs, i: # # Problem parameters xl:=0.0: xu:=1.0: # # BC at x = 0 u[1]:=0.0: ut[1]:=0.0: # # BC at x = 1 u[neqn]:=0.0: ut[neqn]:=0.0: # # Interior points dx:=(xu-xl)/(neqn-1): dxs:=dx*dx: for i from 2 to neqn-1 do ut[i]:=(u[i+1]-2.0*u[i]+u[i-1])/dxs: end do: # # End of derv end: