file:   anal3_2het.m
author: Polcz Péter <ppolcz@gmail.com>
Created on 2016.09.30. Friday, 12:57:31

Contents

2. het HF1

syms R u v x y z real
r = [x;y;z];

C = [
    R*cos(v)*cos(u)
    R*cos(v)*sin(u)
    R*sin(v)
    ];

J = jacobian(C,[R;u;v])
simplify(det(J))

C = [
    R*sin(v)*cos(u)
    R*sin(v)*sin(u)
    R*cos(v)
    ];

J = jacobian(C,[R;u;v])
simplify(det(J))

assume([R > 0, in(R, 'real')])
assume([0 <= v < pi, in(v, 'real')])
dS_vec = simplify(-vekanal_cross(diff(C,u), diff(C,v)))
dS = simplify(norm(dS_vec))

fprintf('%s = %s %s \n= %s %s\n', '\mathrm{d}\vec{S}', ...
    pcz_latex(R*sin(v)), ...
    pcz_latex(simplify(dS_vec / R / sin(v))), ...
    pcz_latex(R*sin(v)), ...
    pcz_latex(r))

F = [y;x;z];

Integrand = simplify(subs(F,r,C)' * dS_vec);
pretty(Integrand)

expand(Integrand)

Integrand_u = int(Integrand, u, 0, 2*pi)
Integrand_uv = int(Integrand_u, v, 0, pi/2)

disp 'Tehat a fluxus: '
pretty(Integrand_uv)
 
J =
 
[ cos(u)*cos(v), -R*cos(v)*sin(u), -R*cos(u)*sin(v)]
[ cos(v)*sin(u),  R*cos(u)*cos(v), -R*sin(u)*sin(v)]
[        sin(v),                0,         R*cos(v)]
 
 
ans =
 
R^2*cos(v)
 
 
J =
 
[ cos(u)*sin(v), -R*sin(u)*sin(v), R*cos(u)*cos(v)]
[ sin(u)*sin(v),  R*cos(u)*sin(v), R*cos(v)*sin(u)]
[        cos(v),                0,       -R*sin(v)]
 
 
ans =
 
-R^2*sin(v)
 
 
dS_vec =
 
 R^2*cos(u)*sin(v)^2
 R^2*sin(u)*sin(v)^2
    (R^2*sin(2*v))/2
 
 
dS =
 
R^2*sin(v)
 
\mathrm{d}\vec{S} = R \sin(v) \left[\begin{array}{c} R \cos(u) \sin(v) \\ R \sin(u) \sin(v) \\ R \cos(v) \end{array}\right] 
= R \sin(v) r = \left[\begin{array}{c} x \\ y \\ z \end{array}\right]
 3               2                         2
R  sin(v) (cos(v)  + 2 cos(u) sin(u) sin(v) )

 
ans =
 
R^3*cos(v)^2*sin(v) + 2*R^3*cos(u)*sin(u)*sin(v)^3
 
 
Integrand_u =
 
-2*pi*R^3*sin(v)*(sin(v)^2 - 1)
 
 
Integrand_uv =
 
(2*pi*R^3)/3
 
Tehat a fluxus: 
      3
2 pi R
-------
   3

2. het HF2

syms R u v x y z real
r = [x;y;z];

C = [
    R*cos(u)
    R*sin(u)
    v
    ];

J = jacobian(C,[R;u;v])
simplify(det(J))

assume([R > 0, in(R, 'real')])
assume([0 <= v < 4, in(v, 'real')])
dS_vec = simplify(vekanal_cross(diff(C,u), diff(C,v)))
dS = simplify(norm(dS_vec))

dS23_vec = simplify(vekanal_cross(diff(C,u), diff(C,R)))
dS23 = simplify(norm(dS23_vec))

fprintf('%s = %s %s \n= %s %s\n', '\mathrm{d}\vec{S}', ...
    pcz_latex(R*sin(v)), ...
    pcz_latex(simplify(dS_vec / R / sin(v))), ...
    pcz_latex(R*sin(v)), ...
    pcz_latex(r))

F = [x^2;y^2;0];

Integrand = simplify(subs(F,r,C)' * dS_vec);
pretty(Integrand)
expand(Integrand)

Integrand_u = int(Integrand, u, 0, 2*pi)
Integrand_uv = int(Integrand_u, v, 0, 4)

disp 'Tehat a fluxus: '
pretty(Integrand_uv)
 
J =
 
[ cos(u), -R*sin(u), 0]
[ sin(u),  R*cos(u), 0]
[      0,         0, 1]
 
 
ans =
 
R
 
 
dS_vec =
 
 R*cos(u)
 R*sin(u)
        0
 
 
dS =
 
R
 
 
dS23_vec =
 
  0
  0
 -R
 
 
dS23 =
 
R
 
\mathrm{d}\vec{S} = R \sin(v) \left[\begin{array}{c} \frac{\cos(u)}{\sin(v)} \\ \frac{\sin(u)}{\sin(v)} \\ 0 \end{array}\right] 
= R \sin(v) r = \left[\begin{array}{c} x \\ y \\ z \end{array}\right]
 3        3         3
R  (cos(u)  + sin(u) )

 
ans =
 
R^3*cos(u)^3 + R^3*sin(u)^3
 
 
Integrand_u =
 
0
 
 
Integrand_uv =
 
0
 
Tehat a fluxus: 
0

2. het D3*

syms x y z real
r = [x;y;z];
f = 1 / norm(r);
F = simplify(jacobian(f,r))'
pretty(F)
vekanal_div(F)
simplify(vekanal_div(F))

C = [
    R*sin(v)*cos(u)
    R*sin(v)*sin(u)
    R*cos(v)
    ];

assume([R > 0, in(R, 'real')])
assume([0 <= v < pi, in(v, 'real')])
dS_vec = simplify(-vekanal_cross(diff(C,u), diff(C,v)))
dS = simplify(norm(dS_vec))

fprintf('%s = %s %s \n= %s %s\n', '\mathrm{d}\vec{S}', ...
    pcz_latex(R*sin(v)), ...
    pcz_latex(simplify(dS_vec / R / sin(v))), ...
    pcz_latex(R*sin(v)), ...
    pcz_latex(r))

Integrand = simplify(subs(F,r,C)' * dS_vec);

disp 'Integrand:'
pretty(Integrand)

Integrand_u = int(Integrand, u, 0, 2*pi)
Integrand_uv = int(Integrand_u, v, 0, pi)
 
F =
 
 -x/(x^2 + y^2 + z^2)^(3/2)
 -y/(x^2 + y^2 + z^2)^(3/2)
 -z/(x^2 + y^2 + z^2)^(3/2)
 
/           x         \
| - ----------------- |
|     2    2    2 3/2 |
|   (x  + y  + z )    |
|                     |
|           y         |
| - ----------------- |
|     2    2    2 3/2 |
|   (x  + y  + z )    |
|                     |
|           z         |
| - ----------------- |
|     2    2    2 3/2 |
\   (x  + y  + z )    /

 
ans =
 
(3*x^2)/(x^2 + y^2 + z^2)^(5/2) - 3/(x^2 + y^2 + z^2)^(3/2) + (3*y^2)/(x^2 + y^2 + z^2)^(5/2) + (3*z^2)/(x^2 + y^2 + z^2)^(5/2)
 
 
ans =
 
0
 
 
dS_vec =
 
 R^2*cos(u)*sin(v)^2
 R^2*sin(u)*sin(v)^2
    (R^2*sin(2*v))/2
 
 
dS =
 
R^2*sin(v)
 
\mathrm{d}\vec{S} = R \sin(v) \left[\begin{array}{c} R \cos(u) \sin(v) \\ R \sin(u) \sin(v) \\ R \cos(v) \end{array}\right] 
= R \sin(v) r = \left[\begin{array}{c} x \\ y \\ z \end{array}\right]
Integrand:
-sin(v)

 
Integrand_u =
 
-2*pi*sin(v)
 
 
Integrand_uv =
 
-4*pi