Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Jacobian Matrix and Change of Variables | Section
Understanding Multivariate Calculus
Abschnitt 1. Kapitel 8
single

single

bookJacobian Matrix and Change of Variables

Swipe um das Menü anzuzeigen

The Jacobian matrix is a fundamental concept in multivariate calculus, especially when analyzing how functions transform regions in space. Suppose you have a transformation from variables x,yx, y to new variables u,vu, v defined by two functions:

u=f(x,y)v=g(x,y)u = f(x, y)\\ v = g(x, y)

The Jacobian matrix of this transformation is the matrix of all first-order partial derivatives:

J=[uxuyvxvy]J = \begin{bmatrix} \frac{\partial u}{\partial x} & \frac{\partial u}{\partial y} \\ \frac{\partial v}{\partial x} & \frac{\partial v}{\partial y} \end{bmatrix}

The determinant of this matrix, called the Jacobian determinant, measures how areas (or volumes in higher dimensions) are scaled by the transformation at each point. When changing variables in a double integral, the absolute value of the Jacobian determinant adjusts for the stretching or shrinking caused by the transformation.

Example: let's say you have the transformation:

u=x+yv=xyu = x + y\\ v = x - y

The Jacobian matrix is:

J=[uxuyvxvy]=[1111]J = \begin{bmatrix} \frac{\partial u}{\partial x} & \frac{\partial u}{\partial y} \\ \frac{\partial v}{\partial x} & \frac{\partial v}{\partial y} \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}

The Jacobian determinant is:

J=(1)(1)(1)(1)=2|J| = (1)(-1) - (1)(1) = -2

This means that at any point, the transformation scales areas by a factor of 2 (the sign indicates orientation).

123456789101112131415161718192021
import sympy as sp import numpy as np # 1. Define the symbolic variables x, y = sp.symbols('x y') # 2. Define our functions as a matrix funcs = sp.Matrix([x**2 + y, x - y**2]) # 3. Compute the Jacobian symbolically (this replaces the custom jacobian_matrix function) J_sym = funcs.jacobian([x, y]) # 4. Substitute the values x=1.0, y=2.0 J_eval = J_sym.subs({x: 1.0, y: 2.0}) # Print the results print("Jacobian matrix at (1, 2):") print(np.array(J_eval, dtype=float)) # Convert to a numpy array for a standard display format print("\nJacobian determinant at (1, 2):") print(float(J_eval.det()))
copy
Aufgabe

Wischen, um mit dem Codieren zu beginnen

Practice applying your understanding of the Jacobian matrix for a transformation utilizing the sympy library. Given the transformation defined by h=xsin(y)h = x \sin(y) and k=ycos(x)k = y \cos(x), your goal is to compute the exact analytical Jacobian matrix and evaluate it at the point (1.0,0.5)(1.0, 0.5).

  • Define the symbolic variables x and y utilizing sympy.symbols().
  • Define the equations hh and kk utilizing the sympy sine and cosine functions.
  • Create a sympy.Matrix representing the system of equations.
  • Compute the analytical Jacobian matrix utilizing the .jacobian() method.
  • Substitute the variables x and y with the values 1.0 and 0.5 utilizing the .subs() method.
  • Convert the evaluated matrix to a numpy array of floats and assign it to the J variable.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 8
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt