コード例 #1
0
from pyndamics import Simulation

# <codecell>

sim=Simulation()
sim.add("x'=sigma*(y-x)",14,plot=True)
sim.add("y'=x*(rho-z)-y",8.1,plot=True)
sim.add("z'=x*y-beta*z",45,plot=True)
sim.params(sigma=10,beta=8.0/3,rho=50)
sim.run(0,50,num_iterations=10000)  # increase the resolution

# <codecell>

rho=linspace(10,30,200)
results=sim.repeat(0,50,rho=rho)

# <codecell>

y=[]
x=[]
for i,result in enumerate(results):
    values=result['x'][-100:]
    y.extend(values)
    x.extend(rho[i]*ones(values.shape))
    
plot(x,y,'b.')    
xlabel(r'$\rho$')
ylabel('x')

# <markdowncell>
コード例 #2
0
from pyndamics import Simulation

# In[25]:

sim = Simulation()
sim.add("x'=sigma*(y-x)", 14, plot=True)
sim.add("y'=x*(rho-z)-y", 8.1, plot=True)
sim.add("z'=x*y-beta*z", 45, plot=True)
sim.params(sigma=10, beta=8.0 / 3, rho=50)
sim.run(0, 50, num_iterations=10000)  # increase the resolution

# In[26]:

rho = linspace(10, 30, 200)
results = sim.repeat(0, 50, rho=rho)

# In[28]:

from pylab import ones

# In[29]:

y = []
x = []
for i, result in enumerate(results):
    values = result['x'][-100:]
    y.extend(values)
    x.extend(rho[i] * ones(values.shape))

plot(x, y, 'b.')