Vektoranalízis

<< Calculus`VectorAnalysis`

Koordinátarendszerek

Néhány Mathematicaban használható koordinátarendszer:
	• Cartesian, a jól ismert derékszögű koordináták
	• cylindrical, henger koordináták 
	• spherical, gömbi koordináták

felsorolásszerűen a továbbiak:

({{Bipolar, Bispherical}, {Cartesian, ConfocalEllipsoidal}, {ConfocalParaboloidal, Conical}, {Cylindrical, EllipticCylindrical}, {OblateSpheroidal, ParabolicCylindrical}, {Paraboloidal, ProlateSpheroidal}, {Spherical, Toroidal}})

koordinátatranszformációk

Tetszőleges koordinátarendszerről áttérhetünk derékszögűre vagy fordítva:
• CoordinatesToCartesian[pt, coordsys]
• CoordinatesFromCartesian[pt, coordsys]

Gömbiből derékszögűbe:

\(\(\(CoordinatesToCartesian[{x, y, z}, Spherical]\)\(
\)
    \)\)

CoordinatesToCartesian[{2, π/4, π/6}, Spherical]

Derékszögűből gömbibe:

CoordinatesFromCartesian[{x, y, z},  Spherical]

CoordinatesFromCartesian[{1, 2, 3},  Spherical]

CoordinatesToCartesian[{r, ϑ, φ}, 
      Spherical]

Integrálás

Paraméteres alakban megadott görbéken

Ívhossz szerinti paraméterrel

param = {Cos[t], Sin[t], t}

ParametricPlot3D[{Cos[t], Sin[t], t}, {t, 0, 2  π}];

ArcLengthFactor[param, t, Cartesian] // Simplify

f[{x_, y_, z_}] := (x^2) (y^2) z

Integrate[
        f[param] ArcLengthFactor[param, t, Cartesian], {t, 0, 2 π}] // 
      Simplify

,,Kézzel"

ClearAll[
        vonint];
  
vonint[vval_, γval_, tig_, 
          ttol_:  0] := (∫_ttol^tig)(vval /. 
                  Thread[{x, y, z} -> γval]) . 
              D[γval, 
                t] \[DifferentialD]t;
vonint[vval_, γval_, Atol_List, Big_List] := 
        Module[{ttol = Union[
                  Solve[γval == Atol, 
                    t]][[1, 1, 2]], 
            tig = Union[
                  Solve[γval == Big, t]][[1, 
                1, 2]]}, 
          vonint[vval, γval, tig, ttol]];
vonint[vval_, Atol_List, Big_List] := 
      Module[{γval = Atol + t Big}, 
        vonint[vval, γval, 1]]

vonint[{x y - z, y z - x, z x - y}, {(t^2) + 1, 1 - t, (t^3) - t}, 
      2]

vonint[{x y - z, y z - x, z x - y}, {(t^2) + 1, 1 - t, (t^3) - t}, 2, 
      0]

vonint[{x y - z, y z - x, z x - y}, {(t^2) + 1, 1 - t, (t^3) - t}, {1, 
        1, 0}, {5, -1, 6}]

Divergencia, rotáció, gradiens

Csomagon kívül

Derivált

f[x_, y_] := (x^3) + (y^4)

D[f[x, y], {x, 2}]

Gradiens

D[f[x, y], {{x, y}}]

Második derivált (Hesse)

D[f[x, y], {{x, y}, 2}]

Jacobi 1.

g[x_, y_] := Sin[x/Cos[y]]

D[{f[x, y], g[x, y]}, {{x, y}}] // MatrixForm

Jacobi 2.

CoordinatesToCartesian[{r, ϑ, φ}, 
      Spherical]

{X[r_, ϑ_, φ_], 
          Y[r_, ϑ_, φ_], 
          Z[r_, ϑ_, φ_]} := 
        Evaluate[
          CoordinatesToCartesian[{r, ϑ, φ}, 
            Spherical]];

{X[r, ϑ, φ], Y[r, ϑ, φ], 
      Z[r, ϑ, φ]}

D[{X[r, ϑ, φ], Y[r, ϑ, φ], 
          Z[r, ϑ, φ]}, {{r, ϑ, φ}}] // MatrixForm

Csomaggal

Grad[5  (x^2) (y^3) (z^4), Cartesian[x, y, z]]

Div[{Sin[5  (x^2)],  Log[(y^3)],  Exp[z]}, 
      Cartesian[x, y, z]]

Curl[{ff[r, ϑ, φ], 
          gg[r, ϑ, φ], 
          hh[r, ϑ, φ]}, 
        Cylindrical[r, ϑ, φ]] // MatrixForm

Div[Grad[5  (x^2) (y^3) (z^4), Cartesian[x, y, z]], 
      Cartesian[x, y, z]]

Laplacian[5  (x^2) (y^3) (z^4), Cartesian[x, y, z]]

Még szép.

JacobianMatrix[Spherical[r, ϑ, φ]] // 
      MatrixForm

JacobianDeterminant[
      Spherical[r, ϑ, φ]]

Integrate[
      (r^2) JacobianDeterminant[
          Spherical[r, ϑ, φ]], {r, 0, 
        2}, {ϑ, 
        0, π}, {φ, -π, π}]

Komplex függvénytan

<< Graphics`InequalityGraphics`

Elemek

ComplexInequalityPlot[
        Abs[(z^3) + 3  (z^2) - (1 + 2  I)]^2 ≤ 
          Abs[z + I]^2, {z}];

Deriválás

Mutassuk meg, hogy az 
     f(z)  =  (x^3)  +  3x(y^2)  +  i ((y^3) + 3(x^2)y)
képlettel értelmezett függvény csak a koordinátatengeleyeken diffrerenciálható (így speciálisan sehol nem reguláris).

u[x_, y_]  =  (x^3)  +  3 x (y^2);
v[x_, y_]  =  (y^3)  +  3 (x^2) y;

CR = {D[u[x, y], x] == D[v[x, y], y], 
        D[u[x, y], y] == -D[v[x, y], x]}

Reduce[CR, {x, y}]

Leképezések

<< Graphics`ComplexMap`

SetOptions[Graphics, Frame -> True];

CartesianMap[Identity, {-5, 5}, {-5, 5}]

CartesianMap[Exp, {-1, 1}, {-2, 2}]

\(CartesianMap[1\/# &, {1.0, 1.01}, {2.0, 2.02}]\)

\(CartesianMap[1\/# &, {1, 3}, {1, 2}]\)

CartesianMap[(1/(# + 3 - I)) &, {1, 3}, {1, 2}]

PolarMap[Identity, {0, 1}, {0, 2 Pi}]

PolarMap[Sqrt, {0, 1}, {-Pi + 0.0001, Pi}]

Integrálás

\(∫\_Γ\%\ \) (1/(z - 2))dz , ahol Γ a 2 középpontú, 1 sugarú körvonal felső fele.

Clear[f, int, t, val, z];
f[z_]  =  (1/(z  -  2));
z[t_]  =  
        2  +  (E^(I t));
int  =  ∫f[z[t]] z'[t] \[DifferentialD]t
\(\(\(val\  = \ ∫\_0\%π f[z[t]] \(z'\)[
            t] \[DifferentialD]t\)\(
\)
    \)\)

Biz., h.   (∫_C^( )) ((exp(z))/(z  -  1))dz  =  i 2 π e,
ahol  C: |z| = 2  pozitív irányítással.

f[z_]  =  ((E^z)/(z - 1));

solset  =  Sort[Solve[Denominator[f[z]] == 0, z]]
Print["f[z] = ", f[z]];
Print["The set of singularities is ", 
        Z = z /. solset];

\(\(Print[\*""\!\(z\_1\) = "", 
        Z[[1]], 
",    Is |", 
        Z[[1]], "| < 2 ?    ", 
        N[Abs[Z[[1]]]] < 
          2];\)\)

The integrand g(z) is to be used is:

g[z_]  =  
        f[z] (z  -  
              Z[[1]]);
Print["g[z] = ", g[z]];

The integral of f(z) taken over C is:

val  =  
        2 π I g[
            Z[[1]]];
Print[" g[z] = ", g[z]];
\(\(Print[\*""   \!\(z\_1\) = "", 
        Z[[1]]];\)\)
\(\(Print[\*""g[\!\(z\_1\)] = "", \ 
        g[Z[[1]]]];\)\)
\(\(Print[\*""\!\(\(∫\_C\% . \)\)((E^z)/(z - 1))\[DifferentialD]z = 2πI g[(Subscript[z, 1])] = "", 
        val];\)\)

Example 6.24,  Page 196.  Show that   (∫_C^( )) ((sin(z))/(4  z  +  π))dz  =  ((- (Sqrt[2]) π i)/4) ,
where  C  is the circle C: |z| = 1  with positive orientation.

Clear[f, i, solset, val, w, z, Z];
f[z_]  =  Sin[z]/(4  z  +  π);
solset  =  Sort[Solve[Denominator[f[z]] == 0, z]];
Print["f[z] = ", f[z]];
Print["The set of singularities is ", 
        Z = z /. solset];

Find the singularity that lie inside C.

\(\(Print[\*""\!\(z\_1\) = "", 
        Z[[1]], 
",    Is |", 
        Z[[1]], "| < 1 ?    ", 
        N[Abs[Z[[1]]]] < 
          1];\)\)

The integrand g(z) is to be used is:

g[z_]  =  
        Simplify[
          f[z] (z  -  
                Z[[1]])];
Print["g[z] = ", g[z]];

The integral of f taken over C is:

val  =  
        2 π I g[
            Z[[1]]];
Print[" g[z] = ", g[z]];
\(\(Print[\*""   \!\(z\_1\) = "", 
        Z[[1]]];\)\)
\(\(Print[\*""g[\!\(z\_1\)] = "", \ 
        g[Z[[1]]]];\)\)
\(\(Print[\*""\!\(\(∫\_C\% . \)\) \!\(Sin[z]\/\(4  z\\  + \\ π\)\)\[DifferentialD]z =  2πI g[(Subscript[z, 1])] = "", 
        val];\)\)

Végtelen sorok

Taylor

Clear[f, S, z];
f[z_]  =  Log[1 - z];
S[z_]  =  Normal[Series[f[z], {z, 0, 17}]];
Print[" f[z] = ", f[z]];
\(\(Print[\*""\!\(S\_17\)[z] = "", S[z]];\)\)

vajh[
        z_]  =  (∑_(n = 1)^∞) ((- (z^n))/n)

Plot[{f[x], S[x]}, {x, -0.99999, 0.99999}, 
        PlotRange -> {{-1, 1}, {-6, 1}}, 
        Ticks -> {Range[-1, 1, 0.5], Range[-6, 1, 1]}, 
        PlotStyle -> {Red, Green}, 
        AxesLabel -> {"x", "s"}];

Plot[f[x] - S[x], {x, -0.99999, 0.99999}, 
        PlotRange -> {{-1, 1}, {-6, 1}}, 
        Ticks -> {Range[-1, 1, 0.5], Range[-6, 1, 1]}, 
        PlotStyle -> {Blue}, 
        AxesLabel -> {"x", "s"}];

{(∑_(n = 0)^∞)(n + 
              1) (z^n),   (∑_(n = 0)^∞) (z^(2  n))}

MacLaurin

Clear[f, S, z];
f[z_]  =  Sin[z]^3
S[z_]  =  Normal[Series[f[z], {z, 0, 25}]]

f1[z_]  = 
        PowerExpand[(∑_(n = 0)^∞)(((((-1))^n) 3)/(4 (2  n + 1)!)) (z^(2  n + 1))];
f2[z_]  =  
        PowerExpand[(∑_(n = 0)^∞)((- (((-1))^n) 3 (9^n))/(4 (2  n + 1)!)) (z^(2  n + 1))];
f[z_]  =  
        Factor[f1[z]  +  f2[z],  Trig -> True];
\(\(Print[\*""(Subscript[f, 1])[z] = (∑_(n = 0)^∞)\!\(\(\((\(-1\))\)\^n\\ 3\)\/\(4 \(\((2  n + 1)\)!\)\)\) (z^(2  n + 1)) =  "", f1[z]];\)\)
\(\(Print[\*""(Subscript[f, 2])[z] = (∑_(n = 0)^∞)\!\(\(\(-\\ \((\(-1\))\)\^n\)\\ 3\\ 9\^n\)\/\(4 \(\((2  n + 1)\)!\)\)\) (z^(2  n + 1)) =  "", f2[z]];\)\)
\(\(Print[\*"" f[z] = \!\(f\_1\)[z] + \!\(f\_2\)[z] = "", \ 
        f1[z]\  + \ f2[z]];\)\)
Print[" f[z] = ", f[z]];

Laurent

Clear[f, L, S, S9, S11, S12, S21, S22, Sinf, z];
f[z_]  =  ((E^z)/(z^3))
S[z_]  =  
      Normal[Series[(E^z), {z, 0, 9}]]/(z^3)
L[z_]  =  Normal[Series[f[z], {z, 0, 6}]]

The latter is a Laurent series is valid for 0 < |z|.

Sum up the terms to verify that we have things right.

S9[z_]  =  (∑_(n = 0)^9) ((z^(n - 3))/(n!))
valoban[
        z_]  =   (∑_(n = 0)^∞) ((z^(n - 3))/(n!))

Háromféle Laurent-sor

f[z_]  =  (3/(2  +  z  -  (z^2)));

Apart[f[z]]

Maclaurin, pozitív kitevős hatványok, |z|<1

S0[z_]  =  Normal[Series[f[z], {z, 0, 7}]]

Helyettesítés: z ↦ (1/Z), sorbafejtés Z = 0 körül, visszatrafó, |z|>2

SI[z_]  =  Normal[Series[f[z], {z, ∞, 10}]]

Mi van a gyűrűben?

ComplexInequalityPlot[1 < Abs[z] < 2, {z}]

Összegre bontjuk, külön sorbafejtjük 0 és ∞ körül.

A  =  Apart[f[z]]

f1[z_]  =  A[[2]]
f2[z_]  =  A[[1]]

Now form Laurent expansions for the two parts  (Subscript[f, 1])(z)  and  (Subscript[f, 2])(z)  of  f(z).

S11[z_]  =  Normal[Series[f1[z], {z, 0, 12}]];
S12[z_]  =  
        Normal[Series[f1[z], {z, ∞, 11}]];
S21[z_]  =  Normal[Series[f2[z], {z, 0, 12}]];
S22[z_]  =  
        Normal[Series[f2[z], {z, ∞, 12}]];
\(\(Print[\*""\!\(S\_11\)[z] = "", S11[z]];\)\)
\(\(Print[\*""\!\(S\_12\)[z] = "", S12[z]];\)\)
\(\(Print[\*""\!\(S\_21\)[z] = "", S21[z]];\)\)
\(\(Print[\*""\!\(S\_22\)[z] = "", S22[z]];\)\)

Az  L1(z)  =  S11(z) + S21(z)  Laurent-sor itt konv.: |z| < 1.

L1[z_]  =  S11[z]  +  S21[z];
\(\(Print[\*""\!\(L\_1\)[z] = "", L1[z]];\)\)

\(\(Print[f[x], \*"" és  \!\(L\_1\)[z]""];\)\)
Plot[{f[x], L1[x]}, {x, 0.0, 0.999999}, 
        PlotRange -> {{0, 1}, {1, 2}}, 
        Ticks -> {Range[0, 1, 0.2], Range[1, 2, 0.2]}, 
        PlotStyle -> {RGBColor[1, 0, 0], 
            RGBColor[0, 1, 0]}];

L2(z)  =  S12(z) + S21(z)  konv, ha 1 < |z| < 2.

L2[z_]  =  S12[z]  +  S21[z]

\(\(Print[f[x], \*""  és \!\(L\_2\)[x]""];\)\)
\(\(Plot[{f[x], L2[x]}, {x, 1.0001, 
          1.9999}, 
\ \ PlotRange -> {{1, 2}, {0, 7}}, 
        Ticks -> {Range[1, 2, 0.2], Range[0, 7, 1]}, 
        PlotStyle -> {RGBColor[1, 0, 0], 
            RGBColor[0, 1, 0]}];\)\)

L1(z) is nem jó, ha  1 < |z| < 2.

Print[" f[1.5] = ", f[1.5]];
\(\(Print[\*""\!\(L\_1\)[1.5] = "", L1[1.5]];\)\)
Print[" f[1.5] = ", f[1.5]];
\(\(Print[\*""\!\(L\_2\)[1.5] = "", L2[1.5]];\)\)

L3(z)  :=  S12(z) + S22(z)  konv.: 2 < |z| .

L3[z_]  =  S12[z]  +  S22[z]

\(\(Print[f[x], \*""  és \!\(L\_3\)[x]""];\)\)
\(\(Plot[{f[x], L3[x]}, {x, 2.0001, 
          4.0}, 
\ \ PlotRange -> {{2, 4}, {\(-6\), 0}}, 
        Ticks -> {Range[2, 4, 0.2], Range[\(-6\), 0, 1]}, 
        PlotStyle -> {RGBColor[1, 0, 0], 
            RGBColor[0, 1, 0]}];\)\)

L1(z) és L2(z)  nem jó, ha  2< |z|.

Print[" f[4.0] = ", f[4.0]];
\(\(Print[\*""\!\(L\_1\)[4.0] = "", L1[4.0]];\)\)
Print[" f[4.0] = ", f[4.0]];
\(\(Print[\*""\!\(L\_2\)[4.0] = "", L2[4.0]];\)\)
Print[" f[4.0] = ", f[4.0]];
\(\(Print[\*""\!\(L\_3\)[4.0] = "", L3[4.0]];\)\)

Soha nem konv. Miért is?

L4[z_]  =  S11[z]  +  S22[z]

In the above series, when  |z| < (1/2)  the portion of the series with positive exponents will
converge but the portion with negative exponents will diverge. Similarly, when |z| > 1 the 
portion of the series with negative exponents will converge, but the portion of the series
with positive exponents will diverge.   Hence, the series diverges for all  z.

Print[" f[0.5] = ", f[0.5]];
\(\(Print[\*""\!\(L\_4\)[0.5] = "", L4[0.5]];\)\)
Print[" f[1.5] = ", f[1.5]];
\(\(Print[\*""\!\(L\_4\)[1.5] = "", L4[1.5]];\)\)
Print[" f[4.0] = ", f[4.0]];
\(\(Print[\*""\!\(L\_4\)[4.0] = "", L4[4.0]];\)\)