compute curvature for u with central difference scheme

Discussion in 'Programmer's Corner' started by tojeena, Jul 30, 2012.

  1. tojeena

    Thread Starter Active Member

    May 2, 2009
    118
    0
    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;

     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,777
    4,805
    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.
     
Loading...