```python
import sympy
t, K ,r, P0, C1 = sympy.symbols('t, K, r, P_0, C_1')
P = sympy.Function('P')
edo = P(t).diff(t) - r * P(t) * (1 - P(t)/K)
edo
```




$\displaystyle - r \left(1 - \frac{P{\left(t \right)}}{K}\right) P{\left(t \right)} + \frac{d}{d t} P{\left(t \right)}$




```python
edo_sol = sympy.dsolve(edo, P(t))
edo_sol
```




$\displaystyle P{\left(t \right)} = \frac{K e^{C_{1} K + r t}}{e^{C_{1} K + r t} - 1}$




```python
ini_cond = {P(0): P0}
ini_cond
```




    {P(0): P_0}




```python
C_eq = edo_sol.subs(t,0).subs(ini_cond)
C_eq
```




$\displaystyle P_{0} = \frac{K e^{C_{1} K}}{e^{C_{1} K} - 1}$




```python
import matplotlib.pyplot as plt
import numpy as np
def logistica(t, P0=100, K=1000, r=0.25):
    A = P0 / (P0 - K)
    return K / (1 - np.exp(-r*t) / A)
```


```python
t = np.linspace(0, 40, 100)  # Intervalo de tiempo en que se obtiene la solución
p1 = plt.plot(t, logistica(t, P0 = 100), label=r'$P_0 = 100$')
p1 = plt.plot(t, logistica(t, P0 = 2000), label=r'$P_0 = 1500$')
plt.legend()
plt.show()
```

47271a62c6a94c6beb38ab10e3b5c89be877cb68
ipynb
Jupyter Notebook
example/equations_and_graphs.ipynb
facundobatista/jupynotex
87df3aa14a115854fbfe8f5152df5a8390796eae
Apache-2.0
2020-10-21T20:28:52.000Z
2021-05-03T22:49:58.000Z
example/equations_and_graphs.ipynb
facundobatista/jupynotex
87df3aa14a115854fbfe8f5152df5a8390796eae
Apache-2.0
2020-10-12T13:31:52.000Z
2021-12-02T18:39:50.000Z
example/equations_and_graphs.ipynb
facundobatista/jupynotex
87df3aa14a115854fbfe8f5152df5a8390796eae
Apache-2.0
Qwen/Qwen-72B
1. YES
2. YES