compute curvature for u with central difference scheme

Thread Starter

tojeena

Joined May 2, 2009
118
Could anyone please explain this code?

compute curvature for u with central difference scheme
[ux,uy] = gradient(u);
normDu = sqrt(ux.^2+uy.^2+1e-10);
Nx = ux./normDu;
Ny = uy./normDu;
[nxx,junk] = gradient(Nx);
[junk,nyy] = gradient(Ny);
k = nxx+nyy;

 

WBahn

Joined Mar 31, 2012
33,130
If you want a useful answer, it might be nice to provide such useful tidbits such as:

1) What language is this? MatLab?
2) What is 'u'? Is it a vector? A 2-D array of function values? What?
3) Where does this code come from?
4) Any hint as to what that 1e-10 is for would be handy.
 
Top