```python
from bateman import bateman_full
from sympy import symbols
from scipy.optimize import brentq
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
sp.init_printing()
%matplotlib inline
```


```python
args = t, x0, y0, z0, p, q = symbols('t x0 y0 z0 p q', real=True)
analytic = bateman_full([x0, y0, z0], [p, q, 0], t, exp=sp.exp)
```


```python
# sp.solve(analytic[1] - analytic[2], t)  # raises NotImplementedError
```


```python
fx, fy, fz = [sp.lambdify(args, analytic[idx]) for idx in range(3)]
xy = sp.lambdify(args, analytic[0] - analytic[1])
xz = sp.lambdify(args, analytic[0] - analytic[2])
yz = sp.lambdify(args, analytic[1] - analytic[2])
params = 1, 0, 0, 7, 3
def fxy(x):
    return xy(x, *params)

def fxz(x):
    return xz(x, *params)

def fyz(x):
    return yz(x, *params)

f = [fxy, fxz, fyz]
```


```python
zeros = xy0, xz0, yz0 = [brentq(func, *bounds) for func, bounds in zip(f, [(.05, .15), (.15, .3), (.3, .4)])]
```


```python
x = np.linspace(0, .5)
y = np.array(bateman_full([1, 0, 0], [7, 3, 0], x, exp=np.exp)).T
fig, ax = plt.subplots(1, 1, figsize=(14, 8))
ax.vlines(zeros, 0, 1, transform=ax.get_xaxis_transform(), linestyle='--')
ax.plot(zeros, [func(x, *params) for func, x in zip([fx, fx, fy], zeros)], 'or', markerfacecolor='None', markersize=15)
ax.plot(x, y)
print(zeros)
```


```python

```


```python
iv2 = [1, .1, 0]
params2 = iv2 + [7, 3]
xy2 = sp.lambdify(args, analytic[0] - 3*analytic[1])
xz2 = sp.lambdify(args, analytic[0] - 3*analytic[2])
yz2 = sp.lambdify(args, 3*analytic[1] - analytic[2])

def fxy2(x):
    return xy2(x, *params2)

def fxz2(x):
    return xz2(x, *params2)

def fyz2(x):
    return yz2(x, *params2)

f2 = [fxy2, fxz2, fyz2]
zeros2 = xy02, xz02, yz02 = [brentq(func, *bounds) for func, bounds in zip(f2, [(.0, .1), (.05, .15), (.4, .8)])]
x2 = np.linspace(0, .8)
y2 = np.array(bateman_full(iv2, [7, 3, 0], x2, exp=np.exp)).T
fig2, ax2 = plt.subplots(1, 1, figsize=(14, 8))
ax2.vlines(zeros2, 0, 1, transform=ax2.get_xaxis_transform(), linestyle='--')
ax2.plot(zeros2, [func(x, *params2) for func, x in zip([fx, fx, fz], zeros2)], 'or', markerfacecolor='None', markersize=15)
ax2.plot(x2, y2)
print(zeros2)
```


```python

```

175610218ddde6d4851216c327b8e5b70ec10524
ipynb
Jupyter Notebook
pyodesys/tests/test_symbolic__test_PartiallySolvedSystem__roots.ipynb
slayoo/pyodesys
8e1afb195dadf6c6f8e765873bc9dd0fae067c39
BSD-2-Clause
2015-09-29T16:51:03.000Z
2022-02-02T13:26:50.000Z
pyodesys/tests/test_symbolic__test_PartiallySolvedSystem__roots.ipynb
slayoo/pyodesys
8e1afb195dadf6c6f8e765873bc9dd0fae067c39
BSD-2-Clause
2015-09-29T14:40:45.000Z
2021-09-18T19:29:50.000Z
pyodesys/tests/test_symbolic__test_PartiallySolvedSystem__roots.ipynb
slayoo/pyodesys
8e1afb195dadf6c6f8e765873bc9dd0fae067c39
BSD-2-Clause
2016-03-18T14:00:39.000Z
2021-09-17T13:54:29.000Z
Qwen/Qwen-72B
1. YES
2. YES