%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                     %%
%%  Plot the solution of the improperly posed Laplace  %%
%%    problem with a triangular boundary condition     %%
%%                                                     %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function u_vals = badlap_sum(x_vals,y,n_max)

% initialize the sum to zero times the x-values
u_vals=0.0*x_vals;

% add the individual terms one by one
for n=1:n_max
  u_vals=u_vals+4./(pi*n^2)*sin(n*0.5*pi)*sin(n*x_vals)*cosh(n*y);
end
