Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Latest commit 423fcb7 Jan 29, 2021 History
1 contributor

Users who have contributed to this file

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 2 16:17:27 2018
@author: nolte
Introduction to Modern Dynamics, 2nd edition (Oxford University Press, 2019)
Lozi discrete map
"""
import numpy as np
from scipy import integrate
from matplotlib import pyplot as plt
#plt.close('all')
B = -1
C = 0.5
np.random.seed(2)
plt.figure(1)
for eloop in range(0,100):
xlast = np.random.normal(0,1,1)
ylast = np.random.normal(0,1,1)
xnew = np.zeros(shape=(500,))
ynew = np.zeros(shape=(500,))
for loop in range(0,500):
xnew[loop] = 1 + ylast - C*abs(xlast)
ynew[loop] = B*xlast
xlast = xnew[loop]
ylast = ynew[loop]
plt.plot(np.real(xnew),np.real(ynew),'o',ms=1)
plt.xlim(xmin=-1.25,xmax=2)
plt.ylim(ymin=-2,ymax=1.25)
plt.savefig('Lozi')