App-Physics-ParticleMotion

 view release on metacpan or  search on metacpan

eg/ex1.ini  view on Meta::CPAN

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.

lib/App/Physics/ParticleMotion.pm  view on Meta::CPAN

    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
    

lib/App/Physics/ParticleMotion.pm  view on Meta::CPAN

object to replace the old one or the name of a file to read from.

=head2 run

Runs the application. Can't be called more than once.

=head1 SEE ALSO

New versions of this module can be found on http://steffen-mueller.net or CPAN.

L<Math::Symbolic> implements the formula parser, compiler and evaluator.
(See also L<Math::Symbolic::Parser> and L<Math::Symbolic::Compiler>.)

L<Config::Tiny> implements the configuration reader.

L<Tk> in conjunction with L<Tk::Cloth> offer the GUI.

L<Math::RungeKutta> implements the integrator.

L<Math::Project3D> projects the 3D data onto a viewing plane.



( run in 1.352 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )