Creating bell like shape using numpy


```python
import numpy as np
```


```python
import matplotlib.pyplot as plt
```


```python
import sympy
```


```python
df = 300
db = 16
r = 800
```


```python
a,b,c,x = sympy.symbols('a b c x')
```


```python
p = 0.7
```


```python
func= a/(x+b)**p + c
```


```python
eq1 = sympy.Eq(func.subs(x,0),df)
```


```python
eq2 = sympy.Eq(func.subs(x,120),60)
```


```python
eq3 = sympy.Eq(func.subs(x,r),db)
```


```python

```


```python
sympy.mpmath.findroot([eq1,eq2,eq3],[a,b,c])
```


```python
xx = np.linspace(0,r,801,endpoint = True)
```


```python
yy = np.zeros(len(xx),dtype=float)
```


```python
len(yy)
```




    801




```python
p = 0.75
for i in range(len(xx)):
    yy[i] = bell(xx[i],0.5)
```


```python
plt.plot(xx,yy)
```


```python
# reverse data
rx = xx[::-1]
ry = yy[::-1]
```


```python
# export data as a bell.xmen
f = open('../sample/bell.xmen','w')
for i in range(len(rx)-1):
    f.write('{0},{1},{2}\n'.format(ry[i],ry[i+1],-rx[i+1]+rx[i]))
f.close()
```


```python

```

82d12b1fe3840dde4ec096447636fe64f9ad2146
ipynb
Jupyter Notebook
doc/.ipynb_checkpoints/make_bell-checkpoint.ipynb
Yoshinobu-Ishizaki/calcimp.jl
4db7fcfd0c34954e5949c7fe281584c183f3ac55
MIT
doc/.ipynb_checkpoints/make_bell-checkpoint.ipynb
Yoshinobu-Ishizaki/calcimp.jl
4db7fcfd0c34954e5949c7fe281584c183f3ac55
MIT
doc/.ipynb_checkpoints/make_bell-checkpoint.ipynb
Yoshinobu-Ishizaki/calcimp.jl
4db7fcfd0c34954e5949c7fe281584c183f3ac55
MIT
Qwen/Qwen-72B
1. YES
2. YES