Items tagged with directional-derivatives

Feed

It can be interesting to consider a directional derivative of f(z) in the direction w:

%ddiff(f(z), z, w) = %limit((f(z + w*h) - f(z))/(w*h), h = 0);
ddiff := proc (fz0, z, dir) local rule, fz, dfz, ans;
  dfz := %ddiff(fz, z, dir)*dir;
  rule :=
   [abs(1, fz::anything) = (conjugate(fz)*dfz + fz*conjugate(dfz))/(2*abs(fz)*dfz),
    signum(1, fz::anything) = (conjugate(fz)*dfz - fz*conjugate(dfz))/(2*abs(fz)*conjugate(fz)*dfz)];
  ans := applyrule(rule, diff(fz0, z));
  ans := value(ans);
  ans := [ans, op(convert~(ans, [abs, argument, Re, Im, signum, conjugate]))];
  op(1, sort(simplify(ans, size), length)) end proc;

For analytic functions the derivative is the same in any direction:

ddiff(sqrt(Re(f(z))^2+Im(f(z))^2)*exp(I*argument(f(z))), z, w); # f(z) in disguise
                             d      
                            --- f(z)
                             dz     

For non-analytic functions that's no longer the case:

ddiff(conjugate(z), z, w);
                               1     
                           ----------
                                    2
                           signum(w) 

ddiff(conjugate(f(z)), z, 1+I);
                             ________
                              d      
                          -I --- f(z)
                              dz     

ddiff(abs(z), z, z);
                               1    
                           ---------
                           signum(z)

ddiff(ln(abs(z)), z, z);
                               1
                               -
                               z

Some of those derivates have simple geometric interpretations: the derivative of argument(z) in the direction z is zero, since argument(z) doesn't change when moving in the direction z from the point z; the derivative of abs(z) in the direction I*z is zero, since the direction is tangent to the circle abs(z)=constant; since signum(z) is a function of argument(z) only, its derivative in the direction z is zero as well.

Interestingly, the derivative taken twice in the direction z is zero for each of the six basic functions:

map(fz -> ddiff(ddiff(fz, z, z), z, z), [abs, argument, Re, Im, signum, conjugate](z));
                       [0, 0, 0, 0, 0, 0]

Does that have some simple geometric interpretation as well?

 

Does anyone know how to incorporate the tetrad with the directional derivative? I tried using the SumOverIndices, but get crazy results. I know Maple can find the answer easily because I have done the same thing by hand. What am I missing?

The directional derivative should take the form f,1 = eaμ df/dxμ . The answer is Y,1 = dY/dζ – Ybar dY/du.  I obviously do not get this result.

 


restart; with(Physics); with(Tetrads)

0, "%1 is not a command in the %2 package", Tetrads, Physics

(1)

`#msup(mi("ds",mathcolor = "#af00af"),mn("2",mathcolor = "#af00af"))` := Physics:-`*`(Physics:-`*`(2, dzeta), dzetabar)+Physics:-`*`(Physics:-`*`(2, du), dv)+Physics:-`*`(Physics:-`*`(2, H(zetabar, zeta, v, u)), (du+Physics:-`*`(Ybar(zetabar, zeta, v, u), dzeta)+Physics:-`*`(Y(zetabar, zeta, v, u), dzetabar)-Physics:-`*`(Physics:-`*`(Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), dv))^2)

2*dzeta*dzetabar+2*du*dv+2*H(zetabar, zeta, v, u)*(du+Ybar(zetabar, zeta, v, u)*dzeta+Y(zetabar, zeta, v, u)*dzetabar-Y(zetabar, zeta, v, u)*Ybar(zetabar, zeta, v, u)*dv)^2

(2)

X = [zetabar, zeta, v, u]

X = [zetabar, zeta, v, u]

(3)

PDEtools:-declare(`#msup(mi("ds",mathcolor = "#af00af"),mn("2",mathcolor = "#af00af"))`)

Ybar(zetabar, zeta, v, u)*`will now be displayed as`*Ybar

(4)

Setup(automaticsimplification = true, coordinatesystems = (X = [zetabar, zeta, v, u]), metric = 2*dzeta*dzetabar+2*du*dv+2*H(zetabar, zeta, v, u)*(du+Ybar(zetabar, zeta, v, u)*dzeta+Y(zetabar, zeta, v, u)*dzetabar-Y(zetabar, zeta, v, u)*Ybar(zetabar, zeta, v, u)*dv)^2)

[automaticsimplification = true, coordinatesystems = {X}, metric = {(1, 1) = 2*H(X)*Y(X)^2, (1, 2) = 1+2*H(X)*Y(X)*Ybar(X), (1, 3) = -2*H(X)*Y(X)^2*Ybar(X), (1, 4) = 2*H(X)*Y(X), (2, 2) = 2*H(X)*Ybar(X)^2, (2, 3) = -2*H(X)*Ybar(X)^2*Y(X), (2, 4) = 2*H(X)*Ybar(X), (3, 3) = 2*H(X)*Y(X)^2*Ybar(X)^2, (3, 4) = 1-2*H(X)*Y(X)*Ybar(X), (4, 4) = 2*H(X)}]

(5)

g_[]

g_[mu, nu] = (Matrix(4, 4, {(1, 1) = 2*H(X)*Y(X)^2, (1, 2) = 1+2*H(X)*Y(X)*Ybar(X), (1, 3) = -2*H(X)*Y(X)^2*Ybar(X), (1, 4) = 2*H(X)*Y(X), (2, 1) = 1+2*H(X)*Y(X)*Ybar(X), (2, 2) = 2*H(X)*Ybar(X)^2, (2, 3) = -2*H(X)*Ybar(X)^2*Y(X), (2, 4) = 2*H(X)*Ybar(X), (3, 1) = -2*H(X)*Y(X)^2*Ybar(X), (3, 2) = -2*H(X)*Ybar(X)^2*Y(X), (3, 3) = 2*H(X)*Y(X)^2*Ybar(X)^2, (3, 4) = 1-2*H(X)*Y(X)*Ybar(X), (4, 1) = 2*H(X)*Y(X), (4, 2) = 2*H(X)*Ybar(X), (4, 3) = 1-2*H(X)*Y(X)*Ybar(X), (4, 4) = 2*H(X)}))

(6)

``

NULL

NULL

eqn3 := SumOverRepeatedIndices(Physics:-`*`(d_[mu](Y(X)), e_[1, `~mu`]))

((Y(X)*Ybar(X)-1)*(diff(Y(X), zetabar))+(Y(X)*Ybar(X)-1)*(diff(Y(X), zeta))+(diff(Y(X), u)+diff(Y(X), v))*(Y(X)+Ybar(X)))*2^(1/2)/((-(Ybar(X)^2+1)*(Y(X)^2+1)/(Y(X)+Ybar(X))^2)^(1/2)*(2*Y(X)+2*Ybar(X)))

(7)

NULL

``

NULL


Download Directional_Derivative.mw

Page 1 of 1