# Papoulis

    TODO


```python
import sys
sys.path.append('../lib')

import sympy
import sympy.functions.elementary.exponential as symExp
import numpy as np
import matplotlib.pyplot as plt
import visuals
import auxlib
```


```python
c, t, U = sympy.symbols('c, t, U')
```


```python
f = c*symExp.exp(-c*t)
f
```




$\displaystyle c e^{- c t}$




```python
paramsToSub = {c:2}
```


```python
auxlib.integrateFunc(f, t, bounds=[0, sympy.oo], paramsToSub=paramsToSub)
```




$\displaystyle 1$




```python
func_int = auxlib.integrateFunc(f, t, paramsToSub=paramsToSub, conds='piecewise') 
func_int - auxlib.get_constant()
```




$\displaystyle - e^{- 2 t}$



sympy.limit(q, t, sympy.oo)

$\infty$


```python
from sympy.utilities.lambdify import lambdify
func = lambdify(t, func_int - auxlib.get_constant(), 'scipy') # returns a numpy-ready function1
func
```




    <function _lambdifygenerated(t)>




```python
interval = np.linspace(-1, 5, num=1000)
values = func(interval)
```

def pdfInfo(interval, values, rng, xlim=None):
    fig, ax = plt.subplots()
    ax.plot(interval, values, 'k')
    
    if not np.isscalar(rng) and len(rng)==1:
        rng = rng[0]
    
    if not np.isscalar(rng):
        x_1 = np.argmax(interval>rng[0])
        x_2 = np.argmax(interval>rng[1])
        ax.fill_between(np.linspace(rng[0], rng[1], num=len(values[x_1:x_2])), values[x_1:x_2], color='k')
    else:
        x = np.argmax(interval>rng)
        x_0 = interval[0]
        ax.fill_between(np.linspace(x_0, rng, num=len(values[0:x])), values[0:x], color='k')
        
    ax.axhline(0, c='k', alpha=.5)
    ax.axvline(0, c='k', alpha=.5)
         
    ax.yaxis.grid(b=True, which='minor', color='k', linestyle='--', alpha=.2, zorder=0) 
    ax.yaxis.grid(b=True, which='major', color='k', linestyle='--', alpha=.5, zorder=0) 

    ax.set_facecolor('xkcd:white')
    ax.spines["top"].set_visible(False)
    ax.spines["right"].set_visible(False)
    ax.spines["left"].set_visible(False)
    ax.spines["bottom"].set_visible(False)
    
    if xlim != None:
         ax.set_xlim(xlim)


```python
visuals.plotPdf(interval, values, [-.5, 3], xlim=[-2, 7])
```

ecf8b3c9c4365c72e0b53c4e1439388bdac1f903
ipynb
Jupyter Notebook
Probability/pdfExploration.ipynb
carlos-faria/Stochastic-Processes
2ee57a1029566b606af781ec5d307eb33434fb79
MIT
Probability/pdfExploration.ipynb
carlos-faria/Stochastic-Processes
2ee57a1029566b606af781ec5d307eb33434fb79
MIT
Probability/pdfExploration.ipynb
carlos-faria/Stochastic-Processes
2ee57a1029566b606af781ec5d307eb33434fb79
MIT
Qwen/Qwen-72B
1. YES
2. YES