In [1]:
using Lorentz

In [1]:
xs, ys = run_Lorentz_gas(0.45, 1);
xs, ys = run_Lorentz_gas(0.45, 1000);


# Using radius: 0.45
# Boundaries: {Disc(Vector2D(0.0,0.0),0.45),Plane(Vector2D(-0.5,-0.5),Vector2D(0.0,-1.0)),Plane(Vector2D(0.5,-0.5),Vector2D(1.0,0.0)),Plane(Vector2D(0.5,0.5),Vector2D(0.0,1.0)),Plane(Vector2D(-0.5,0.5),Vector2D(-1.0,0.0))}
# Jump directions: [Vector2D(0.0,0.0),Vector2D(0.0,-1.0),Vector2D(1.0,0.0),Vector2D(0.0,1.0),Vector2D(-1.0,0.0)]
# Position at time 1 = Vector2D(0.600804270736117,0.32374975308207465)
# Cell: Vector2D(1.0,0.0)
# Distance from origin = 0.6824805303856379
elapsed time: 0.037800155 seconds (267216 bytes allocated)
# Using radius: 0.45
# Boundaries: {Disc(Vector2D(0.0,0.0),0.45),Plane(Vector2D(-0.5,-0.5),Vector2D(0.0,-1.0)),Plane(Vector2D(0.5,-0.5),Vector2D(1.0,0.0)),Plane(Vector2D(0.5,0.5),Vector2D(0.0,1.0)),Plane(Vector2D(-0.5,0.5),Vector2D(-1.0,0.0))}
# Jump directions: [Vector2D(0.0,0.0),Vector2D(0.0,-1.0),Vector2D(1.0,0.0),Vector2D(0.0,1.0),Vector2D(-1.0,0.0)]
# Position at time 1000 = Vector2D(0.4911067316761545,-20.459987312324525)
# Cell: Vector2D(0.0,-20.0)
# Distance from origin = 20.465880548913066
elapsed time: 0.003204768 seconds (649592 bytes allocated)

In [3]:
xs, ys = run_Lorentz_gas(0.49, 10000);


# Using radius: 0.49
# Boundaries: {Disc(Vector2D(0.0,0.0),0.49),Plane(Vector2D(-0.5,-0.5),Vector2D(0.0,-1.0)),Plane(Vector2D(0.5,-0.5),Vector2D(1.0,0.0)),Plane(Vector2D(0.5,0.5),Vector2D(0.0,1.0)),Plane(Vector2D(-0.5,0.5),Vector2D(-1.0,0.0))}
# Jump directions: [Vector2D(0.0,0.0),Vector2D(0.0,-1.0),Vector2D(1.0,0.0),Vector2D(0.0,1.0),Vector2D(-1.0,0.0)]
# Position at time 10000 = Vector2D(1736.2664791320121,1929.2244737427545)
# Cell: Vector2D(1736.0,1929.0)
# Distance from origin = 2595.48229750185
elapsed time: 0.001886226 seconds (336096 bytes allocated)

In [2]:
using PyPlot


INFO: Loading help data...

In [5]:
xs, ys = run_Lorentz_gas(0.49, 100000);


# Using radius: 0.49
# Boundaries: {Disc(Vector2D(0.0,0.0),0.49),Plane(Vector2D(-0.5,-0.5),Vector2D(0.0,-1.0)),Plane(Vector2D(0.5,-0.5),Vector2D(1.0,0.0)),Plane(Vector2D(0.5,0.5),Vector2D(0.0,1.0)),Plane(Vector2D(-0.5,0.5),Vector2D(-1.0,0.0))}
# Jump directions: [Vector2D(0.0,0.0),Vector2D(0.0,-1.0),Vector2D(1.0,0.0),Vector2D(0.0,1.0),Vector2D(-1.0,0.0)]
# Position at time 100000 = Vector2D(198.38357679659322,-8.59343153839737)
# Cell: Vector2D(198.0,-9.0)
# Distance from origin = 198.56961149233013
elapsed time: 0.336554973 seconds (94627300 bytes allocated)

In [6]:
plot(xs, ys, linewidth = 1)
axis("equal")


Out[6]:
(-50.0,250.0,-100.0,40.0)

In [6]:
xs


Out[6]:
1-element Array{Float64,1}:
 0.296576

In [6]:
using Gadfly


Warning: ignoring conflicting import of StatsBase.range into DataFrames
Warning: using Gadfly.plot in module Main conflicts with an existing identifier.

In [25]:
Gadfly.plot(x=xs, y=ys, Geom.line(preserve_order=true))


Out[25]:

In [17]:
help(Gadfly.plot)


no method print_help_entries(Array{ASCIIString,1})
while loading In[17], in expression starting on line 1
 in help at help.jl:94
 in help at help.jl:165
 in help at help.jl:180

In [ ]: