The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# This will be a one-dimensional harmonic oszillator (in 2D-space)
# Many of the options can be omitted.

# Number of dimensions in simulation (up to three dimensions allowed)
dimensions = 2

# Given a sufficiently fast cpu, you can have the simulation run very fast
# by setting this to a high value. Setting it to one makes the simualtion
# pause after integration steps so that the total speed is no greater
# than realtime.
timewarp = 1

# The sensitivity of the integrator.
# Smaller is more accurate but more cpu intensive.
epsilon = 0.0000001

# Set to a true value to have the particle traces stay on screen.
# Note, however, that this tends to increase memory usage with time - slowly.
# This option may be omitted and defaults to false.
trace = 0

# Set this to any HTML color to change the axis' color.
# This option may be omitted and defaults to black.
axiscolor = #222277

# This sets the zoom. It may be omitted and defaults to 20 for
# backwards compatibility.
zoom = 60

# The following options specify the base point and the plane vectors
# for the viewing plane. (That's the plane you project the 3D coordinates on.)
# Make sure your vectors are normalized because otherwise your display will
# be stretched.
# The values in this example are at the same time the default values.
plane_base_x = 0
plane_base_y = 0
plane_base_z = 0

plane_vec1_x = 0.371391
plane_vec1_y = 0.928477
plane_vec1_z = 0

plane_vec2_x = 0.371391
plane_vec2_y = 0
plane_vec2_z = 0.928477


# You may omit this option. If you don't, however, all 3D data will be written
# to the specified file for further processing. (For example with
# tk-motion-img.pl.)
# output_file = ex1.dat

# This section contains any number of constants that may be used in the
# formulas that define the differential equations. The section should
# exist, but it may be empty.
[constants]
k = 1
m = 1

# This section defines the movement of the first particle (p1).
[p1]

# This is the differential equation of the first coordinate of the
# first particle. It is of the form
#      (d^2/dt^2) x1 = yourformula
# "yourformula" may be any string that is correctly parsed by the
# Math::Symbolic parser. It may contain the constants specified above
# and any of the following variables:
# x1 is the first (hence "x") coordinate of the first particle (hence "x1").
# x2 is the x-coordinate of the second particle if it exists, and so on.
# y3 therefore represents the second coordinate of the third particle whereas
# z8 is the third coordinate of the eigth particle.
# Note that this example simulation only has two dimensions and hence
# "z8" doesn't exist.
# vx1 is the x-component of the velocity of the first particle.
# Therefore, vy3 represents the y-component of the velocity of the
# third particle. You get the general idea...
# All formulas may be correlated with other differential equations.
# That means, "funcx" of the first particle may contain y2 and the
# like. (Provided the dimensions and the particles exist.)
# 
# Our example is a simple oszillator
funcx = - k/m * x1*(x1^2)^0.5
# Diff. eq. for the second coordinate of the first particle
# We want a 1-dimensional oszillator, so we set this to zero.
funcy = 0

# Initial values for the coordinates and velocity of the first particle.
x = 0
y = -0.5
vx = -20
vy = 0

# Color of the current location of the particle (default: white)
# HTML-style colors.
color = #FF0000
# Color of the particle's trace if trace == 1 (default: black)
colort = #880000

# Other particles are defined in the same fashion.