```python
from sympy import Matrix, symbols, sqrt, asin

x1, x2, x3, x4, K, r, Re, alpha0, theta = symbols('x1 x2 x3 x4 K r Re alpha0 theta')

H = Matrix([[sqrt(x1**2 + x3**2)]])
display(H)

x = Matrix([[x1],
            [x2],
            [x3]])
display(x)

dH = H.jacobian(x)
display(dH)
```


$\displaystyle \left[\begin{matrix}\sqrt{x_{1}^{2} + x_{3}^{2}}\end{matrix}\right]$



$\displaystyle \left[\begin{matrix}x_{1}\\x_{2}\\x_{3}\end{matrix}\right]$



$\displaystyle \left[\begin{matrix}\frac{x_{1}}{\sqrt{x_{1}^{2} + x_{3}^{2}}} & 0 & \frac{x_{3}}{\sqrt{x_{1}^{2} + x_{3}^{2}}}\end{matrix}\right]$



```python
x = Matrix([[x1],
            [x2],
            [x3],
            [x4]])
display(x)

F = Matrix([[x2],
            [x1*x4**2 - K/x1**2],
            [x4],
            [-2*x2*x4/x1]])
display(F)

dF = F.jacobian(x)
display(dF)

H = Matrix([[asin(Re/x1)],
            [alpha0 - x3]])
display(H)

dH = H.jacobian(x)
display(dH)
```


$\displaystyle \left[\begin{matrix}x_{1}\\x_{2}\\x_{3}\\x_{4}\end{matrix}\right]$



$\displaystyle \left[\begin{matrix}x_{2}\\- \frac{K}{x_{1}^{2}} + x_{1} x_{4}^{2}\\x_{4}\\- \frac{2 x_{2} x_{4}}{x_{1}}\end{matrix}\right]$



$\displaystyle \left[\begin{matrix}0 & 1 & 0 & 0\\\frac{2 K}{x_{1}^{3}} + x_{4}^{2} & 0 & 0 & 2 x_{1} x_{4}\\0 & 0 & 0 & 1\\\frac{2 x_{2} x_{4}}{x_{1}^{2}} & - \frac{2 x_{4}}{x_{1}} & 0 & - \frac{2 x_{2}}{x_{1}}\end{matrix}\right]$



$\displaystyle \left[\begin{matrix}\operatorname{asin}{\left(\frac{Re}{x_{1}} \right)}\\\alpha_{0} - x_{3}\end{matrix}\right]$



$\displaystyle \left[\begin{matrix}- \frac{Re}{x_{1}^{2} \sqrt{- \frac{Re^{2}}{x_{1}^{2}} + 1}} & 0 & 0 & 0\\0 & 0 & -1 & 0\end{matrix}\right]$


25fba9787024d8d66ce1fd814266c2fbe8a68d9d
ipynb
Jupyter Notebook
Jacobian.ipynb
mfkiwl/GMPE340
3602b8ba859a2c7db2cab96862472597dc1ac793
MIT
Jacobian.ipynb
mfkiwl/GMPE340
3602b8ba859a2c7db2cab96862472597dc1ac793
MIT
Jacobian.ipynb
mfkiwl/GMPE340
3602b8ba859a2c7db2cab96862472597dc1ac793
MIT
Qwen/Qwen-72B
1. YES
2. YES