Recent content by Meurig

  1. M

    Graduate Numerical Solutions to Laplace's equation in a wedge

    Apologies, thanks for bringing that to my attention. The numerical results: The analytical results: As you can see, the issue lies with the values at the free-surface. I've never dealt with any boundary conditions involving two separate functions before (here \hat\phi and...
  2. M

    Graduate Numerical Solutions to Laplace's equation in a wedge

    Thanks for the reply, I think I've managed to sort that issue. The problem I'm having now is in the implementation of the free surface boundary condition (when \bar\theta=0). This is a graph produced using the analytical result...
  3. M

    Graduate Numerical Solutions to Laplace's equation in a wedge

    Hi all, I am trying to construct a numerical solution to the following linear harmonic problem posed in a wedge of interior angle 0<\alpha<pi/2 \bigtriangledown^2\phi(r,\theta), \ r>0, \ -\alpha<\theta<0 \bigtriangledown\phi\cdot\mathbf{n}=0, r>0,\ \theta=-\alpha...
  4. M

    MATLAB Improving MATLAB Array Efficiency

    Hi all, I have the following code: M = zeros(N) for i = 1:N for j = 1:N M(i,j)= log(norm(rs(:,i)-rc(:,j)))+log(norm(ri(:,i)-rc(:,j))); end end Where rs, rc and ri are 2xN arrays. Is there a way to construct the matrix without the use of the two for loops? I'm...
  5. M

    MATLAB Making MATLAB Code Efficient: A 2xN Vector

    Hi everyone, I'm trying to make my MATLAB code run as efficiently as possible. II have a 2xN vector designated like so: acc1(1,:) = A*rc(1,:); acc1(2,:) = B*rc(2,:); where A and B are scalars,. Is it possible to combine these two into a single line of code? Cheers