%
%   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
%
%
%

% This function computes divergence in Cylindrical coordinate system and
% returns symbolic expression

function F = divCyl(fr,fp,fz)
syms r phi z 
Fr = diff(r*fr,r);
Fp = diff(fp,phi);
Fz = diff(fz,z);
F = 1/r*Fr + 1/r*Fp + Fz;