# Shell geometry

## Init symbols for *sympy*


```python
from sympy import *
from geom_util import *
from sympy.vector import CoordSys3D
import matplotlib.pyplot as plt
import sys
sys.path.append("../")

%matplotlib inline

%reload_ext autoreload
%autoreload 2
%aimport geom_util
```


```python
# Any tweaks that normally go in .matplotlibrc, etc., should explicitly go here
%config InlineBackend.figure_format='retina'
plt.rcParams['figure.figsize'] = (12, 12)

    
plt.rc('text', usetex=True)
    
plt.rc('font', family='serif')
# SMALL_SIZE = 42
# MEDIUM_SIZE = 42
# BIGGER_SIZE = 42
    
# plt.rc('font', size=SMALL_SIZE)          # controls default text sizes
# plt.rc('axes', titlesize=SMALL_SIZE)     # fontsize of the axes title
# plt.rc('axes', labelsize=MEDIUM_SIZE)    # fontsize of the x and y labels
# plt.rc('xtick', labelsize=SMALL_SIZE)    # fontsize of the tick labels
# plt.rc('ytick', labelsize=SMALL_SIZE)    # fontsize of the tick labels
# plt.rc('legend', fontsize=SMALL_SIZE)    # legend fontsize
# plt.rc('figure', titlesize=BIGGER_SIZE)  # fontsize of the figure title

init_printing()
```


```python
N = CoordSys3D('N')
alpha1, alpha2, alpha3 = symbols("alpha_1 alpha_2 alpha_3", real = True, positive=True)
```

## Cylindrical coordinates


```python
R, L = symbols("R L", real = True, positive=True)
```


```python
a1 = pi / 2 + (L / 2 - alpha1)/R

x = (R + alpha3)* cos(a1)
y = alpha2
z = (R + alpha3) * sin(a1)

r = x*N.i + y*N.j + z*N.k
```


```python
R1=r.diff(alpha1)
R2=r.diff(alpha2)
R3=r.diff(alpha3)
```


```python
R1
```


```python
R2
```


```python
R3
```

### Draw


```python
import plot

%aimport plot

alpha1_x = lambdify([R, L, alpha1, alpha3], x, "numpy")
alpha3_z = lambdify([R, L, alpha1, alpha3], z, "numpy")

R_num = 1/0.8
L_num = 2
h_num = 0.1

x1_start = 0
x1_end = L_num
x3_start = -h_num/2
x3_end = h_num/2

def alpha_to_x(a1, a2, a3):
    x=alpha1_x(R_num, L_num, a1, a3)
    z=alpha3_z(R_num, L_num, a1, a3)
    return x, 0, z
    

plot.plot_init_geometry_2(x1_start, x1_end, x3_start, x3_end, alpha_to_x)
```


```python
%aimport plot

R3_1=R3.dot(N.i)
R3_3=R3.dot(N.k)

R3_1_x = lambdify([R, L, alpha1, alpha3], R3_1, "numpy")
R3_3_z = lambdify([R, L, alpha1, alpha3], R3_3, "numpy")

def R3_to_x(a1, a2, a3):
    x=R3_1_x(R_num, L_num, a1, a3)
    z=R3_3_z(R_num, L_num, a1, a3)
    return x, 0, z

plot.plot_vectors(x1_start, x1_end, 0, alpha_to_x, R3_to_x)
```


```python
%aimport plot

R1_1=R1.dot(N.i)
R1_3=R1.dot(N.k)

R1_1_x = lambdify([R, L, alpha1, alpha3], R1_1, "numpy")
R1_3_z = lambdify([R, L, alpha1, alpha3], R1_3, "numpy")

def R1_to_x(a1, a2, a3):
    x=R1_1_x(R_num, L_num, a1, a3)
    z=R1_3_z(R_num, L_num, a1, a3)
    return x, 0, z

plot.plot_vectors(x1_start, x1_end, 0, alpha_to_x, R1_to_x)
```

### Lame params


```python
H1 = 1+alpha3/R
H2=S(1)
H3=S(1)

H=[H1, H2, H3]
DIM=3
dH = zeros(DIM,DIM)
for i in range(DIM):
    dH[i,0]=H[i].diff(alpha1)
    dH[i,1]=H[i].diff(alpha2)
    dH[i,2]=H[i].diff(alpha3)

dH
    
```

dedbf7b9a1bdafcc617bf6b2d105ca35be590c76
ipynb
Jupyter Notebook
py/notebooks/.ipynb_checkpoints/MatricesForPlaneShells-checkpoint.ipynb
tarashor/vibrations
fcbadd545e2a8f1ef4b4bff399b396ee5f16924b
MIT
2018-02-05T18:05:08.000Z
2018-02-05T18:05:08.000Z
py/notebooks/MatricesForPlaneShells.ipynb
tarashor/vibrations
fcbadd545e2a8f1ef4b4bff399b396ee5f16924b
MIT
py/notebooks/MatricesForPlaneShells.ipynb
tarashor/vibrations
fcbadd545e2a8f1ef4b4bff399b396ee5f16924b
MIT
Qwen/Qwen-72B
1. YES
2. YES