home *** CD-ROM | disk | FTP | other *** search
- #
- ########################################################################
- # INSTALLING NEW DYNAMICAL SYSTEMS
- ########################################################################
- #
- Notation: ${KAOSHOME} is whatever directory where the entire
- sourcecode of koas is installed.
-
- The installation of a new dynamical system requires changes
- in only a few well-isolated set of subroutines.
-
- (1) If $HOME/kaos does not exist yet,
- create it with the command
- mkdir $HOME/kaos
- To find the name of your home directory,
- type set and return. The name after the string home is your home directory.
-
- (2) The directory ${KAOSHOME} contains a file, Makefile, for
- making the kaos executable. Copy this on the directory to ${KAOSUSERHOME}.
-
- (3) The subdirectory, userlib, in ${KAOSHOME} contains three
- templates for dynamical systems. Each template is a file (three
- subroutines) ending with the suffix *_def.c which can be freely edited
- to install a new dynamical system. If copies of this subdirectory and
- files in it do not exist in your own directory
- ${KAOSUSERHOME}, copy them to your user directory, ${KAOSUSERHOME}
- by typing
- rcp -r ${KAOSHOME}/userlib ${KAOSUSERHOME}
-
- (4) To enter your own model, for example, codenamed as userds0, into the kaos,
- edit a copy of the file, userds0_def.c,
- in the directory ${KAOSUSERHOME}/userlib following instructions
- in the later part of this file or the user manual.
-
- (5) Compile kaos with the edited subroutines
- by typing
- make userlib.a
- in the directory ${KAOSUSERHOME}/userlib.
- The UNIX make facility automatically tracks which files
- are modified and have to be recompiled.
- Debug the edited programs until the command
- make userlib.a
- is successful.
-
- (6) Type make all_u, to make user executables named kaos_u and
- kaos_batch_u in the directory ${KAOSUSERHOME}/kaos.
-
- (7) Start the kaos package by typing kaos_u instead of kaos.
- The name kaos is reserved for the original executable.
-
- (8) When the program starts, a different dynamical system may have
- been currently selected. In the main panel, select
- the desired entry from the panel cycle item Model.
- If you have edited the dynamical system file, codenamed userds0,
- an entry labeled as "User Dynamical System 0"
- should be selected to simulate the newly entered model.
- (** Warning: Note that the title name of the new model has not
- changed in the panel cycle item Model but it will show up
- correctly in the message area. **)
-
- In case of bugs or errors, edit the user subroutines and repeat the above
- processes (4)-(8).
-
- ##########################################################################
- # FORMAT OF DYNAMICAL SYSTEM DEFINITION FILE (*_def.c)
- ##########################################################################
-
- Subroutine *_init()
- ===================
- The initial settings for a dynamical system are located here.
- When a dynamical system is selected, system parameters are initialized
- as instructed in this file. For parameters not defined here,
- the default values are assigned as in the file
- ${KAOSHOME}/modellib/default_init.c.
- The major global variables
- can be declared external be used by any calling subroutines.
- For the dynamical system definition files,
- these global variables are already declared external
- by a hidden header file, so that the user can forget about them.
-
- title_label: a label for a dynamical system being installed
-
- mapping_on: a toggle switch for a dynamical system type; 1 = mapping, 0 = vector field
-
- inverse_on: a toggle switch for the existence of an explicit inverse;
- 1 = exists, 0 = does not exist. It should be always set to 1 for a vector field.
-
- fderiv_on: a toggle switch for the existence of an explicit Jacobian;
- 1 = exists, 0 = does not exist.
- (** Warning: Not fully implemented. **)
-
-
- enable_polar: a toggle switch for polar coordinates;
- 1 = enable polar coordinates, 0 = disable
-
- enable_period: a toggle switch for using periodic variables;
- 1 = enable periodic variables, 0 = disable. If enabled, the period
- of each variable needs to be specified.
- Insert lines such as period_len[0] = 1; period_len[1] = 0; if the first variable has a period 1 and the second variable is not periodic.
-
- var_dim: dimension of the phase space
-
- param_dim: dimension of the parameter space
-
- func_dim: dimension of the function space
-
- var_label: labels for primary phase space coordinates.
- Primary coordinates are those which are used to
- define a vector field or a mapping.
-
- var_polar_label: labels for secondary phase space coordinates
- Secondary coordinates are obtained from the primary ones by coordinate transformations.
- Currently the secondary coordinates are restricted to the polar coordinates.
- The transformation is defined by a set of subroutines
- euclid_to_polar and polar_to_euclid.
- If enable_polar = 0, these need not to be defined.
-
- param_label: labels for parameters of a dynamical system
-
- func_label: labels for user defined functions; e.g.,
- t, Energy, and AngMom
-
- param: initial values of parameters
-
- var_i: initial values of the primary phase space variables
-
- var_polar_i: initial values of the secondary phase space variables
- (need not to be defined if enable_polar = 0)
-
- param_min and param_max: initial values of lower and upper bounds of the parameters used to size the parameter space box
-
- var_min and var_max: initial values of lower and upper bounds of the primary phase space variables
-
- var_polar_min and var_polar_max: starting values of lower and upper bounds of the secondary phase space variables
- (need not to be defined if enable_polar: = 0)
-
- func_min and func_max: initial values of lower and upper bounds of the functions used to size the parameter space box
-
- Subroutine *_f()
- =================
- The right hand side of a vector field or mapping is defined in this subroutine.
- Its arguments are:
-
- dim: dimension of the phase space (the number of phase space variables).\footnoteThis is equivalent to the global variable var_dim.
-
- f: an dim-dimensional vector representing the values of the right hand side
- of a vector field or mapping.
-
- x: an dim-dimensional vector representing the values of the phase
- space variables.
-
- p: an param_dim-dimensional vector representing the values of the
- parameters of a dynamical system, where the variable param_dim is
- the global variable defining the dimension of the parameter space.
-
- t: a value of the time variable. This information is discarded for a mapping.
-
- index: an index switch used for several purposes. For a mapping,
- this switch is ignored if an explicit
- inverse is not defined. Otherwise, the forward map is returned
- if index=1, and the inverse map if index=0.
- For a non-Hamiltonian
- vector field, the index switch is ignored.
- For a Hamiltonian vector
- field, the momentum part of the vector field should be defined if
- index=1 and the coordinate part, if index=2. Look
- at examples of Hamiltonian systems for more information.
-
- Subroutine *_func()
- ===================
- The functions should be defined here. The arguments of this
- subroutine are similar to those of *_f() except that
- the argument, index, is not present.
- For example, to use a time axis for plotting,
- include the line
-
- f[0] = t;.
-