```python
import numpy as np
import sympy as sp
import pandas as pd
import math

import final as p1

import matplotlib.pyplot as plt

%matplotlib inline
```

# Final

## Chinmai Raman

### 5/21/2016

Given three real-valued functions of time x(t), y(t), z(t), consider the following coupled first-order ODEs:

$x˙ = −y − z, y˙ = x + ay, z˙ = b + z(x − c)$

where a = b = 0.2 and c is a parameter that we will tune. Note that this system has a single nonlinear term
xz. 

I will be exploring the consequences of this nonlinearity.

### Problem 1 (c = 2)


```python
ros = p1.Rossler(2)
ros.run()
```


```python
ros.plotx()
```


```python
ros.ploty()
```


```python
ros.plotz()
```


```python
ros.plotxy()
```


```python
ros.plotyz()
```


```python
ros.plotxz()
```


```python
ros.plotxyz()
```

### Problem 2 (c = 2, 3, 4, 4.15, 4.2, 5.7)

c = 2 is plotted above

### c = 3


```python
ros3 = p1.Rossler(3)
ros3.run()
```


```python
ros3.plotx()
```


```python
ros3.plotxy()
```


```python
ros3.plotxyz()
```

Already we can see a bifurcation occuring in the y vs x and z vs y vs x graphs that were not there in the case of c =2. The nonlinearity in the z variable has begun to become active in that the trajectory is leaving the x-y plane. 

The x vs t graph shows us that the x-values are now alternating between four values, as opposed to two previously. This is identical to the behavior we saw from the logistic update map on the midterm.

### c = 4


```python
ros4 = p1.Rossler(4)
ros4.run()
```


```python
ros4.plotx()
```


```python
ros4.plotxy()
```


```python
ros4.plotxyz()
```

Another bifurcation has now occured and is apparent in the y vs x graph. The limits of the x-values are now eight-fold; the number of values that x converges to has doubled again. The influence of the non-linearity in z is now very obvious.

### c = 4.15


```python
ros415 = p1.Rossler(4.15)
ros415.run()
```


```python
ros415.plotx()
```


```python
ros415.plotxy()
```


```python
ros415.plotxyz()
```

The period doubling is occuring at an increasing rate. This is demonstrated by the thicker lines in the xy and xyz graphs. This period doubling phase will soon end as the system approaches complete chaos and the our predictive power decreases greatly.

### c = 4.2


```python
ros42 = p1.Rossler(4.2)
ros42.run()
```


```python
ros42.plotx()
```


```python
ros42.plotxy()
```


```python
ros42.plotxyz()
```

The lines are getting thicker as the bifurcations increase at an increasing rate. It is now not immediately apparent how many asymptotic values x approaches from the x vs t graph.

### c = 5.7


```python
ros57 = p1.Rossler(5.7)
ros57.run()
```


```python
ros57.plotx()
```


```python
ros57.plotxy()
```


```python
ros57.plotxyz()
```

The period doubling cascade has given rise to a chaotic attractor with a single lobe. This is an example of spiral-type chaos and exhibits the characteristic sensitivity to initial conditions. The oscillations in the x vs t graph are now completely chaotic and irregular in amplitude. The logistic update map also displays the same behavior of a period doubling cascade giving rise to a chaotic system. As we increase c, this system, like the logistic update map from the midterm as ve vary initial conditions, also demonstrates the stretching and folding quality that we discussed in class. The xyz graph is also reminiscent of a mobius strip in that the underside becomes the upperside via the portion of the graph not in the x-y plane.

### Problem 3


```python
p1.plotmaxima('x')
```


```python
p1.plotmaxima('y')
```


```python
p1.plotmaxima('z')
```

The diagram of the local maxima of x vs c shows the bifurcation in maxima as c increases. The first bifurcation in x-values occurs around 2.7. The next occurs around 3.7, followed by one around 4.2. The system attains chaos around 5.7, at which point our predictive power of the asymptotic x-values is gone. This behavior is similar to that from the logistic update map from the midterm. The local maxima of y vs c plot is similar to the x vs c, except that the graph is squished downward. The bifurcations occur at the same values, however. The z maxima vs c graph is particularly interesting, because the majority of maxima occur at values below five, but there is a small chain of maxima that continue to increase in value as c increases. These maxima constitute the lobe that exits the x-y plane as show in the xyz graph from problem 1.

Unfortunately, python was taking too long for me to use the required mesh spacing of 0.001, so I simply used as many points as I could for the bifurcation diagram without ipython having to take an hour to visualize a single plot instead. I assume that this would have worked much faster in Julia. Hopefully, the diagrams are still relatively clear.


```python

```

c48dc89c7fefe19c196736ccb6966f2e1f29999d
ipynb
Jupyter Notebook
Final.ipynb
ChinmaiRaman/phys227-final
902609af9369eaa39fb7c790eb073d8a2e0c67ab
MIT
Final.ipynb
ChinmaiRaman/phys227-final
902609af9369eaa39fb7c790eb073d8a2e0c67ab
MIT
Final.ipynb
ChinmaiRaman/phys227-final
902609af9369eaa39fb7c790eb073d8a2e0c67ab
MIT
Qwen/Qwen-72B
1. YES
2. YES