%
%   Book: MATLAB-Based Electromagnetics (Pearson Prentice Hall)
%   Author: Branislav M. Notaros
%   Instructor Resources
%   (c) 2011
%
%   This MATLAB code or any part of it may be used only for 
%   educational purposes associated with the book
%
%
%


%  Symbolic Laplacian in Cartesian coordinates

% This function computes div(grad(f)) in Cartesian coordinate system and
% returns symbolic expression

function F = LaplaceCar(f)
syms x y z 

Fx = diff(f,x,2);
Fy = diff(f,y,2);
Fz = diff(f,z,2);
F = Fx + Fy + Fz;