I want to calculate the Jacobian of three functions. Following the mathematical way of calculating I do:
u[x_, y_, z_] := 9 x^2 y^2 + z E^x
v[x_, y_, z_] := x y + x^2 y^3 + 2*z
w[x_, y_, z_] := Cos[x]*Sin[z]*E^y
{
{D[u[x, y, z], x], D[u[x, y, z], y], D[u[x, y, z], z]},
{D[v[x, y, z], x], D[v[x, y, z], y], D[v[x, y, z], z]},
{D[w[x, y, z], x], D[w[x, y, z], y], D[w[x, y, z], z]}
}
Where E
is the Euler number expressed in Mathematica.
And I get the Jacobian.
I have seen that there is a function named JacobianMatrix
which I understand shall give the same result.
I try this without success:
JacobianMatrix[{u[x, y, z], v[x, y, z], w[x, y, z]}, {x, y, z}]
- Would that function be used to calculate the Jacobian?
- If so, what is wrong in the way I am invoking it?
D[{u[x, y, z], v[x, y, z], w[x, y, z]}, {{x, y, z}, 1}]
orGrad[{u[x, y, z], v[x, y, z], w[x, y, z]}, {x, y, z}]
$\endgroup$Det@Grad
is the Jacobian. $\endgroup$ResourceFunction["JacobianMatrix"][{u[x,y,z],v[x,y,z],w[x,y,z]},{x,y,z}]
. Anyhow, I am with @cvgmt. I think it would be good if typing "Jacobian" into the documentation center search bar would direct one toD
andGrad
, as first and second search result, not to some ResourceFunction. $\endgroup$Jacobian
is a system symbol and option toFindRoot
, I'd expectFindRoot
to be the top hit. For me, it's 4th andD
is 5th. I don't get a resource function hit on the first page. Maybe it's a difference in how our systems are set up or versions or the online docs (I'm on V13.1/Mac). (My top 2 hits are optimization tutorials and the 3rd isCoordinateTransformData
.) $\endgroup$D
in 5th place (Version 12.3/Linux). $\endgroup$