Home    Search    Reference Manuals    Up    Return   





Users Manual for Program CALC


Table of contents

Introduction
   General information on input.
   Error statements.
   Memory dump.
   Predefined variables.
   Redirection of input data reading.
   Definition and input of substructures.
   Definition and input of substructures.

Command line options

Description of the main calculation programs
   FRESP Frequency-response analysis.
   MODAL Modal analysis.
   QUASI Quasistatical analysis.
   TSIM Numerical integration.
   Local coordinate systems.
   Couplings.

Search command by operation

Input data commands

Examples

Export of results




Introduction


The program CALC is the central calculation program in GENSYS. The program can be started with four different scripts depending on which type of analysis is required. The different scripts are:

  1. QUASI, which calculates the quasistatical state of the input data model, i.e. seeks the position where all the speed derivatives are equal to zero.
  2. MODAL, which performs eigenfrequency calculations of the input data model.
  3. FRESP, which performs frequency-response analysis of the input data model.
  4. TSIM, which performs numerical integration in the time domain.


The program is a general variable processing program. All the major functions in the program are labeled variables. The variables are dependent on each other according to a specific system described in the input data. The input data model can be built-up of local coordinate systems, bodies, couplings, and mathematical functions. The mathematical functions are defined by the main command 'func' and are very powerful. In addition to creating new variables in the memory, they can also transfer output data in existing variables.

Reference Manuals   Calc menu   

General information on input procedures and the user manual

Word and word-delimiters

Input data consists of word and word-delimiters, and is read in free format. Word-delimiters are: "="(equal sign), " "(space),"→"(tab), ","(comma) and "↵"(carriage return). All other characters are considered to be commands or input data.

New-line

Program Gensys ignores new-lines in the input data file. An input data command can be given on one line or divided into many lines.

Case sensitivity

Main and sub commands are case insensitive. Other input data are case sensitive. I.e variable VKMH is not the same variable as vkmh.

Structure of input data commands

Almost all input data commands consists of the following four items:

  1. Main-command
  2. Sub-command (depends on the given main command)
  3. Variable to be created
  4. Input data arguments (depends on the main and sub command)

Prefixes of variables used in this manual

In order to differentiate between different types of input data in this manual. Variables has been marked with different prefixes. The prefixes have the following meanings:

Formulas

If the variable consists of a +, -, *, /, ( or ) - sign. Program CALC assumes that a formula has been written. Program CALC will evaluate the value of the formula and use the result as input data.
The user can force Gensys to evaluate an expression as a formula, if the expression is enclosed in ` ` accents.

Fallback Values

Variables containing an "_" (underscore) in its name has a special meaning. The underscore sign indicates that the name of the variable has "fallback values".
Example:
In the input data file variable mu_1 is defined. This variable shall be used for the friction coefficient between wheel and rail.
When the first coupling between wheel and rail cp1_111r is about to be created, and Gensys starts to search for the friction coefficient between wheel and rail. Program Gensys will in its first attempt search for a variable named mu_111r1. If this variable not can be found the program will search for the following variables:
mu_111r
mu_111
mu_11
mu_1
At last Gensys finds mu_1 and for the first contact point on the right wheel of the first wheelset, program Gensys will use this variable as friction coefficient.

By using the Fallback Value technique it is easy to create different friction coefficients on different contact surfaces, different wheel profiles on different wheels, different stiffnesses in different springs,,, etc. etc.

End of input data reading

The input data file is concluded with the characters E0F to mark that the file has come to an end. The reason why it is done in this way is to enable the main program to determine whether the expansion of all inserted files and substructures has succeeded or not.


Reference Manuals   Calc menu   

Error statements.


CALC separates fatal errors, where execution cannot continue, from non-fatal errors, where only a warning text appears. A fatal error has the following fundamental appearance:

 ***ERROR*** In in_s_var > error
             Variable foo cannot be found.
             line no:          93
               s_var sngl kyy2.d   s_var sngl kyy2.F
               s_var sngl cyy2.d   s_var sngl cyy2.F
               s_var sngl foo
                          ^ 
             s_var name= foo
             s_var type= sngl                     
             Input data reading has stopped at line=   93
             in file= runf/ex_20_2b.tsimf
             cannot be stored, skip the rest of datagroup


In the end of the first line, after the ***ERROR***-text. Gensys shows which subroutine has written the statement. The output can consists of many subroutines, separated by ">"-signs. This list shows the trace back of the error. Then the error message and which file that caused the error message.

A non-fatal error has the following fundamental appearance:

 * warning * In in_operp > check_name
             Variable point.y is already defined.
             Will be overwritten by command: func operp                   
             Line  102  File runf/ex_20_2b.tsimf 

After the * warning * -text, gensys displays which subroutine has generated the statement. Then the warning message and which file that caused the warning message.

Reference Manuals   Calc menu   

Memory dump

Every command in the input data file creates a number of memory cells in the program's memory. The different commands occupy a different number of cells in the memory. The variables, which are created with the main command func, occupy the least space, whilst the main command lsys and mass can occupy up to 80 memory cells. Printing of the memory's content can be ordered if the input data 'idebug' is assigned any other value than zero. The memory dump has fundamentally the following appearance:



Predefined variables

Program CALC creates the first 49 variables in the memory before the input data is read. The first 49 variables contain the following information:

                                                                                  
 No  Irel   It Name                       Var                   Explanation                                    
--------------------------------------------------------------------------------------------    
  1    0     0 time                       0.00000000000E+000    Time variable for TSIM
  2    1     0 timestep                   1.00000000000E-003    See command tstep.
  3    2     0 timestep_err               0.00000000000E+000    Numerical error in TSIM for each timestep   
  4    3     0 freq                       5.00000000000E-002    Frequency variable for FRESP                
  5    4     0 fstep                     -1.04000000000E+000    Frequency step in FRESP                     
  6    5     0 accel.x                    0.00000000000E+000    Longitudinal acceleration in fsys           
  7    6     0 accel.y                    0.00000000000E+000    Lateral acceleration in fsys.               
  8    7     0 accel.z                    9.81000000000E+000    Vertical acceleration in fsys               
  9    8     0 timeout                    1.25000000000E-002    See command tout.
 10    9     0 zero                       0.00000000000E+000    Variable containing the value zero             
 11   10     0 calc_type                  5.00000000000E+000    Variable indicating type of analysis           
 12   11     0 max_tstep                  1.50000000000E-003    Max allowable timestep                         
 13   12     0 min_tstep                  1.00000000000E-009    Min allowable timestep                         
 14   13     0                            0.00000000000E+000    Degree of freedom which controls the timestep  
 15   14     0 timestart                  0.00000000000E+000    Start time                                     
 16   15     0 timestop                   1.00000000000E+001    Stop time                                      

 17   16     0 Pval                       1.00000000000E-003    Following variables will get values if an
 18   17     0 Ival                       0.00000000000E+000    integrator with a variable time step control
 19   18     0 Dval                       0.00000000000E+000    is used.
 20   19     0 max_tstep_dyn              1.00000000000E-003      -"-
 21   20     0 timestep_velo_f10          0.00000000000E+000      -"-
 22   21     0 timestep_f10               1.00000000000E+000      -"-
 23   22     0 timestep_err_f10           0.00000000000E+000      -"-
 24   23     0 tstep_lpass                5.00000000000E-004      -"-
 25   24     0 timestep_err_lpass         0.00000000000E+000      -"-
 26   25     0 Pival                      0.00000000000E+000      -"-
 27   26     0 Iival                      0.00000000000E+000      -"-
 28   27     0 Dival                      0.00000000000E+000      -"-
 29   28     0 terr_sign                  0.00000000000E+000      -"-
 30   29     0 terr_time                  0.00000000000E+000      -"-

                                                                Following variables will get values if command
                                                                eval_compute_time has been given in input data:
 31   30     0 ttout                      0.00000000000E+000    Total time spend between two tout
 32   31     0 tlsys                      0.00000000000E+000    Time spent on positioning the coordinate systems
 33   32     0 tcoupl                     0.00000000000E+000    Time spent on calculating forces in all couplings
 34   33     0 tfunc                      0.00000000000E+000    Time spent on evaluating all func-commands
 35   34     0 tmass                      0.00000000000E+000    Time spent on calculating the acceleration of all masses
 36   35     0 tcnstr                     0.00000000000E+000    Time spent on evaluating all constraints
 37   36     0 tinteg                     0.00000000000E+000    Time spent by the integrator
 38   37     0 tkdiag                     0.00000000000E+000    Time spent on calculating forces in couplings of type "k", "k_l" and "k_r"
 39   38     0 tkmat                      0.00000000000E+000    Time spent on calculating forces in couplings of type "k3", "k3_l" and "k3_r"
 40   39     0 tkcdia                     0.00000000000E+000    Time spent on calculating forces in couplings of type "kc", "kc_l" and "kc_r"
 41   40     0 tcdiag                     0.00000000000E+000    Time spent on calculating forces in couplings of type "c", "c_l" and "c_r"
 42   41     0 tcreep                     0.00000000000E+000    Time spent on calculating forces in couplings of type "creep_*"
 43   42     0 tfunc_wr_coupl_p           0.00000000000E+000    Time spent on calculating forces in functions of type "wr_coupl_*"
 44   43     0 tkuser                     0.00000000000E+000    Time spent on calculating forces in couplings of type "cuser*"
 45   44     0 tkfdia                     0.00000000000E+000    Time spent on calculating forces in couplings of type "kf", "kf2" & "kf3"

 46   45     0 timeoutp                  -1.00000000000E-010    Value of next tout
 47   46     0 itout                      0.00000000000E+000    Indicator showing the number of time steps taken since last tout

 48    0    -4 CalcType                 Addr=      1  Value= TSIM   Character variable indicating type of analysis
 49    1     1 char                       1.00000000000000000E+000


The character-variable CalcType is a variable indicating type of analysis being currently performed. It is an information for the user if he or she like to write input data which shall be different depending on type of analysis. The character-variable CalcType can have the following values:

 FRESP     Frequency-Response analysis                                  
 MODAL     Modal analysis                                               
 QUASI     Quasistatical analysis                                       
 TSIM      Time domain integration analysis                             
 NPICK     Picking flexible mode shapes from a FEM-analysis             
 PREDAT    Create stiffnesses and damping from preferred eigenvalues    
 GPLOT     Geometry plot program                                        
 RUNF_INFO Input data file information program                          

In input data the user can use the CalcType-variable in the following example:

##                                                                      
##  Read flexible parameters for the carbody                            
##  ==========================================================          
   if_then_char_init CalcType .ne. NPICK                                
    insert file npickr/$IDENT.npickr                                    
   endif                                                                

In the above example file npickr/$IDENT.npickr is not read when current analysis type is NPICK. We don't want program NPICK to read that file because program NPICK is supposed to create that file.

Reference Manuals   Calc menu   

Redirection of input data reading

In the command 'insert file <insfil>', input reading will be redirected to file insfil. The insert-command can also be given in the inserted file to further redirect the input reading.

In command 'insert format' <format> <insfil>, the input data file and its contents will be expanded from a pre-defined ASCII-file insfile, according to the format specification <format>.
The file will be inserted into the main file in the exact same form. The format statement which is given in input data, is used in FORTRAN's read statement which reads <insfil>.
During the input phase, there are two valid format specifications which are: a(character) and x(skip). Almost all format specifications contain commas, which is why the format specification must be enclosed in accents. Otherwise the comma will be interpreted as a delimiter. Moreover, the format specifications must also be set in parentheses.

Example:
Read the column positions 1-10 and 21-30 from the file "testfile".

                                        
 insert format '(a10,10x,a10)' testfil  
                                        

Please see further details under main command "insert"

Reference Manuals   Calc menu   

Definition and input of substructures.


If the same input data shall be repeated several times with only minor differences in the actual data, the input data can easily be formulated in a substructure with arguments. When the substructure is later called, the different values can be entered into the substructure's argument.
Users, who are acquainted with programming in FORTRAN or Pascal, will see great similarities with FORTRAN's substructures and/or Pascal's procedures. Users, who have worked with UNIX-scripts may see similarities between a substructure in CALC-input data and a UNIX-script.
Below follows a description using a simple example.
A substructure is defined with the command:

                                    
 substruct struct_name [            
  . . . .                           
  input data commands               
  containing arguments $1, $2, etc. 
  . . . .                           
 ]                                  
                                    

Every substructure is given a name "struct_name", and the content of the substructure is defined within brackets [ ]. This substructure is now stored in an temporary file for later use in the directive in_substruct. Like in a UNIX-script the substructure has arguments $1, $2 etc. up to $9. When the command in_substruct is given, this argument must be replaced by a character string or a number. The routine which inserts the argument into the substructure is a simple text editor. If a number is given as argument in the summons of a substructure, it will still be treated as a text string which replaces the symbol $1 in the substructure.

The following command initiates the input of a defined substructure:

                                                
 in_substruct struct_name [ arg1, arg2, etc. ]  
                                                

The definition of the argument to the substructure is given in brackets.

The definition of the substructure not has been given in a previous substruct-command. Program CALC looks for the definition in the following files:
"<struct_name>.ins"
"ins/<struct_name>.ins"
"vhedat/<struct_name>.ins"
"$gensys/calc/insert_files/<struct_name>.ins"


Example:
A wheel-rail geometry function to describe wheels with constant conicity.

#                                                                      
#                                                                      
#     WHEEL-RAIL GEOMETRY FUNCTION for ideally conic wheels            
#     -----------------------------------------------------            
#     $1 = name or number of the vehicle                               
#     $2 = the conicity of the wheel                                   
#                                                                      
        substruct kpf_rkona   [                                        
   func  intpl_r  drkp_r$1    -1.000    -$2       1.000     $2         
   func  intpl_r  gamkph_r$1  -1.000    -$2       1.000    -$2         
   func  intpl_r  gamkpv_r$1  -1.000     $2       1.000     $2         
   func  intpl_r  zkp_r$1     -1.000    -$2       1.000     $2         
   func  intpl_r  rohr_r$1    -1.000     2.222222 1.        2.222222  ]



It is now possible to use the different conicities for the different carriages in a train unit of the same substructure. This can be done in the following way using the substructure commands:

 in_substruct kpf_rkona [ 1 0.1 ]     
 in_substruct kpf_rkona [ 2 0.200 ]   
 in_substruct kpf_rkona [ 111 0.3 ]   

The output data from the above-mentioned commands will give a wheel-rail profile with a conicity of 0.1 in the vehicle named 1, 0.2 in the vehicle named 2, and conicity 0.3 in the vehicle named 111. All the wheels are given a lateral curvature variance of 2.222 (m).

The output data after expansion is as follows:
 func  intpl_r  drkp_r1    -1.000    -0.1       1.000     0.1      
 func  intpl_r  gamkph_r1  -1.000    -0.1       1.000    -0.1      
 func  intpl_r  gamkpv_r1  -1.000     0.1       1.000     0.1      
 func  intpl_r  zkp_r1     -1.000    -0.1       1.000     0.1      
 func  intpl_r  rohr_r1    -1.000     2.222222 1.      2.222222    
                                                                   
 func  intpl_r  drkp_r2    -1.000    -0.200       1.000     0.200  
 func  intpl_r  gamkph_r2  -1.000    -0.200       1.000    -0.200  
 func  intpl_r  gamkpv_r2  -1.000     0.200       1.000     0.200  
 func  intpl_r  zkp_r2     -1.000    -0.200       1.000     0.200  
 func  intpl_r  rohr_r2    -1.000     2.222222 1.        2.222222  
                                                                   
 func  intpl_r  drkp_r111    -1.000    -0.3       1.000     0.3    
 func  intpl_r  gamkph_r111  -1.000    -0.3       1.000    -0.3    
 func  intpl_r  gamkpv_r111  -1.000     0.3       1.000     0.3    
 func  intpl_r  zkp_r111     -1.000    -0.3       1.000     0.3    
 func  intpl_r  rohr_r111    -1.000     2.222222 1.        2.222222
Reference Manuals   Calc menu   

Command line options.

For program CALC a number of command line options are available. The user can put his or hers favorite options in a file named .gen_conf. Program CALC searches primarily for the .gen_conf-file in the local working directory. If the file not can be found in the local working directory, program CALC searches for the .gen_conf-file in the users home-directory. At last if no .gen_conf-file can be found program CALC reads the file $gensys/bin/gen_conf. Following options are understood:

-addarg Prompt for more arguments before calculation starts
-no_addarg Do not prompt for more arguments
-debug Don't remove temporary work files after execution
-no_debug Keep temporary work files after execution
-nice "val" Select niceness to run CALC in. val can be given values between 0 and 19. Where 0 gives the highest priority and 19 gives the lowest priority.
-help Print this help information
-overwrite Overwrite old results without questions.
-no_overwrite Prompt the user before old results are overwritten.
-qident Ask for an ident before starting the execution
-no_qident Use the base name of the input data file as the ident-string.
-save_expf Save the expanded runf-file
-no_save_expf Do not save copies of the expanded runf-files.
-save_runf Save the runf-file in a file named .runc
-no_save_runf Do not save copies of the runf-files.
   
-no_queue Do not run the job in the queue system.
-at_queue "time" Run program CALC under at and send a mail when the job is finished. Under time the user can specify when the calculation shall start. If time is set equal to now, the calculations will start immediately.
-batch_queue "time" Run program CALC under batch and send a mail when the job is finished. Under time the user can specify when the calculation shall start. If time is set equal to now, the calculations will start immediately.
The difference between at and batch is that in batch the execution of program CALC only starts when the system load level is below 0.8.
N.B. batch only works under the LINUX operating system.
-nohup_queue Run program CALC under nohup and send a mail when the job is finished.
-short_queue Run calculation in the short queue. Script $gensys/bin/q_sys starts your queue-system.
-long_queue Run calculation in the long queue. Script $gensys/bin/q_sys starts your queue-system.
-night_queue Run calculation in the night queue. Script $gensys/bin/q_sys starts your queue-system.
   
arg(1) Input datafile
arg(2) Ident

Reference Manuals   Calc menu    Input Data Menu

Description of the main calculation programs.

The four main calculation programs are: FRESP, MODAL, QUASI and TSIM. The extension of the input data file governs which type of calculation that will take place. File extension .frespf leads to a frequency-response analysis. File extension .modalf leads to a modal analysis. File extension .quasif leads to a quasistatical analysis. File extension .tsimf leads to a numerical integration in time domain. Input data for the four programs shall be stored in a directory called "runf". The directory level above "runf" is in Gensys called project level.

FRESP Frequency-response analysis.

FRESP is the mode in program CALC which performs the frequency response analysis. The user can choose between different types of frequency response analysis in command fresp_param. The excitation of the model in mode FRESP is defined in command fexcit. Before the analysis starts in FRESP the model must be linearized, because the frequency response analysis is performed in the frequency domain.
The linearization process is made automatically in FRESP, the user must not change anything in the input data. FRESP linearizes the model by moving each degree of freedom an amount epsilon and measure the response in all other degrees of freedom in the model. In this way, a so-called "Jacobian matrix" is formed which describes the properties of the model for small movements around the actual position of the model. The actual position around which the linearization takes place can be changed by giving the model an initial offset by the initval command.
When the Jacobian matrix is created program FRESP uses the matrix for creating the frequency response by stepping from fstart to fstop in steps controlled by fstep. If the frequency response type in command fresp_param equals to Fourier_CG1 the answer will be complex, in this case FRESP will store the results in the following way:

mass.x (the position of a degree of freedom) stores the real part of the complex spectra
mass.vx (the velocity of a degree of freedom) stores the imaginary part of the complex spectra

If the user only is interested in the absolute value of the frequency response spectra, he or she can use the function cabs available in program MPLOT, in order to make the complex frequency response spectra a real frequency response spectra. If the user is interested in knowing the time shift for a frequency in the spectra the user shall look at the phase angle of the spectra. The phase angle is defined as atan2( mass.vx, mass.x), and can be calculated by function atan2 in MPLOT.
The output data from the frequency response analysis is presented in two different files:

$ident.modjac
The Jacobian matrix is presented in the output data file with the extension .modjac. The file is written in ASCII-format and can be viewed directly in a editor.

$ident.id
The frequency response spectra are stored as complex vectors on the output data file with the extension.id. The storing of the vectors for further post processing is specified in command s_var sngl. The file is written in MPdat-format so that it can be read by the post processor MPLOT.

Reference Manuals   Calc menu   

MODAL Modal analysis.

MODAL is the mode in program CALC calculating the eigenvalues and modal shapes of the model. In command modal_param the user can choose between different types of methods in the modal analysis procedure. In modal analysis there is no need for excitation of the model. Before the analysis starts in MODAL the model must be linearized, because the search for eigenvalues is performed in the frequency domain.

The linearization process is made automatically in MODAL, the user must not change anything in the input data. MODAL linearizes the model by moving each degree of freedom an amount epsilon and measure the response in all other degrees of freedom in the model. In this way, a so-called "Jacobian matrix" is formed which describes the properties of the model for small movements around the actual position of the model. The actual position around which the linearization takes place can be changed by giving the model an initial offset by the initval command.

When the Jacobian matrix is created program MODAL uses the matrix for calculating the eigenvalues. The analysis in program MODAL will be complex because large damping in the model is considered.

The deduction of the complex eigenvalue for a one-dimensional mass is shown in the document Eigen_Freq_Deduce.html

The output data from the modal analysis is presented in five different files:

$ident.modjac
The Jacobian matrix is presented in the output data file with the extension .modjac. The file is written in ASCII-format and can be viewed directly in a editor.

$ident.mode
All the eigenvalues are presented in the output data file with the extension .mode. The file is in ASCII-format and can be printed directly on a laser printer.

$ident.modf
All the modal shapes are presented on the output data file with the extension .modf. The file is in ASCII-format and can be printed directly on a laser printer. On the file, the modal shapes are scaled so that the largest component is equal to the complex number (1,0). Furthermore, the modal shapes are listed so that the modal shape's largest component is listed first and is then followed by the remaining components in order of size.

$ident.id
All the eigenfrequencies are stored as complex scalars on the output data file with the extension.id. The file is written in MPdat-format so that it can be read by the plot program MPLOT. The complex scalars are stored with names taken from the degree of freedom which has the predominant modal shape. It is not possible to determine whether an eigenfrequency belongs to a certain degree of freedom, but the scalars must have a name to make reference possible in MPLOT, so therefore the MODAL program has been provided with this name-giving generator. On certain occasions the name-giving generator can assign an unfortunate name to an eigenfrequency, so in order to determine the actual physiognomy of an eigenfrequency, it is recommended that the forms' appearance is plotted out in the program GPLOT. However, it can be practical to assign a name to the forms when a parameter variation is executed, and the forms' appearance does not greatly vary between each parameter change. The name-generator will then assign the same name to the same forms, even if the output data is derived from different calculations.

$ident.gp
All the eigenvalues and eigenmodes will be stored in GPdat-format on the output data file with extension .gp. The file can be read in program GPLOT for plotting and animating the different mode shapes.

Reference Manuals   Calc menu   

QUASI Quasistatical analysis.

QUASI is the mode in program CALC calculating the quasistatical position of the model. In command quasi_param the user can choose between different types of methods in the quasistatical analysis procedure. Program mode QUASI operates on the full non-linear model, searching the position where internal forces are balanced with respect to external forces and acceleration fields.
The output data from the quasistatical analysis is presented in two different files:

$ident.id
The frequency response spectra are stored as complex vectors on the output data file with the extension.id. The file is written in MPdat-format so that it can be read by the plot program MPLOT. All the eigenfrequencies are stored as complex scalars on the output data file with the extension.id. The file is written in MPdat-format so that it can be read by the plot program MPLOT. The complex scalars are stored with names taken from the degree of freedom which has the predominant modal shape. It is not possible to determine whether an eigenfrequency belongs to a certain degree of freedom, but the scalars must have a name to make reference possible in MPLOT, so therefore the MODAL program has been provided with this name-giving generator. On certain occasions the name-giving generator can assign an unfortunate name to an eigenfrequency, so in order to determine the actual physiognomy of an eigenfrequency, it is recommended that the forms' appearance is plotted out in the program GPLOT. However, it can be practical to assign a name to the forms when a parameter variation is executed, and the forms' appearance does not greatly vary between each parameter change. The name-generator will then assign the same name to the same forms, even if the output data is derived from different calculations.

$ident.gp
All the eigenvalues and eigenmodes will be stored in GPdat-format on the output data file with extension .gp. The file can be read in program GPLOT for plotting and animating the different mode shapes.

QUASI is the command and subprogram which searches the position of all degree of freedoms where internal forces are balanced with respect to external forces, acceleration fields and track irregularities. The program is useful for many things. For example:

The output data from the calculation is loaded onto a file in GPdat-format using the name $ident.gp. This data can be retrieved by CALC using the directive initval read_gpdat. The GPdat-file can also be loaded into the plotting program GPLOT for graphic presentation of the vehicle's position.

The output data can also be stored as scalars in a file written in MPdat-format. In order to save scalars to the MPdat-file, please use the commands: s_var scalar_0 or s_var var_0.

Reference Manuals   Calc menu   

TSIM Numerical integration in time domain.

TSIM is the command and subprogram which executes time simulations. The program advances in time with the help of a numerical integrator which is selected in the command tsim_param.

The integrator performs the commands in the same order as the input data has built-up the model. It is, therefore, important that the input data is entered in the right time order, so that the calculations will also be executed in the right order. All ingoing variables must be defined before they can be used. All new variables, which are defined in the program, are checked that their names have not been defined earlier, if so a warning or error message will appear. Further information about execution order can be found in TSIM order

Local coordinate systems, bodies and couplings cannot be redefined in the input data file, the data will be taken from the first definition. If the user tries to redefine an existing coordinate system, body or coupling, program CALC will not read the new data, only a warning message will be printed.
In command FUNC however it is the opposite because command FUNC writes directly on the variable when the input data line is read. If the variable does not exist it will be created, and if it exists it will be overwritten.

Stopping a simulation.

During simulation results are temorarily stored in RAM, for later storing on harddrive when the simulation ends. Results are stored every time tout is passed. All variables that shall be saved are listed with the s_var-command.
Because of this all results are lost if the user stops the simulation abnormally. In order to stop the calculation without loosing the results, there are three possible methods:

  1. Create file [ "id/" $IDENT ".stop" ]
    If a file named [ $IDENT ".stop" ] exists in directory "id". Simulation $IDENT will make a normal termination, next time the simulation passes tout. When simulation $IDENT has come to a full stop. File [ "id/" $IDENT ".stop" ] will be removed.
  2. Create file "calc_stop"
    If a file named "calc_stop" exists at "project level". The first simulation that reaches tout will make a normal termination and remove file "calc_stop".
  3. Somewhere in the input data file give the command write_ca_file
    If command write_ca_file has been given in the input data file. The simulation results will not be stored in RAM. Instead the results will be written to a file with extension .ca. In this case the user can kill the execution at any time, and the results can be retrived from the .ca-file with program conv_ca
Reference Manuals   Calc menu   

Local coordinate systems.

When creating models in GENSYS the user have access to three types of coordinate systems:

fsys = A fixed coordinate system located at origin
esys = A moving coordinate system which take large angles into consideration
lsys = A moving coordinate system which only consider linear rotations

The coordinate systems are connected to each other according to the following figure:

calcCoordSys.gif

bsys is the body fixed coordinate system, which describes the position of the mass relative to its lsys.

Positive coordinate directions are:

Name:Direction:Positive:
X Longitudinal Forward
Y Lateral To the right
Z Vertical Downwards
φX-rot Roll See http://en.wikipedia.org/wiki/Right-hand_rule
χY-rot Pitch See http://en.wikipedia.org/wiki/Right-hand_rule
ψZ-rot Yaw See http://en.wikipedia.org/wiki/Right-hand_rule

Variable Shift_Xposition

If the longitudinal coordinate of the track consists of many digits i.e. more digits than can be read in single precision. The user has the possibility to shift the whole train-set in longitudinal direction, including the track irregularities and the designed track geometry. In order to shift the whole model in longitudinal direction a variable with the name "Shift_Xposition" must exit. If the starting position of the model has a coordinate bigger than 100000 or less than -100000 the user will be prompted to define the "Shift_Xposition"-variable.

Reference Manuals   Calc menu   

Couplings.

The couplings between the different bodies are defined with the command 'coupl'. They can include stiffness, viscous dampers, friction dampers, viscous dampers in series with stiffness, and rolling friction coupling between wheel and rail.

If the coupling's direction is equal to x, y, z, f, k, p, or m, the displacement of the coupling will be calculated in the following way: the position of the coupling's attachment point in body 2 is subtracted by the position of the coupling's attachment in body 1. The attachment points' positions are calculated in the esys which was specified in the input data of the coupling. If a coupling has been used which lacks the input data argument for esys, the connected bodies must both belong to the same esys, otherwise an error print will occur.

If the coupling's direction is equal to 'c' or 'cu', the variable 'coupl.d' is written with a plus sign when the coupling is extended, and with a minus sign when the coupling is compressed. The coupling's force 'coupl.F' is calculated as 'coupl.d' multiplied by the stiffness' characteristic.

The same rationale, as stated above, also applies for dampers. However, instead of the coupling's deformation, the coupling's deformation velocity is used.

Reference Manuals   Calc menu   

Search by operation.

Acceleration accp_bodyf Calculates body fixed accelerations from forces acting on the mass
  accp_bodyfix Calculates bodyfix ed accelerations by numerical derivation
 
Addition add Add variables together
  add_vect_scal Add the value of a variable(scalar) to every component in a vector
  add_vect_vect Add vectors together
  operp Addition can be made in an operp expression
  incr Increases a variable's value with another value
 
Algebraic abs Calculates the absolute value of a variable
  inv Inversion of a variable
  power The first variable to the power of the second
  sign2 Transfers the sign of one number to another
  sqrt Calculates the square root of a variable
 
Averaging mean_r Calculate the average of a memory field
  mean_r2 Calculate the average of a memory field, with range selection
 
Character char Creates a character constant in the memory
 
Constants const Create a variable in memory assign its value only once
  const_block Create many variables in memory, assign their values only once
  copy Create a variable in memory assign its value every timestep
  copy_init Create a variable in memory assign its value only once
  cr_mem Create a memory field in memory assign its value only once
 
Co-simulation command Send a command to the UNIX-system
 
Derivation deriv Numerical derivation of a variable
  intpl_r + create_d Points are defined in a field by intpl_r, linear derivation between the points is made in create_d
 
Discretization discrete Digitization of a variable with desired time steps
 
Filtering hpass1 First order high-pass filter
  hpass1_0 First order high-pass filter, zero initial value
  hpass2 Second order high-pass filter
  hpass2_0 Second order high-pass filter, zero initial value
  lpass1 First order low-pass filter
  lpass1_0 First order low-pass filter, zero initial value
  lpass2 Second order low-pass filter
  lpass2_0 Second order low-pass filter, zero initial value
  Butterworth Designing higher order Butterworth filter
  deriv First order high-pass filter, infinite cut-off frequency
  integ First order low-pass filter, zero cut-off frequency
 
Integration integ Integration of a variable
 
Interpolation intpl_l Definition of points and linear interpolation are both defined in intpl_l
  intpl_s Definition of points and spline interpolation are both defined in intpl_s
  intpl_r + create_l Points are defined in intpl_r, linear interpolation is made in create_l
  intpl_r + create_s Points are defined in intpl_r, spline interpolation is made in create_s
  intpl_r3 + crehex1 3D-points are defined in intpl_r3, interpolation in space is made in crehex1
 
Limitation l_lim Limits a variable downwards
  u_lim Limits a variable upwards
 
Minimization min Calculate the min. value of two variables
  min_r Picks up the min-value in a field
  min_r2 Picks up the min-value in a field, with range selection
 
Multiplication mul Multiply variables together
  operp subtraction can be made in an operp expression
  mul_vect_scal Multiply the value of a variable to every component in a vector
  smul_vect_vect Scalar multiplication of two vectors
 
Position pos_rlsys1 Calculate the position of a point attached to a body
  pos_rlsys2 As pos_rlsys1 but in another lsys
 
Sign sign2 Transfers the sign of one number to another
 
Subtraction sub Subtract variables
  sub_vect_scal Subtract the value of a variable(scalar) from every component in a vector
  sub_vect_vect Subtract vectors
  decr Decreases a variable's value with another value
  operp Subtraction can be made in an operp expression
 
Time delay fifo_mem + create_l Store the variable in a memory field, interpolate the required time delay in create_l
  lpass1 Time delay in a first order low-pass filter equals to 1/(2.*pi*f0)
 
Transcendental acos Calculates the arc-cosinus of a variable
  asin Calculates the arc-sinus of a variable
  atan Calculates the arc-tangent of a variable
  cos Calculates the cosine of a variable
  sin Calculates the sinus of a variable
  tan Calculates tangent of a variable

Reference Manuals   Calc menu    Input Data Menu
  

3) Input data main-commands.


Summary of all main commands:

`accel` = Definition of an external acceleration field
`body` = Definition of the physical size and shape of a mass
`check_if_then_at_0` = Always check if_then-statements, even at time=tstart
`constr` = Setting constraints to integrated variables
`cosim_server` = Make a co-simulation using TCP.
`cosim_server_udp` = Make a co-simulation using UDP.
`coupl` = Definition of a coupling property or a coupling between two masses
`eof` = Marks the end of the input data file
`eval_compute_time` = Evaluate the computation time in every time step
`fexcit` = Definition of excitation points for frequency-response analysis
`force` = Definition of external forces
`fresp` = Order the CALC-program to perform a frequency-response analysis
`fresp_param` = Defines different parameters for the frequency-response analysis
`fstart` = Specifies the start frequency in frequency-response analysis
`fstep` = Specifies the frequency steps in frequency-response analysis
`fstop` = Specifies the stop frequency in frequency-response analysis
`func` = Definition of a function
`head` = Definition of head lines
`idebug` = Definition of different levels of debug printing
`idebug_file` = The name of the file to where the idebug information will be written
`idebug_file_read` = Read input data model from idebug_file.
`if_then` = Definition of an if_then-block
`if_then_char_init` = Definition of an if_then_char_init-block
`if_then_init` = Definition of an if_then_init-block
`else` = Precedes an else-block
`elseif_then_init` = Continuation of an if_then_init-block.
`elseif_then_char_init` = Continuation of an if_then_char_init-block
`endif` = End of an if_then-, if_then_char_init- or if_then_init-block
`in_substruct` = Insertion of a substructure.
`initval` = Input reading of initial values
`insert` = Definition of include-files
`invert_massmatrix` = Controls the inversion of the mass matrix
`loop_beg` = Definition of an algebraic loop
`loop_end` = End of algebraic loop defined by loop_beg
`loop_beg2` = Definition of an algebraic loop with two arguments
`loop_end2` = End of algebraic loop defined by loop_beg2
`lsys` = Definition of a local coordinate system
`mass` = Definition of a mass
`max_exec_time` = Setting max length of execution time.
`modal` = Order the CALC-program to perform a modal analysis
`modal_param` = Defines different parameters for the modal analysis
`no_warning` = Suppresses warning messages from command func
`overwrite_property` = This command makes it possible to overwrite an existent property in the memory.
`post_process` = Execute an UNIX-command after the calculation
`pre_process` = Execute an UNIX-command before starting the calculation
`quasi` = Order the CALC-program to perform a quasistatical analysis
`quasi_param` = Defines different parameters for the quasistatical analysis
`s_var` = Variables to be stored on MPdat-file for post-processing.
`s_var_filter` = Anti-aliasing filter before writing variables to MPdat-file.
`substruct` = Definition of a substructure.
`tout` = Specifies the output steps to the MPdat-file in time integration analysis
`tsim` = Order the CALC-program to perform a time integration analysis
`tsim_param` = Defines different parameters for the time integration analysis
`tstart` = Specifies the start time in time integration analysis
`tstep` = Specifies the time steps in time integration analysis
`tstop` = Specifies the stop time in time integration analysis
`update_mass_matrix` = Keyword that forces an update of the mass matrix in every time step
`wlog_beg` = Specifies start of input data which is to be logged on a log file
`wlog_end` = Ends the writing into a log file beginning with command wlog_beg
`wlog_store` = Specifies whether the log file will be saved or not.
`write_ca_file` = During time-domain simulations, write results to the harddisk.
`write_id_file` = During time-domain simulations, split up the results in many id-files.


Old and obsolete input data commands.

For backward compatibility reasons, old and obsolete input data commands has been kept in the program. However the use of old input data commands is not encourenged, therefore they have been removed from the list above. If you have an old input data file contaning old commands that is not documented in this manual, you can search for your command in Old_input_calc.html.


'accel', `a_type`, input(*)

Definition of an external acceleration field.
Input data consists of subcommand `a_type`, and a number of input data arguments depending on the chosen subcommand.



a_type = `local_all`

The acceleration field is applied to all the bodies in the model. The coordinate directions are set according to every body's individual lsys.

 accel local_all  ax ay az

Three values are read (ax,ay,az), one value for each direction of the coordinate axes. Default values are ax=0., ay=0. and az=9.81.


Reference Manuals   Calc menu    Input Data Menu

`body`

Definition of the physical size and shape of a mass.
Data describing the physical size and shape of a mass can be given in the input data file, but it's contents will not be read by program CALC. The size and shape of the mass is intended for the graphic postprocessor GPLOT. For the description of available body-commands please look in the users manual of program GPLOT.

Reference Manuals   Calc menu    Input Data Menu

`check_if_then_at_0`

Always check the test in if_then-statements, even at time= tstart.
If not check_if_then_at_0 is set, all statements in all if_then-endif-blocks will be executed when program CALC reads the input data file at time= tstart. If check_if_then_at_0 is set, program CALC will always check if the test is true or false before executing the commands inside if_then-statements.

The reason for introducing this command is to keep backward compatibility for old input data files.


Reference Manuals   Calc menu    Input Data Menu

`constr`= `cr_type`, input(*)

Setting constraints to integrated variables.
When a constraint is set to the system, the number of freedoms in the system will be reduced.
Command `constr` has the following subcommands:

conn_body_fm Transfers forces and moments acting on a constraint body to a free body.
conn_free_1 Eliminates an equation of motion, the value of the constraint equation is controlled by a linear combination of free equations.
fix_free_1 Eliminates an equation of motion.
fix_rigid_1 Eliminates a degree of motion in a body.

cr_type = `conn_body_fm`

Transfers forces and moments acting on a constraint body to a free body.
The body `m_constr' is not allowed to have any degrees of freedom, in the directions listed under `directions` below. I.e. before command conn_body_fm can be used the user must set a constraint constr fix_rigid_1, constr fix_free_1 or the constraint body may have been generated by the command mass fixpoint_6.
The procedure for the transfer of forces between the bodies, is that the forces acting on the constraint body is simply added to the forces acting on the free body. The procedure for the transfer of moments between the bodies, is that the moments acting on the constraint body is added to the moments acting on the free body, but considerations will also be taken if the two bodies have their center of gravity located at different places.
The free body and the constraint body must belong to the same lsys, otherwise program CALC will stop and an error message will be written.

 constr conn_body_fm  `m_constr' `m_conn' `directions`
m_constr = Name of the constraint body.
m_conn = Name of the free body.
directions = Specification of the directions of motion which will be eliminated from m_constr. The valid code words for the directions are `x`,`y`,`z`,`f`,`k` and `p`. When a valid main command according to Input data commands has been read, further input reading will stop.

Reference Manuals   Calc menu    Input Data Menu

cr_type = `conn_free_1`

Eliminates an equation of motion.
Eliminates a defined degree of freedom in the equation system.
The equation of motion is expressed as a linear combination of other unconstraint equation of motion in the system.

 constr conn_free_1  `f_name' +-`fact1 `y_name1' +-`fact2 `y_name2' +-`fact3,,,   
f_name = Name of the equation of motion which will be eliminated.
fact1 = Factor with which y_name1 will be multiplied.
y_name1 = Unconstraint equation of motion in the system.
fact2 = Factor with which y_name12 will be multiplied.
  . . . . =   . . . . . . . . . . . . . . . . . . .
  . . . . =   . . . . . . . . . . . . . . . . . etc.

The eliminated equation of motion f_name is calculated according to:
f_name = fact1*y_name1 + fact2*y_name2 + ... etc.

Input data reading of factors and variables will take place until a new valid main command according to Input data commands has been read.

Reference Manuals   Calc menu    Input Data Menu

cr_type = `fix_free_1`

Eliminates an equation of motion in the equation system.
This command just simply removes the equation of motion for the degree of freedom given in `freedom_name' below. The integrated variable `freedom_name' will now be transformed into an ordinary variable in the main memory of program CALC. After removing the equation of motion for variable `freedom_name', its value will be set to the constant value "cvalue". If the user wants to change or regulate the variable `freedom_name' it is now OK to overwrite its value with func-commands.

 constr fix_free_1  `freedom_name'  cvalue     
freedom_name = Name of the equation of motion which shall be eliminated.
value = Constant value which variable `freedom_name' will be set to.

In time domain simulation and quasistatical analysis, the variable `freedom_name' will be set to a constant value "cvalue". In frequency-response and modal analysis, the real part will be set to "cvalue", and the imaginary part is set to 0(zero).

Reference Manuals   Calc menu    Input Data Menu

cr_type = `fix_rigid_1`

Eliminates a degree of motion in a body.
Sets the positional degree of freedom to a constant value, and the velocity degree of freedom to 0 (zero).

 constr fix_rigid_1  `m_name' `dire` value     
m_name = Name of the body.
dire = Coordinate direction where the constraint will act.
value = Value which the degree of freedom will be set to.

In time simulation and quasistatical analysis, the data position m_name.dire will be set to a constant value, the body's velocity will be set to 0 (zero) in direction `dire`. In frequency-response and modal analysis, the real part will be set to value, and the imaginary part will be set to 0 (zero).

Reference Manuals   Calc menu    Input Data Menu

`eof`

Marks the end of the input data file.
Because the expansion of substructures is made in smaller programs outside the main program, it is necessary to have a final flag on the input data file which verifies that the expansion of the substructures has been successful.


Reference Manuals   Calc menu    Input Data Menu

`eval_compute_time`= eval_type

Evaluate the computation time in every time step.
Eval_type can be set to all or ttout.

Eval_type= all generates the following variables:

tlsys = Time spent on positioning the local coordinate systems
tcoupl = Time spent on calculating the forces in all couplings
tfunc = Time spent on evaluating all func-commands
tmass = Time spent on calculating the acceleration of all masses
tcnstr = Time spent on evaluating all constraints
tinteg = Time spent by the integrator
ttout = Total time spend between two tout

Eval_type= ttout only generates variable ttout.

N.B. Command eval_compute_time only creates the variables. Command eval_compute_time do not automatically stores the variables for further post-processing to a *.id-file.


Reference Manuals   Calc menu    Input Data Menu

'fexcit'= `fex_type`, input(*)

Definition of excitation points for frequency-response spectra analysis.
Input data consists of subcommand `fex_type`, and a number of input data arguments depending on the chosen subcommand.
Command `force` has the following valid subcommands:

displ_fr Real valued frequency spectra.
displ_o Complex angular frequency spectra.

fex_type = `displ_fr`

This type of excitation refers to a displacement of a body's center of gravity in any of the coordinate directions x,y,z,f,k or p. In the direction the body is excited, the body's degrees of freedom must have constraints, alternatively the body can be defined with the command `mass fixpoint_6`. The spectra which is used in the excitation must be real. The spectra can, for example, be given via the command "func intpl_r". Despite the fact that the spectra is real in command "func intpl_r", it is in command "fexcit displ_fr" stored in a complex form, due to the time delay t_delay given in input(*) below.

 fexcit displ_fr  `body' `dire` `spectra' +-`t_delay   
body = Body which will be excited according to spectra. The body is defined through the command `mass`.
dire = The direction of the body to be excited. The body may not have an individual degree of freedom in the direction where the excitation will take place. If, for example, the body is created via `mass m_rigid_6`, the degree of freedom must be constricted with `constr`.
spectra = Real spectra stored as a data field, previously defined in the input data file.
t_delay = The time delay of the spectra. Delaying the frequency spectra will make the spectra complex, according to the formula below. If t_delay is given as a positive value, the spectra is delayed in time, i.e. the spectra is phase shifted in a negative direction which causes the real part to decrease somewhat, and the imaginary part to take a negative value. If the t_delay is given as a negative value, the spectra will come earlier in time, and will thereby cause a positive phase turning. The spectra, which excites the body, is therefore rendered by the following function:
  Fex(f)= F(f)*e(-2*π*i*f*t_delay)
Where:
Fex(f) = Complex spectra which excites the input data model
F(f) = Real spectra according to 'spectra' above
f = Excitation frequency
i = The imaginary unit

fex_type = `displ_o`

In contrast to displ_fr, displ_o reads a complex spectra with angular frequency scale. The command displ_o also has an input data parameter t_fact which makes it possible to change the scale of the frequency of the input spectra. If the value of t_fact is set to the speed of the vehicle, the input spectra `spectra_r' and `spectra_i' will be read as spatial frequency. This type of excitation refers to a displacement of a body's center of gravity in any of the coordinate directions x,y,z,f,k or p. In the direction the body is excited, the body's degrees of freedom must have constraints, alternatively the body can be defined in the command `mass fixpoint_6`. The frequency spectra is defined by two data fields `spectra_r' and `spectra_i', defining the real and imaginary part respectively. The data fields `spectra_r' and `spectra_i', can for example, be given in the command "func intpl_r".

 fexcit displ_o  `body' `dire` `spectra_r' `spectra_i' +-`t_delay +-`t_fact    
body = Body which will be excited according to spectra_r and spectra_i. The body is defined through the command `mass`.
dire = The direction of the body to be excited. The body may not have an individual degree of freedom in the direction where the excitation will take place. If, for example, the body is created via `mass m_rigid_6`, the degree of freedom must be constricted with `constr`.
spectra_r = Real spectra stored as a data field, previously defined in the input data file.
spectra_i = Imaginary spectra stored as a data field, previously defined in the input data file.
t_delay = The time delay of the spectra. If t_delay is given as a positive value, the spectra will be delayed in time, i.e. the spectra is phase shifted in a negative direction which causes the real part to decrease somewhat, and the imaginary part to take a negative value. If the t_delay is given as a negative value, the spectra will come earlier in time, and will thereby cause a positive phase shifting. The spectra which excites the body is therefore rendered by the following function:
 Fex(omega)= F(omega)*e(-i*omega*t_delay)
Where:
Fex(omega)= Complex spectra which excites the input data model
F(omega) = Complex spectra according to cmplx(spectra_r, spectra_i).
omega = Excitation angle frequency
i = The imaginary unit
t_fact = Scaling of the frequency axle. If t_fact is given the value 1, the spectra is interpreted precisely as it is defined. Spectra_r and spectra_1 are then presumed to be expressed in angular frequency scale [rad/s].
If t_fact is given the value 2*pi, spectra_r and spectra_1 are presumed to be expressed in frequency scale [1/s].
If t_fact is set to the speed of the vehicle, spectra_r and spectra_1 are presumed to be expressed in spatial angular frequency scale [rad/m].
Conversion of frequency takes place in the following manner:
  fext = omega/t_fact   
Where:
fext= Frequency to interpolate in spectra_r, spectra_i.
omega= The actual angle frequency which the FRESP program processes at present.
Reference Manuals   Calc menu    Input Data Menu

`force` = `force_type`, input(*)

Definition of external forces.
Input data consists of subcommand `force_type`, and a number of input data arguments depending on the chosen subcommand.
Command `force` has the following valid subcommands:


force_type = `rel_lsys1`

External force applied to a mass in its local coordinate system lsys. Input data is given as follows:

 force rel_lsys1  `fo_name' `m_name'   +-`a  +-`b  +-`h        
                                       +-`Fx +-`Fy +-`Fz       
                                       +-`Mf +-`Mk +-`Mp       
fo_name = Name of the force.
m_name = Name of the body to which the force will be applied.
a = The longitudinal distance from the body's lsys to the point where the force shall act on the body.
b = The lateral distance from the body's lsys to the point where the force shall act on the body.
h = The vertical distance from the body's lsys to the point where the force shall act on the body.
Fx = Longitudinal force acting on the body.
Fy = Lateral force acting in the body.
Fz = Vertical force acting in the body.
Mf = Roll moment acting on the body.
Mk = Pitch moment acting on the body.
Mp = Yaw moment acting on the body.

Variables stored in the main memory:
fo_name.a = Longitudinal distance as stated above
fo_name.b = Lateral distance as stated above
fo_name.h = Vertical distance as stated above
fo_name.Fx = Longitudinal force as stated above
fo_name.Fy = Lateral force as stated above
fo_name.Fz = Vertical force as stated above
fo_name.Mf = Roll moment as stated above
fo_name.Mk = Pitch moment as stated above
fo_name.Mp = Yaw moment as stated above
Reference Manuals   Calc menu    Input Data Menu
force_type = `rel_mass1`

External force applied to a mass. The force is attached to the mass. If the mass moves the force will follow with the mass. Input data is given as follows:

 force rel_mass1  `fo_name' `m_name'   +-`a  +-`b  +-`h        
                                       +-`Fx +-`Fy +-`Fz       
                                       +-`Mf +-`Mk +-`Mp       
fo_name = Name of the force.
m_name = Name of the body to which the force will be applied.
a = The longitudinal distance from the body's lsys to the point where the force shall act on the body.
b = The lateral distance from the body's lsys to the point where the force shall act on the body.
h = The vertical distance from the body's lsys to the point where the force shall act on the body.
Fx = Longitudinal force acting on the body.
Fy = Lateral force acting in the body.
Fz = Vertical force acting in the body.
Mf = Roll moment acting on the body.
Mk = Pitch moment acting on the body.
Mp = Yaw moment acting on the body.

Variables stored in the main memory:
fo_name.a = Longitudinal distance as stated above
fo_name.b = Lateral distance as stated above
fo_name.h = Vertical distance as stated above
fo_name.Fx = Longitudinal force as stated above
fo_name.Fy = Lateral force as stated above
fo_name.Fz = Vertical force as stated above
fo_name.Mf = Roll moment as stated above
fo_name.Mk = Pitch moment as stated above
fo_name.Mp = Yaw moment as stated above
Reference Manuals   Calc menu    Input Data Menu

`fresp`

Order the CALC-program to perform a frequency-response analysis.
Normally this command is given via the script fresp when the frequency-response analysis is initiated, but it can also be given manually if so desired.


Reference Manuals   Calc menu    Input Data Menu

`fresp_param` = `f_method`, input(*)

Defines different parameters for the frequency-response analysis.
If command fresp_param not is given in the input data file, m_method='Fourier_CG1' with its default values will apply.
Command `fresp_param` has the following valid subcommands:

Fourier_CG1 Frequency-responses of Fourier spectra.
PSD_LU1 Frequency-responses of PSD-spectra.

`f_method` = `Fourier_CG1`

Method Fourier_CGI calculates frequency-responses of Fourier spectra.
The spectra are calculated using Gauss elimination. In order to obtain a result not equal zero, the model must be excited in one or more points, this can be done with command `fexcit`.
Input data to `fresp_param Fourier_CG1` are:

 fresp_param Fourier_CG1  linj_eps   idof_1 leps_1  idof_2 leps_2  idof_3  etc.  
linj_eps = Amplitude which is used in the linearization process.
This value is the general default amplitude if not redefined in leps_?.
Declared Real*4   Default= 1.e-4
idof_1 = Equation number which shall be subjected to the linearization amplitude leps_1
In order to get the number of the equation it can be necessary to make a preliminary calculation with idebug=1. Input data parameter idebug=1 forces program CALC to write the calc.out-file. The second table "Output of equations" in the calc.out-file contains the equation numbers, in the first leftmost column.
Declared Integer*4   Default= n.a.
leps_1 = Amplitude which is used in the linearization process for equation number idof_1.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.
idof_2 = Equation number which shall be subjected to the linearization amplitude leps_2
Declared Integer*4   Default= n.a.
leps_2 = Amplitude which is used in the linearization process for equation number idof_2.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.

Reference Manuals   Calc menu    Input Data Menu
`f_method` = `PSD_LU1`

Method PSD_LU1 calculates frequency-responses of PSD-spectra.
The spectra are calculated using LU factorization. In order to obtain a result not equal zero, the model must be excited in one or more points, this can be done with command `fexcit`.
Input data to `fresp_param PSD_LU1` are:

 fresp_param PSD_LU1  linj_eps   idof_1 leps_1  idof_2 leps_2  idof_3  etc.  
linj_eps = Amplitude which is used in the linearization process.
Default value of linj_eps is 1.e-4.
idof_1 = Equation number which shall be subjected to the linearization amplitude leps_1
In order to get the number of the equation it can be necessary to make a preliminary calculation with idebug= 1. Input data parameter idebug=1 forces program CALC to write the calc.out-file. The second table "Output of equations" in the calc.out-file contains the equation numbers, in the first leftmost column.
Declared Integer*4   Default= n.a.
leps_1 = Amplitude which is used in the linearization process for equation number idof_1.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.
idof_2 = Equation number which shall be subjected to the linearization amplitude leps_2
Declared Integer*4   Default= n.a.
leps_2 = Amplitude which is used in the linearization process for equation number idof_2.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.

Reference Manuals   Calc menu    Input Data Menu

`fstart`

Specifies the start frequency in frequency-response analysis.


Reference Manuals   Calc menu    Input Data Menu

`fstep`

Specifies the frequency steps in frequency-response analysis.
A positive number for fstep, gives the frequency step directly in (Hz). A negative number for fstep, gives the multiplication factor between two consecutive frequency steps. E.g. fstep = -1.10 means that every frequency step shall be separated by 10%.
Declared Real*4   Default= -1.06


Reference Manuals   Calc menu    Input Data Menu

`fstop`

Specifies the stop frequency in frequency-response analysis.


Reference Manuals   Calc menu    Input Data Menu

`head` = head#, text

Definition of head lines.


head# = Number of header lines, max. 10.
text = Head text, max. 80 characters per line.

The text is read from the lines first non-blank character until the end of the line. If the user wishes to begin the header line with a blank, this must be marked by the header being inserted within acute accents 'Headtext'. If a word in the head line is preceded by the $-sign, the CALC program will try to find a variable with the same name and replace the variable name including the $-sign with the variables value at time=0. If there is no variable name in the program's memory, this will not affect the content of the head text.


Reference Manuals   Calc menu    Input Data Menu

`idebug` = itype

Definition of different types of debug printing.


itype= 0
Does not normally give a debug print. But the program can create a debug print itself, which involves a memory dump to the file calc.out if an error is read in the input data.
itype= 1
Gives a memory dump to the file "calc.out" at time zero.
itype= 2
Gives a memory dump to the file "calc.out" at time zero.
In case of CalcType="TSIM", a memory dump also occurs to the file "calc.out" on calculation of the last time step. In addition to the memory dumps, all the function commands are written during the input phase on standard output.
itype= 3
Gives a memory dump to the file "calc.out" at time zero.
In the case of CalcType="TSIM", a memory dump also occurs to the file "calc.out" simultaneously with the output data storage on the file *.ca, i.e. every time tout is passed. In addition to the memory dumps, all the function commands under the input and calculation phases are printed on standard output.

Reference Manuals   Calc menu    Input Data Menu

`idebug_file`   file_name

Set the name of the file to where the idebug information will be written. Amount of debug information to be written is controlled in the idebug-command. The default value for idebug_file is 'calc.out'.


Reference Manuals   Calc menu    Input Data Menu

`idebug_file_read`   idebug_file

Read input data model from idebug_file.
If the input data file is very big, this command will considerable speedup the input data reading of the model. If no changes has been made to the masses in the model, command invert_massmatrix can be set equal to "no", to further reduce Initial time.

How to use command idebug_file_read:


Example of an input data file:

     
idebug_file_read= "out/tang_ideal.out"

invert_massmatrix= no

func const mu_ = 0.25
func const vkmh= 65

eof

Reference Manuals   Calc menu    Input Data Menu

`if_then`= `variable_1, `test`, `variable_2

Starts the definition of an if_then-block.
By using the if_then-command, the user has the possibility to control which statements in the input data file that shall be executed, depending on how variable_1 stands in relation to variable_2. The if_then-block must be concluded with an endif-statement, and it may contain an optional else-statement.
If the test is true, the statements in the block will be executed, otherwise not. Only coupl- and func- commands may appear in the block.
The arguments to the if_then-command are:

variable_1 First test variable. Variable or a constant.
test Test condition. The following conditions are valid:
.eq. True if variable_1 is equal to variable_2. (See N.B. below)
.ne. True if variable_1 is not equal to variable_2. (See N.B. below)
.gt. True if variable_1 is greater than variable_2.
.ge. True if variable_1 is greater than or equal to variable_2.
.lt. True if variable_1 is lesser than variable_2.
.le. True if variable_1 is lesser than or equal to variable_2.
variable_2 Second test variable. Variable or a constant.

N.B. For the test conditions .eq. and .ne., variable_1 and variable_2 will be converted to integers before the test is undertaken.

All input data is, however, read into the memory during the program's input phase regardless of whether the test condition is true or false. The testing of whether the statement is true or false takes place during the calculation, which is why the user can receive a warning during the input data reading if the same variable are defined both after if_then and else.
The if_then-else-endif block can be written at several levels. This will allow tests to be carried out which are based on several test conditions.
If it is enough to check the test condition during the input data phase of the program, it is preferred that command if_then_init is used instead.


Reference Manuals   Calc menu    Input Data Menu

`if_then_char_init`= `cvar1 `test1` `cvar2 `test2` `cvar3 `test3` `cvar4 ,,,etc.

Definition of an if_then_char_init-block.
The if_then_char_init-block works in a similar way as the if_then_init-command, with the exception that in if_then_char_init character variables are tested. If the test condition is true, the input data lines after the statement will be read until the next elseif_then_char_init-, else- or endif- statement.

var# Test variable number # containing a character variable or a character constant
test# Test condition. The following conditions are valid:
.eq. True if var1 is equal to var2.
.ne. True if var1 is not equal to var2.
.and. Test condition .and. combines two tests.
.or. Test condition .or. combines two tests.

The test condition is only checked during input data reading, and its state cannot be changed during the calculation.

A if_then_char_init-endif block can be written inside another if_then_char_init-endif block. Max number of if_then_char_init-endif levels are 50.

Character variables can be defined with command func char.


Reference Manuals   Calc menu    Input Data Menu

`if_then_init`= +-`var1 `test1` +-`var2 `test2` +-`var3 `test3` +-`var4 ,,,etc.

Definition of an if_then_init-block.
The if_then_init-block works in a similar way as the if_then-command above, with the exception that the test condition is checked only once. The checking of the test condition takes only place in the input data reading phase, and nothing will happen if the test condition changes state during the calculation phase. If the test condition is true, the input data lines after the statement will be read until the next elseif_then_init-, else- or endif- statement.

var# Test variable number # containing a variable or constant.
test# Test condition. The following conditions are valid:
.eq. True if var1 is equal to var2. (See N.B. below).
.ne. True if var1 is not equal to var2. (See N.B. below).
.gt. True if var1 is greater than var2.
.ge. True if var1 is greater than or equal to var2.
.lt. True if var1 is lesser than var2.
.le. True if var1 is lesser than or equal to var2.
.and. Test condition .and. combines two tests.
.or. Test condition .or. combines two tests.

N.B. For the test conditions .eq. and .ne., var1 and var2 will be converted to integers before the test is undertaken.

The test condition is only checked during input data reading, and its state cannot be changed during the calculation. If the user wishes to be able to control the execution of different statements during the course of the calculation, please use the command if_then instead.

A if_then_init-endif block can be written inside another if_then_init-endif block. Max number of if_then_init-endif levels are 50.

Command if_then_init can also be used for checking if a variable exists or not, see the alternative usage of command if_then_init below.


`if_then_init`= `test`, `variable_1

Definition of an if_then_init-block.
This alternative usage of command if_then_init make tests on one variable only.

test Test condition. The following conditions are valid:
.exist. True if variable_1 exists in the memory of the program.
.not_exist. True if variable_1 not exists in the memory of the program.
var1 Test variable

Reference Manuals   Calc menu    Input Data Menu

`else`

The else statement is used when coding an if_then-else decision statement. The keyword precedes an else-block, defined to be all the statements after the else-statement up to, but not including the corresponding endif-statement. An if_then-else decision statement begins with one of the commands: if_then-, if_then_char_init- or if_then_init


Reference Manuals   Calc menu    Input Data Menu

`elseif_then_init`= +-`var1 `test1` +-`var2 `test2` +-`var3 `test3` +-`var4 ,,,etc.

Continuation of an if_then_init-block.
If the previous if_then_init-statement was false the program will continue and evaluate the elseif_then_init statement. If the test condition in the elseif_then_init-statement is true, the input data lines after the statement will be read until the next elseif_then_init-, else- or endif- statement. How to formulate a test contition can be found under the if_then_init-command.


Reference Manuals   Calc menu    Input Data Menu

`elseif_then_char_init`= +-`var1 `test1` +-`var2 `test2` +-`var3 `test3` +-`var4 ,,,etc.

Continuation of an if_then_char_init-block.
If the previous if_then_char_init-statement was false the program will continue and evaluate the elseif_then_char_init statement. If the test condition in the elseif_then_char_init-statement is true, the input data lines after the statement will be read until the next elseif_then_char_init-, else- or endif- statement. How to formulate a test contition can be found under the if_then_char_init-command.


Reference Manuals   Calc menu    Input Data Menu

`endif`

End of an if_then-, if_then_char_init- or if_then_init-block


Reference Manuals   Calc menu    Input Data Menu

`initval`=`i_type`, input(*)

Input reading of initial values.
In the initval-command, initial values can be given to all variables in the main memory. If several initval-commands are given to the same variable, the last initval-command will apply.
Command `initval` has the following subcommands:

read_gpdat Reads the initial values from GPdat-file
set_mass Sets initial values to masses
set_var Sets the initial value to an arbitrary variable

i_type = `read_gpdat`

Reads the initial values from GPdat-file. If there are more degrees of freedom in the model than there are files, no value will be set on these degrees of freedom. If there are degrees of freedom on the file which are not available in the model, a warning text will appear but the program will continue execution without reading the initial value for unknown degree of freedom.

 initval read_gpdat  'filegp' def_no   
filegp= Name of the GPdat-file from which the input data is read. Maximum number of characters read to filegp are 132.
def_no= Number of the deformation shape which is to be read.

Reference Manuals   Calc menu    Input Data Menu
i_type = `set_mass`

Sets initial values to masses.

 initval set_mass  `m_name' `dire` (+-`)value  
m_name = Name of the mass which will be given an initial value.
dire = `x`,`y`,`z`,`f`,`k`,`p`.
Possible directions which can be given initial values.
value = The initial value which is given to the mass m_name, in the direction dire.

Reference Manuals   Calc menu    Input Data Menu
i_type = `set_var`

Sets the initial value to an arbitrary variable.

 initval set_var  `var' (+-`)value     
var = Name of the variable.
value= The initial value.

Reference Manuals   Calc menu    Input Data Menu

`insert` =`in_type`, input(*)

Definition of include-files.
This directive makes it possible for the user to redirect the input reading to another file. The insert-command can also be given in the inserted file, to further redirect the input reading.
Command `insert` has the following subcommands:

file The inserted file is read just as it is.
format The insert file is read in a fixed format.
free_form The insert file is read in a free format.
format_rows The insert file is read in a fixed format with line selection.
free_form_rows The insert file is read in a free format with line selection.

in_type = `file`

The inserted file is read just as it is, without any filtering functions.

 insert file  `insfile'        
insfile = Name of the data file which will be expanded in the input data file.

Reference Manuals   Calc menu    Input Data Menu
in_type = `format`

The insert file is read according to the format specification for the input data file. This directive is applicable, when the input data is to read from an extern file, but the user wishes to select a desired number of columns.

 insert format  `formspec' `insfile'   
formspec = Format specification which controls the input data reading. Formspec will be used as the second argument in a FORTRAN read statement. However in GENSYS only edit descriptors 'a' and 'x' are allowed, because the insert command reads insfile as ASCII-files, so in the input reading phase all data is considered as character-strings even numerical data. The format specification should be enclosed in parentheses, because the FORTRAN read statement needs them. As almost all format specifications contains comma signs, the format specification must be enclosed in accent signs, otherwise the comma signs will be interpreted as a delimiter between words.
insfile = Name of the data file to which further input data reading now will be redirected.

Example:
 insert format '(10x,10a,10x,10a)' testfil    

The command above will on each line of testfil read the positions 11-20 and 31-40, the rest of testfil will be skipped.

Reference Manuals   Calc menu    Input Data Menu
in_type = `free_form`

The insert-file is read in free format, certain columns are selected with the special format-command to free_form. This directive is applicable when input data is to be read from an extern file and certain columns are to be selected, but the number of characters in the columns and/or spaces is not known. The following characters can be used as delimiters: space, tabulator, comma, and equal signs.

 insert free_form  `formspec' `insfile'        
formspec = Format specification which controls the input data reading. The format specification is given with special commands which determines whether a column should be read or not. The format specification is similar to a FORTRAN's format statement, with the extension that the number of positions in the columns shall not be given. On reading the file, there are two format specifications which are permitted a(character) and x(skip). Formspec must be enclosed in parentheses and acute accents, in the same way as format above.
insfile = Name of the data file to which further input data reading now will be redirected.

Example:
A file contains 5 columns, columns 1 and 3 shall be read from the file data/testfil.

 insert free_form '(a,x,a,x,x)' data/testfil

N.B.! All columns on the file data/testfil must be marked, either with an 'a' if the column is to be read, or with an 'x' if the column is not to be read.


Reference Manuals   Calc menu    Input Data Menu
in_type = `format_rows`

The insert file will be read according to the format specification, but the input rows from the inserted file can also be selected.

 insert format_rows  `formspec'  istart  istop  `insfile'      
formspec = Format specification which controls the input data reading. See description under in_type = format.
istart = Line number in file `insfile' from where further input data reading will start.
istop = Program CALC will not read beyond line number istop in file `insfile'. After line istop has been read, program CALC will continue to read current input data file.
insfile = Name of the data file to which further input data reading now will be redirected.

Reference Manuals   Calc menu    Input Data Menu
in_type = `free_form_rows`

The insert-file will be read according to the format specification as in_type=free_form, but the input rows from the inserted file can also be selected.

 insert free_form_rows  `formspec'  istart  istop  `insfile'   
formspec = Format specification which controls the input data reading. See description under in_type=free_form.
istart = Line number in file `insfile' from where further input data reading will start.
istop = Program CALC will not read beyond line number istop in file `insfile'. After line istop has been read, program CALC will continue to read current input data file.
insfile = Name of the data file to which further input data reading now will be redirected.

Reference Manuals   Calc menu    Input Data Menu

`invert_massmatrix` `invert_type`

Controls the inversion of the mass matrix.
Following values can be given for invert_type:

no = The inverted mass matrix is read from input data file. E.g. via command idebug_file_read
init = The mass matrix is inverted only once. In the beginning of the simulation.
continuous = During a simulation, invert the mass matrix in every time step. With this option it is possible to change the weight of the masses during simulation.

Default value is init.


`loop_beg`= `var', tol, maxloop, `method`, input(*)

Definition of an algebraic loop.
If an algebraic loop has been defined in the input data, it will be enclosed between the commands loop_beg and loop_end. The command loop_beg requires the following input data:


var = Variable which is calculated by algebraic loop. The variable must be defined previously in the input data.
tol = Permitted error in the solving of the value `var'
maxloop= Max. number of iterations before interruption.
method = Desired method with which the value of var can be solved. There are, at present, the following methods:
direct = The solution is sought using a direct method, i.e. the output data from the previous calculation cycle controls the initial value in the new calculation cycle. The method lacks input data input(*)=blank.
direct_db = Same method as above but with debug statements.
direct_sor5 = The solution is sought using a direct method with an over-relaxation factor of 5% at every step. The method lacks input data input(*)=blank.
direct_sor5b = Same method as above but with debug statements.
secant = The solution is sought with the secant method, i.e. the derivative between two loops governs how the seeking of number 3 will be executed. The method has two pieces of input data, which are used to limit the search. input(*) = max_v, min_v max_v = Max. value of the variable 'var' which the secant method may not exceed. min_v = Min. value of the variable 'var' which the secant method may not fall below.
secant_db = Same method as above but with debug statements.

Reference Manuals   Calc menu    Input Data Menu

`loop_end`

End of algebraic loop defined by loop_beg.


Reference Manuals   Calc menu    Input Data Menu

`loop_beg2`= `borv',`regv', tol, maxloop, `method`

Definition of an algebraic loop with two arguments.
Loop_beg2 and loop_end2 work in the same way as loop_beg and loop_end to solve algebraic loops in the input data model. Unlike loop_beg, loop_beg2 works with two arguments.Loop_beg2 uses argument two to coordinate that argument one is fulfilled. The command loop_beg2 requires the following input data:


borv = Variable which must be regulated to the right value. The variable must be previously defined in the input data.
regv = Variable which adjusts the right value. Variables should preferably be defined earlier in the input data, as loop_beg2 will transfer regv.
tol = Permitted errors in the solution of the values `var'.
maxloop = Max. number if iterations before interruption.
method = Desired method with which the value of var can be solved. There are, at present, the following methods:
regula_falsi = regula_falsi is a method similar to Newton-Raphson's, but the derivative is estimated by two adjoining functional commands.
regula_debug = Same method as above but with debug statements.

Reference Manuals   Calc menu    Input Data Menu

`loop_end2`

End of algebraic loop defined by loop_beg2.


Reference Manuals   Calc menu    Input Data Menu

`lsys` = `l_type`, input(*)

Definition of local coordinate system.
There are a total of three different types of coordinate systems in the calculation model. These are:

  1. fsys
    Fixed coordinate system, a coordinate system which always lies fixed and cannot be moved, hereafter called "fsys". The fsys coordinate system is the common coordinate system for all masses and couplings in the model.
  2. esys
    Euler system, is a coordinate system which handle large displacements and rotations in relation to fsys. The Euler systems are hereafter called "esys" in this manual.
  3. lsys
    Linear system, is the coordinate system which only considers small angles relative to esys. The linear system is hereafter called "lsys" in this manual.

Only esys and lsys can be defined in command lsys, as fsys always remains fixed.
It is relatively common that the simulated structure can move a large distance, but that the relative internal movements in the structure are small, the program is built-up so that in the modeling of the problem, first an esys is defined relative to fsys where large displacements and rotations are considered, then a lsys is defined for every mass in the structure relative to the created esys system where small rotations are considered. If large displacements and rotations between different parts in the structure must be considered, additional esys must be created. The reason for not creating an esys for each mass in the model is that the esys-systems are more CPU-consuming in relation to the lsys-systems.
In order to be able to define a body, it is necessary that a lsys is available for the body to relate to, and to be able to define a lsys, it is necessary that there is an esys which the lsys can relate to. Forces and displacements in couplings are normally calculated in an esys. For further details see how each coupling is defined.
Command `lsys` has the following subcommands:

e_fix Creates a fixed esys
e_abs_bend Creates a moving esys with clothoid type of transition curves
e_abs_bendr Creates a moving esys with transition curves proposed by Ruch in 1903.
e_abs_bendrf Creates a moving esys with Ruch type of transition curves with fixed lengths
e_abs_bends Creates a moving esys guided by memory fields
e_reg_xpos Regulate the longitudinal position of a esys, for braking and acceleration.
l_local Creates a linear local lsys

Reference Manuals   Calc menu    Input Data Menu
l_type = `e_fix`

Creates a fixed esys.
The position of the coordinate system is set during the initial phase of the calculation, and does not move during the calculation.

  lsys e_fix  `l_name' (+-`)xk (+-`)yk (+-`)zk
l_name = Name of the coordinate system to be created.
xk,yk,zk = The coordinate system's location relative to fsys.

Generated variables in the main memory of the program:
l_name.x = l_name's x-coordinate relative to fsys.
l_name.y = l_name's y-coordinate relative to fsys.
l_name.z = l_name's z-coordinate relative to fsys.
l_name.f = l_name's f-coordinate relative to fsys.
l_name.k = l_name's k-coordinate relative to fsys.
l_name.p = l_name's p-coordinate relative to fsys.
l_name.vx = l_name's x-velocity relative to l_name's coordinate axes.
l_name.vy = l_name's y-velocity relative to l_name's coordinate axes.
l_name.vz = l_name's z-velocity relative to l_name's coordinate axes.
l_name.vf = l_name's f-velocity relative to l_name's coordinate axes.
l_name.vk = l_name's k-velocity relative to l_name's coordinate axes.
l_name.vp = l_name's p-velocity relative to l_name's coordinate axes.
l_name.ax = l_name's x-acceleration relative to l_name's coordinate axes.
l_name.ay = l_name's y-acceleration relative to l_name's coordinate axes.
l_name.az = l_name's z-acceleration relative to l_name's coordinate axes.
l_name.af = l_name's f-acceleration relative to l_name's coordinate axes.
l_name.ak = l_name's k-acceleration relative to l_name's coordinate axes.
l_name.ap = l_name's p-acceleration relative to l_name's coordinate axes.

Reference Manuals   Calc menu    Input Data Menu
l_type = `e_abs_bend`

Creates a moving esys, clothoid type of transition curves.
The moving esys is guided by three memory fields ro_field, fi_field and z_field. The curvature, cant and vertical lift of the coordinate system is created by a linear interpolation in the memory fields.

Input data syntax:

  lsys e_abs_bend  `l_name' +-`vx (+-`)x `ro_field' `fi_field' `z_field'     
l_name = Name of the coordinate system to be created.
vx = The longitudinal velocity of the coordinate system. Can be defined with a constant, variable or via a memory field.
If defined via a memory field speed should be given vs. position along the track.
x = The coordinate system's longitudinal start coordinate in relation to the fixed fsys. The argument for x may be a constant or a variable. If a variable is entered, the variable's value will be retrieved and stored as the start value to the variable l_name.pn. If the variable then changes its value, the prerequisites will not be changed during the course of the calculation.
ro_field = Designed track curvature defined in a memory field. The memory field should define curvature vs. position along the track.
fi_field = Designed cant defined in a memory field. The memory field should define cant vs. position along the track. Cant shall be given in [rad].
z_field = Designed track vertical level defined in a memory field. The memory field should define vertical position vs. position along the track. Positive direction for vertical position is downwards.
If cant is created by rotating the track around track center line, the vertical level of the track is not affected by the cant angle. However if cant is created by rotating the track around low ral, the track center line will lift in curves.

The variables created by lsys e_abs_bend are the same as created by lsys e_fix. Plus the following variables:

l_name.pn = Position along the track.
l_name.b = Designed track curvature. [1/m]
l_name.vb = Designed track curvature speed.
l_name.ab = Designed track curvature acceleration.
l_name.c = Designed cant [rad]
l_name.vc = Designed cant velocity
l_name.ac = Designed cant acceleration
l_name.h = Designed level of track center line, positive downwards
l_name.vh = Designed vertical speed of track center line
l_name.ah = Designed vertical acceleration of track center line
Reference Manuals   Calc menu    Input Data Menu
l_type = `e_abs_bendr`

Creates a moving esys with transition curves proposed by Ruch in 1903, see equations below.
The three memory fields ro_field, fi_field and z_field, defines designed curvature, designed cant and designed vertical lift of track center line.

Input data syntax:

 lsys e_abs_bendr  `l_name'    +-`vx  (+-`)x                           
                   `ro_field'      `fi_field'      `z_field'           
                   (+-`)b1 (+-`)b2 (+-`)f1 (+-`)f2 (+-`)z1 (+-`)z2     
l_name = Name of the coordinate system to be created.
vx = The longitudinal velocity of the coordinate system. Can be defined with a constant, variable or via a memory field.
If defined via a memory field speed should be given vs. position along the track.
x = The coordinate system's longitudinal start coordinate in relation to the fixed fsys. The argument for x may be a constant or a variable. If a variable is entered, the variable's value will be retrieved and stored as the start value to the variable l_name.pn. If the variable then changes its value, the prerequisites will not be changed during the course of the calculation.
ro_field = Designed track curvature defined in a memory field. The memory field should define curvature vs. position along the track.
fi_field = Designed cant defined in a memory field. The memory field should define cant vs. position along the track. Cant shall be given in [rad].
z_field = Designed track vertical level defined in a memory field. The memory field should define vertical position vs. position along the track. Positive direction for vertical position is downwards.
If cant is created by rotating the track around track center line, the vertical level of the track is not affected by the cant angle. However if cant is created by rotating the track around low ral, the track center line will lift in curves.
b1 = Relative length of the transition curve's first part, for the curvature.
b2 = Relative length of the transition curve's third part, for the curvature.
f1 = Relative length of the transition curve's first part, for the roll rotation.
f2 = Relative length of the transition curve's third part, for the roll rotation.
z1 = Relative length of the transition curve's first part, for the vertical lift.
z2 = Relative length of the transition curve's third part, for the vertical lift.

The variables created by lsys e_abs_bendr are the same as created by lsys e_abs_bend.

Below is a description of the transition curve's mathematical form for the track's curvature. The same equations also apply to cant and vertical lift of the track center line.

Notations:                                                                    
Lt   = Total length of the transition curve, including all three parts.       
Lt*e1= Length of the first part of the transition curve.                      
Lt*e2= Length of the third part of the transition curve.                      
k0   = Curvature at the beginning of the transition curve.                    
k1   = Curvature at the end of the transition curve.                          
s    = Distance along the track.                                              
k'   = The curvature's derivative in the second part of the transition curve. 
                                                                              
                                                                              
Conditions:                                                                   
Lt > 0                                                                     
0 < e1 < 1                                                              
0 < e2 < 1                                                              
e1+e2 < 1                                                                  
                                                                              
Equations:                                                                    
                                                                              
k' = (k1-k0)/Lt/(1-e1/2-e2/2)                                                 
                                                                              
The following applies for the first part:                                     
                                                                              
k(s) = k0 + s^2*k'/Lt/e1/2                                                    
0 < s < Lt*e1                                                           
                                                                              
The following applies for the second part:                                    
                                                                              
k(s) = k0 + (s-Lt*e1/2)*k'                                                    
Lt*e1 < s < Lt-Lt*e2                                                    
                                                                              
The following applies for the third part:                                     
                                                                              
k(s) = k1 - (Lt - s)^2*k'/Lt/e2/2                                             
Lt-Lt*e2 < s < Lt

The three functions are created in such a way that the function and its first derivative are continuous within the transition curve and to the connecting circular curves.

The special case e1= e2= 0. makes the Ruch-curve equal to a clothoid.

The special case e1= e2= 0.5 makes the Ruch-curve equal to a Helmert or Schramm curve

Reference Manuals   Calc menu    Input Data Menu
l_type = `e_abs_bendrf`

Creates a moving esys with Ruch type of transition curves with fixed lengths
This coordinate system is very similar to lsys e_abs_bendr, but in lsys e_abs_bendrf the first and third part (e1 and e2) of the transition curve have fixed lengths.
If the length of the transition curve is shorter than e1+e2, then coordinate system e_abs_bendrf will create a transition curve according to Helmert.

Input data syntax:

 lsys e_abs_bendrf `l_name'    +-`vx  (+-`)x                           
                   `ro_field'      `fi_field'      `z_field'           
                   (+-`)b1 (+-`)b2 (+-`)f1 (+-`)f2 (+-`)z1 (+-`)z2     
l_name = Name of the coordinate system to be created.
vx = The longitudinal velocity of the coordinate system. Can be defined with a constant, variable or via a memory field.
If defined via a memory field speed should be given vs. position along the track.
See example in Example of a rail road vehicle input data model
x = The coordinate system's longitudinal start coordinate in relation to the fixed fsys. The argument for x may be a constant or a variable. If a variable is entered, the variable's value will be retrieved and stored as the start value to the variable l_name.pn. If the variable then changes its value, the prerequisites will not be changed during the course of the calculation.
ro_field = Designed track curvature defined in a memory field. The memory field should define curvature vs. position along the track.
fi_field = Designed cant defined in a memory field. The memory field should define cant vs. position along the track. Cant shall be given in [rad].
z_field = Designed track vertical level defined in a memory field. The memory field should define vertical position vs. position along the track. Positive direction for vertical position is downwards.
If cant is created by rotating the track around track center line, the vertical level of the track is not affected by the cant angle. However if cant is created by rotating the track around low ral, the track center line will lift in curves.
b1 = Length of the transition curve's first part, for the curvature.
b2 = Length of the transition curve's third part, for the curvature.
f1 = Length of the transition curve's first part, for the roll rotation.
f2 = Length of the transition curve's third part, for the roll rotation.
z1 = Length of the transition curve's first part, for the vertical lift.
z2 = Length of the transition curve's third part, for the vertical lift.

The variables created by lsys e_abs_bendrf are the same as created by lsys e_abs_bend.

Below is a description of the transition curve's mathematical form for the track's curvature. The same equations also apply to cant and vertical lift of the track center line.

Notations:                                                                   
Lt = Total length of the transition curve, including all three parts.        
d1 = Length of the transition curve's first part.                            
d2 = Length of the transition curve's third part.                            
k0 = Curvature at the beginning of the transition curve.                     
k1 = Curvature at the end of the transition curve.                           
s  = Distance along the track.                                               
k' = The curvature's derivative in the second part of the transition curve.  
                                                                             
                                                                             
Conditions:                                                                  
Lt > 0                                                                    
0 < d1 < Lt                                                            
0 < d2 < Lt                                                            
d1+d2 < Lt                                                                
                                                                             
Equations:                                                                   
                                                                             
k' = (k1-k0) / (Lt-d1/2-d2/2)                                                
                                                                             
The following applies for the first part:                                    
                                                                             
k(s) = k0 + s^2*k'/(2*d1)                                                    
0 < s < d1                                                             
                                                                             
The following applies for the second part:                                   
                                                                             
k(s) = k0 + (s-d1/2)*k'                                                      
d1 < s < Lt-d2                                                         
                                                                             
The following applies for the third part:                                    
                                                                             
k(s) = k1 - (Lt - s)^2*k'/(2*d2)                                             
Lt-d2 < s < Lt                                                         

Reference Manuals   Calc menu    Input Data Menu
l_type = `e_abs_bends`

Creates a moving esys, guided by three memory fields ro_field, fi_field and z_field.
Interpolation in the memory fields are made with cubic splines.

Input data syntax:

 lsys e_abs_bends  `l_name' +-`vx (+-`)x  `ro_field' `fi_field' `z_field'    
l_name = Name of the coordinate system to be created.
vx = The longitudinal velocity of the coordinate system. Can be defined with a constant, variable or via a memory field.
If defined via a memory field speed should be given vs. position along the track.
x = The coordinate system's longitudinal start coordinate in relation to the fixed fsys. The argument for x may be a constant or a variable. If a variable is entered, the variable's value will be retrieved and stored as the start value to the variable l_name.pn. If the variable then changes its value, the prerequisites will not be changed during the course of the calculation.
ro_field = Designed track curvature defined in a memory field. The memory field should define curvature vs. position along the track.
fi_field = Designed cant defined in a memory field. The memory field should define cant vs. position along the track. Cant shall be given in [rad].
z_field = Designed track vertical level defined in a memory field. The memory field should define vertical position vs. position along the track. Positive direction for vertical position is downwards.
If cant is created by rotating the track around track center line, the vertical level of the track is not affected by the cant angle. However if cant is created by rotating the track around low ral, the track center line will lift in curves.

The variables created by lsys e_abs_bends are the same as created by lsys e_abs_bend.

Reference Manuals   Calc menu    Input Data Menu
l_type = `e_reg_xpos`

Controls the longitudinal position of a moving esys.
The position, velocity and acceleration of a Euler coordinate system, is controlled by connecting the coordinate system to a mass.

Input data syntax:

 lsys e_reg_xpos  `l_name' `m_name' (+-`)efreq (+-`)edamp      
l_name = Name of the coordinate system, the x-coordinate of which shall be regulated. If the coordinate system has not been defined, an error will occur and the program will stop.
m_name = Name of the body which will control the coordinate system l_name's x-position.
efreq = Eigenfrequency which defines how hard the coordinate system l_name will be linked to the body m_name.
edamp = Damping in the regulation of l_name, edamp shall be expressed in fraction of critical damping.

Reference Manuals   Calc menu    Input Data Menu
l_type = `l_local`

Creates a linear local coordinate system.
L_local considers only small angles relative to the esys which lsys is related to. If the given esys system is one of the following types: e_abs_bend, e_abs_bendr, e_abs_bendrf or e_abs_bends, the same curvature, cant, and vertical lift will be used as defined in the definition of esys.

Input data syntax:

 lsys l_local  `l_name' `esys' (+-`)xk (+-`)yk (+-`)zk   
l_name = Name of the coordinate system created.
esys = Name of the Euler system, which l_name relates to. If a lsys is given instead of an esys , the program will look up the esys to which the given lsys is related to, and xk,yk,zk will be summed up from both the systems.
xk,yk,zk = The coordinate system's location relative to esys.

N.B. If the linear local coordinate system is connected to a Euler system of type e_abs_bend, e_abs_bendr, e_abs_bendrf or e_abs_bends, all the coordinate systems shall be defined on top of rail.


Generated variables in the main memory of the program:
l_name.x = L_name's x-coordinate relative to esys.
l_name.y = L_name's y-coordinate relative to esys.
l_name.z = L_name's z-coordinate relative to esys.
l_name.f = L_name's f-coordinate relative to esys.
l_name.k = L_name's k-coordinate relative to esys.
l_name.p = L_name's p-coordinate relative to esys.
l_name.vx = L_name's x-velocity relative to esys.
l_name.vy = L_name's y-velocity relative to esys.
l_name.vz = L_name's z-velocity relative to esys.
l_name.vf = L_name's f-velocity relative to esys.
l_name.vk = L_name's k-velocity relative to esys.
l_name.vp = L_name's p-velocity relative to esys.
l_name.ax = L_name's x-acceleration relative to esys.
l_name.ay = L_name's y-acceleration relative to esys.
l_name.az = L_name's z-acceleration relative to esys.
l_name.af = L_name's f-acceleration relative to esys.
l_name.ak = L_name's k-acceleration relative to esys.
l_name.ap = L_name's p-acceleration relative to esys.

If lsys is connected to e_abs_bend, e_abs_bendr or e_abs_bends the following variables will also be generated in main memory:

l_name.pn = Position along the track.
l_name.b = Designed track curvature. [1/m]
l_name.vb = Designed track curvature speed.
l_name.ab = Designed track curvature acceleration.
l_name.c = Designed cant [rad]
l_name.vc = Designed cant velocity
l_name.ac = Designed cant acceleration
l_name.h = Designed level of track center line, positive downwards
l_name.vh = Designed vertical speed of track center line
l_name.ah = Designed vertical acceleration of track center line

Reference Manuals   Calc menu    Input Data Menu

`max_exec_time` = (+-`)value

Setting max length of execution time.
If the execution time exceeds max_exec_time the calculation will be interrupted. If max_exec_time is less or equal to 0.(zero), max_exec_time will not be used.
The simulation can manually be stopped prematurely, if a file named "id/$IDENT.stop" is created.
Reference Manuals   Calc menu    Input Data Menu


`modal`

Order the CALC-program to perform a modal analysis.
Normally this command is given via the script modal when the modal analysis is initiated, but can also be given manually if desired.


Reference Manuals   Calc menu    Input Data Menu

`modal_param` = `m_method`, input(*)

Defines different parameters for the modal analysis.
If command modal_param not is given in the input data file, m_method='Schur_fact1' with it's default values will apply.
Command `modal_param` has the following subcommands:

QRfact_1 Solves the eigenvalues by the QR method.
Schur_fact1 Solves the eigenvalues by Schur factorization.

`f_method` = `QRfact_1`

Solves all the eigenvalues in complex form by the QR method. The complex eigenvectors are then solved by the inverse shifted power method. The system of equations is linearized and the Jacobian J is calculated before the modal analysis starts.

 modal_param QRfact_1  tol_ym tol_jm linj_eps mloopm ntrimm  
                       idof_1 leps_1  idof_2 leps_2  idof_3 etc.  
tol_ym = Tolerance for the eigenvalue, which must be met before the QR-iteration ends.
tol_jm = Tolerance for off-diagonal elements in the Jacobian, which must be met before the QR- iteration ends.
linj_eps = Amplitude which is used in the linearization process.
Default value of linj_eps is 1.e-4.
mloopm = The maximum number of loops per eigenvalue, before the solution process is interrupted.
ntrimm = The number of loops in the inverse shifted power method, for the calculation of eigenvectors.
idof_1 = Equation number which shall be subjected to the linearization amplitude leps_1
In order to get the number of the equation it can be necessary to make a preliminary calculation with idebug=1. Input data parameter idebug=1 forces program CALC to write the calc.out-file. The second table "Output of equations" in the calc.out-file contains the equation numbers, in the first leftmost column.
Declared Integer*4   Default= n.a.
leps_1 = Amplitude which is used in the linearization process for equation number idof_1.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.
idof_2 = Equation number which shall be subjected to the linearization amplitude leps_2
Declared Integer*4   Default= n.a.
leps_2 = Amplitude which is used in the linearization process for equation number idof_2.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.

The input parameters have the following default values:

tol_ym  = 1.e-5
tol_jm  = 1.e-7
linj_eps= 1.e-4
mloopm  = 50   
ntrimm  = 3    
Reference Manuals   Calc menu    Input Data Menu
`f_method` = `Schur_fact1`

Solves all the eigenvalues in complex form with Schur factorization. Subroutines from the LAPACK library have been used, when solving the eigenvalue problem with this method. The system of equations is linearized and the Jacobian J is calculated before the modal analysis starts.

 modal_param Schur_fact1  linj_eps  idof_1 leps_1  idof_2 leps_2  idof_3 etc.  
linj_eps = Amplitude which is used in the linearization process.
Default value of linj_eps is 1.e-4.
idof_1 = Equation number which shall be subjected to the linearization amplitude leps_1
In order to get the number of the equation it can be necessary to make a preliminary calculation with idebug=1. Input data parameter idebug=1 forces program CALC to write the calc.out-file. The second table "Output of equations" in the calc.out-file contains the equation numbers, in the first leftmost column.
Declared Integer*4   Default= n.a.
leps_1 = Amplitude which is used in the linearization process for equation number idof_1.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.
idof_2 = Equation number which shall be subjected to the linearization amplitude leps_2
Declared Integer*4   Default= n.a.
leps_2 = Amplitude which is used in the linearization process for equation number idof_2.
This value will override the general amplitude given in linj_eps.
Declared Real*4   Default= n.a.

The input parameters have the following default values:

 linj_eps = 1.e-4
Reference Manuals   Calc menu    Input Data Menu

`no_warning`

Suppresses warning messages from command func. When the user is acquainted with the warning texts from CALC, she/he can suppress the undesired warnings by using this command. The suppressing of warning messages is only valid for the next func-command, after the no_warning-command.


Reference Manuals   Calc menu    Input Data Menu

`overwrite_property`

Command overwrite_property makes it possible to overwrite an existent coupling property in the main memory. In the normal case coupling properties cannot be redefined, because different properties need different amount of memory cells. If the command overwrite_property is given in the beginning of the input data file, an existing property in the memory will be overwritten by the new property, if they have the same name. Program CALC will in this case: erase all values for the old existing property in existing memory position, write the new property last in the memory, and move all references to the new location of the property.

The reason for introducing this command is to keep backward compatibility for old input data files.


Reference Manuals   Calc menu    Input Data Menu

`post_process`   'cmd_string'

Execute an UNIX-command after the calculation.
When the calculation is finished, program CALC will send the string 'cmd_string' to the UNIX-system. Up to ten post_process-commands can be given in the input data file for program CALC. In the post_process-command the user has access to the $IDENT-variable. The $IDENT-variable will in the post_process-command be expanded to the name of the current ident-string.


Example:
The following example shows how the post_process-command can be used for post processing the results in program MPLOT and sending the plots to your printer:

if_then_char_init  CalcType .eq. TSIM  .or.                   
                   CalcType .eq. MODAL                        
 post_process= 'mplot mplotf/Tsim_Safe_OneIdent.mplotf $IDENT'
 post_process= 'pri diags/$IDENT.ps'                          
endif                                                         

Reference Manuals   Calc menu    Input Data Menu

`pre_process`   'cmd_string'

Execute an UNIX-command before the calculation starts.
The user can here for instance, define a pre processing activity in the KPF, NPICK or QUASI program.
In string 'cmd_string' two variables are understood:

$IDENT Will be replaced by the current ident-string of the running case
$CURRENT_FILE Will be replaced by the current input data file

An unlimited number of pre_process-commands can be given in the input data file for CALC.


Example:
The following example shows how the pre_process-command can be used for automatic update of modal shapes of an elastic body, and also calculates the quasistatical position before the time-domain or modal analysis begins:

if_then_char_init  CalcType .eq. TSIM  .or.                                                         
                   CalcType .eq. MODAL                                                              
 pre_process= 'sed s!runf/Master.runf!$CURRENT_FILE! npickf/Master.npickf > npickf/$IDENT.npickf'
 pre_process= 'npick npickf/$IDENT.npickf'                                                          
 pre_process= 'quasi $CURRENT_FILE'                                                                 
endif                                                                                               

Also the following lines must be entered into the input data file in order to read the results from program NPICK and QUASI.

if_then_char_init CalcType .ne. NPICK         
 insert file npickr/$IDENT.npickr             
endif                                         
                                              
if_then_char_init CalcType .eq. TSIM  .or.    
                  CalcType .eq. MODAL         
 initval read_gpdat gp/$IDENT.gp 1            
endif                                         

Reference Manuals   Calc menu    Input Data Menu

`quasi`

Order the CALC-program to perform a quasistatical analysis.
Normally this command is given via the script modal when the modal analysis is initiated, but can also be given manually if desired.


Reference Manuals   Calc menu    Input Data Menu

`quasi_param` = `q_method`, input(*)

Defines different parameters for the quasistatical analysis.
If command quasi_param not is given in the input data file, q_method='Damped_Tens' with it's default values will apply. Command `quasi_param` has the following subcommands:

LineSearch_1 Searches the quasistatical equilibrium according to method LineSearch_1.
LineSearch_2 Searches the quasistatical equilibrium according to method LineSearch_2.
LineSearch_3 Searches the quasistatical equilibrium according to method LineSearch_3.
m_NewRaph_1 Solves the state of equilibrium with a damped Newton-Raphson method.
m_NewRaph_2 Solves the state of equilibrium with a modified Newton-Raphson method.
Damped_Tens Solves the state of equilibrium with a tensor based method.

`q_method` = `LineSearch_1`

The solution of the system's state of equilibrium according to LineSearch_1 is undertaken in a combination of two methods which work in series with each other.
Method 1 is a direct method which corresponds to an integration of equations according to Euler's method. The program integrates a number of step equations in "mstepk" in the following way: y(1) = y(0) + tstep*dy(0) where both "mstepk" and "tstep" are input parameters.
Method 2 seeks the state of equilibrium by searching in the gradient's direction. After method 1 has taken the step "mstepk", method 2 starts by linearizing the system in order to calculate the direction of the gradient. During the linearization process, every degree of freedom is disturbed by an amplitude of "linj_eps". After the linearization, the program advances in the direction of the gradient in steps which are proportional to "sfact". When the minimum point has been passed, the program makes a bottom search. If the tolerance not has been met after 5 bottom searches, the program will return to method 1 again.

 quasi_param LineSearch_1  tol linj_eps sfact tstep max_loop mstepk    
tol = Tolerance in the derivative of the degree of freedoms, which shall be met before the calculation ends.
linj_eps = Amplitude which is used in the linearization process for the calculation of the direction of the gradient direction in method number 2.
sfact = Size of the steps in the line searching part of method number 2.
tstep = Time step which is used in the integration phase in method 1.
max_loop = The maximum number of solution attempts which may be executed jointly by method 1 and method 2 before the calculation is interrupted.
mstepk = Number of steps that integration will undertake before solution method 2 takes over.

The input parameters have the following default values:

tol     = 1.e-4
linj_eps= 1.e-6
sfact   = 0.02 
tstep   = 0.001
max_loop= 60   
mstepk  = 40   
Reference Manuals   Calc menu    Input Data Menu
`q_method` = `LineSearch_2`

The solution of the system's state of equilibrium according to LineSearch_2 is undertaken in a combination of three methods which work in series with each other.
Method 0 is a simple method which only roughly positions all degrees of freedom in the model, then method LineSearch_1 takes over for making fine adjustments of the positions of the model.
Method 1 is a direct method which corresponds to an integration of equations according to Euler's method. The program integrates a number of step equations in "mstepk" in the following way: y(1) = y(0) + tstep*dy(0) where both "mstepk" and "tstep" are input parameters.
Method 2 seeks the state of equilibrium by searching in the gradient's direction. After method 1 has taken the step "mstepk", method 2 starts by linearizing the system in order to calculate the direction of the gradient. During the linearization process, every degree of freedom is disturbed by an amplitude of "linj_eps". After the linearization, the program advances in the direction of the gradient in steps which are proportional to "sfact". When the minimum point has been passed, the program makes a bottom search. If the tolerance not has been met after 5 bottom searches, the program will return to method 1 again.

During the solution phase, the program CALC makes a continuous print out of the input data model's status on standard output, so that the user can follow the solution process. The print text contains the following information:

Line 1: the first 12 letters of the degree of freedom's name
Line 2: the last 12 letters of the degree of freedom's name
Line 3: position of the degree of freedom
Line 4: velocity of the degree of freedom
Line 5: acceleration of the degree of freedom

 quasi_param LineSearch_2  tol linj_eps sfact tstep max_loop mstepk    
tol = Tolerance in the derivative of the degree of freedoms, which shall be met before the calculation ends.
linj_eps = Amplitude which is used in the linearization process for the calculation of the direction of the gradient direction in method number 2.
sfact = Size of the steps in the line searching part of method number 2.
tstep = Time step which is used in the integration phase in method 1.
max_loop = The maximum number of solution attempts which may be executed jointly by method 1 and method 2 before the calculation is interrupted.
mstepk = Number of steps that integration will undertake before solution method 2 takes over.

The input parameters have the following default values:

tol     = 1.e-4
linj_eps= 1.e-6
sfact   = 0.02 
tstep   = 0.001
max_loop= 60   
mstepk  = 40   
Reference Manuals   Calc menu    Input Data Menu
`q_method` = `LineSearch_3`

The solution of the system's state of equilibrium according to LineSearch_3 is undertaken in a combination of two methods which work in series with each other.
Method 1 is a direct method which corresponds to an integration of equations according to implicit Euler's method. The program integrates a number of step equations in "mstepk" in the following way: y(1) = y(0) + tstep*dy(0) where both "mstepk" and "tstep" are input parameters.
Method 2 seeks the state of equilibrium by searching in the gradient's direction. After method 1 has taken the step "mstepk", method 2 starts by linearizing the system in order to calculate the direction of the gradient. During the linearization process, every degree of freedom is disturbed by an amplitude of "linj_eps". After the linearization, the program advances in the direction of the gradient in steps which are proportional to "sfact". When the minimum point has been passed, the program makes a bottom search. If the tolerance not has been met after 5 bottom searches, the program will return to method 1 again.

 quasi_param LineSearch_3  tol linj_eps sfact tstep max_loop mstepk    
tol = Tolerance in the derivative of the degree of freedoms, which shall be met before the calculation ends.
linj_eps = Amplitude which is used in the linearization process for the calculation of the direction of the gradient direction in method number 2.
sfact = Size of the steps in the line searching part of method number 2.
tstep = Time step which is used in the integration phase in method 1.
max_loop = The maximum number of solution attempts which may be executed jointly by method 1 and method 2 before the calculation is interrupted.
mstepk = Number of steps that integration will undertake before solution method 2 takes over.

The input parameters have the following default values:

tol     = 1.e-4 
linj_eps= 1.e-6 
sfact   = 0.001 
tstep   = 0.0001
max_loop=  50   
mstepk  = 500   

Reference Manuals   Calc menu    Input Data Menu
`q_method` = `m_NewRaph_1`

Solves the state of equilibrium with a modified Newton-Raphson method. The modified method includes a damping term, in order to increase the stability during the solution process.

  The Newton-Raphson method           The damping term                
                                                                      
                                         (afact   +sfact)             
x(n+1) = x(n) - inv(J) * f(x(n)) * min ( ————————————————  , 1.)      
                                         (error_dy+sfact)             

The Jacobian J is calculated by linearizing the system of equations. Afact and sfact are constants which are defined as input parameters to the quasi_param-command. Error_dy is the error in the derivative of the system equations in every iteration. The damping term entails that when error_dy is big, the iteration will take small steps towards the expected minimum point. When error_dy is smaller than afact, the iteration is carried out at full amplitude.

 quasi_param m_NewRaph_1  tol linj_eps sfact afact max_loop    
tol = Tolerance in the derivative of the degree of freedoms, which shall be met before the calculation ends.
linj_eps = Amplitude used in the linearization process.
sfact = Factor used in the solution method, see above.
afact = Factor used in the solution method, see above.
max_loop = Maximum number of iterations before the calculation will be interrupted.

The input parameters have the following default values:

tol     = 1.e-4
linj_eps= 1.e-6
sfact   = 0.02 
tstep   = 0.001
max_loop= 60   
Reference Manuals   Calc menu    Input Data Menu
`q_method` = `m_NewRaph_2`

Solves the state of equilibrium with a modified Newton-Raphson method. In this method external loads are applied in several small steps, in order to ensure finding the right solution even to extremely non-linear problems. Even this method contains a damping term to increase stability during the solution process. The damping term has the same appearance as in the method `m_NewRaph_1`.

  The Newton-Raphson method           The damping term           
                                                                 
                                         (afact   +sfact)        
x(n+1) = x(n) - inv(J) * f(x(n)) * min ( ————————————————  , 1.) 
                                         (error_dy+sfact)        

The Jacobian J is calculated by linearizing the system of equations. Afact and sfact are constants which are defined as input parameters to the quasi_param-command. Error_dy is the error in the derivative of the system equations in every iteration. The damping term entails that when error_dy is big, the iteration will take small steps towards the expected minimum point. When error_dy is smaller than afact, the iteration is carried out at full amplitude.

 quasi_param m_NewRaph_2  nsteg tol linj_eps sfact afact max_loop      
nsteg = The number of loading steps.
tol = Tolerance in the derivative of the degree of freedoms, which shall be met before the calculation ends.
linj_eps = Amplitude used in the linearization process.
sfact = Factor used in the solution method, see above.
afact = Factor used in the solution method, see above.
max_loop = Maximum number of iterations before the calculation will be interrupted.

The input parameters have the following default values:

nsteg    = 10      
tol      = 1.e-4   
linj_eps = 1.e-6   
sfact    = 0.02    
tstep    = 0.001   
max_loop = 60      
Reference Manuals   Calc menu    Input Data Menu
`q_method` = `Damped_Tens`

Solves the state of equilibrium with a tensor based method in combination with a time simulation. In the simulation phase, external damping is added to the system in order to quickly adopt the quasistatical solution.
Input data:

 quasi_param Damped_Tens  tol fact max_loop tsim1  
tol = Tolerance in the derivative of the degree of freedoms, which shall be met before the calculation ends.
fact = Factor which controls the speed of the solution process. In most cases this factor can be set to 1. However in some cases, for example in curves less than 100 [m] radius it can be necessary to reduce this factor to a smaller value. For safety reasons the default value of this parameter has been chosen to 0.1
max_loop = The maximum number of solution attempts which may be executed jointly by method 1 and method 2 before the calculation stop.
tsim1 = The length of the time-simulation in the first loop.

The input parameters have the following default values:

tol      = 1.e-4   
fact     = 0.1     
max_loop =  20     
tsim1    =  2.     

Reference Manuals   Calc menu    Input Data Menu

`s_var` = 's_type`, input(*)

Definition of variables to be stored for post-processing.
Command `s_var` has the following subcommands:

force_on Store all forces acting on specified mass in specified direction
gpdat_force1 Write coupling forces to the GPdat-file
gpdat_r1 Write the motions of all masses to the GPdat-file
gpdat_wheel_prof Write wheel data information to the GPdat-file
gpdat_wheel_info Same as gpdat_wheel_prof, but the wheel profile is read in millimeters
gpdat_rail_prof_left Write rail data information to the GPdat-file, left rail
gpdat_rail_prof_right Write rail data information to the GPdat-file, right rail
gpdat_rail_info_left Same as gpdat_rail_prof_left, but the rail profile is read in millimeters
gpdat_rail_info_right Same as gpdat_rail_prof_right, but the rail profile is read in millimeters
scalar_0 Store a variable as a scalar on the MPdat-file
sngl Store a variable as a vector on the MPdat-file
sngl_filt Same as sngl, but the variable is filtered through s_var_filter before storing
var_0 Store a variable both as a vector and a scalar on the MPdat-file
var_0_filt Same as var_0, but the variable is filtered through s_var_filter before storing

s_type = `force_on`

Store all forces acting on specified mass in specified direction.
This command can be used for debugging, if a mass is vibrating or moving in a unexpected way. By using the force_on-command it is quick and easy to store all forces connected to the vibrating mass, for later plotting in MPLOT. Comparing the frequencies of the forces and the motion of the mass, it is easy to find the force that is causing the vibration. The names of the forces stored by this command is written to standard output.

 s_var force_on  m_name dire  
m_name = Name of the mass for which the forces shall be stored.
dire = Direction of the mass for which the forces shall be stored.

Reference Manuals   Calc menu    Input Data Menu
s_type = `gpdat_force1`

Orders program TSIM to write the coupling forces to the GPdat-file.
In post processor GPLOT the forces will be animated together with the model. The forces are written every N*tout (where N is an arbitrary integer).

 s_var gpdat_force1  var
var = Name of the coupling force which shall be stored in the GPdat-file.
Reference Manuals   Calc menu    Input Data Menu
s_type = `gpdat_r1`

Orders program TSIM and MODAL to write the motions of all masses to the GPdat-file.
These motions can be read into the post processor GPLOT for animation. The motions of all masses are written every N*tout (where N is an arbitrary integer).

 s_var gpdat_r1   
Reference Manuals   Calc menu    Input Data Menu
s_type = `gpdat_wheel_prof`

Orders program TSIM to write the wheel profile to the GPdat-file.
In plotting mode Show 4 diags, in program GPLOT, the user has the possibility to view:

The wheel/rail geometries, creepages and forces are written to GPdat-file every tout.

To make this command work also command gpdat_rail_prof_left and gpdat_rail_prof_right must be given in input data.

 s_var gpdat_wheel_prof  wheel_name lsys.b w_prof
wheel_name = The name or number of wheel to be stored.
lsys.b = The name of the variable which contains the curvature of the track. The variable is used in the animation to show if the vehicle is negotiating a left or right handed curve.
w_prof = The name of the ASCII-file describing the shape of the wheel profile.

Reference Manuals   Calc menu    Input Data Menu
s_type = `gpdat_wheel_info`

Same as gpdat_wheel_prof.
The only difference is that the wheel profile w_prof is read in millimeter.

 s_var gpdat_wheel_info  wheel_name lsys.b w_prof
wheel_name = The name or number of wheel to be stored.
lsys.b = The name of the variable which contains the curvature of the track. The variable is used in the animation to show if the vehicle is negotiating a left or right handed curve.
w_prof = Wheel profile in millimeter.

Reference Manuals   Calc menu    Input Data Menu
s_type = `gpdat_rail_prof_left` and `gpdat_rail_prof_right`

Orders program TSIM to write the rail profiles to the GPdat-file.
In plotting mode Show 4 diags, in program GPLOT, the user has the possibility to view:

The wheel/rail geometries, creepages and forces are written to GPdat-file every tout.

To make this command work also command gpdat_wheel_prof must be given in input data.

  s_var gpdat_rail_prof_left   X_coord_l1  r_prof_l1  
                               X_coord_l2  r_prof_l2  
                               X_coord_l3  r_prof_l3  
                               X_coord_l4  ,,,etc.    
                                                      
  s_var gpdat_rail_prof_right  X_coord_r1  r_prof_r1  
                               X_coord_r2  r_prof_r2  
                               X_coord_r3  r_prof_r3  
                               X_coord_r4  ,,,etc.    
X_coord_?? = The X-coordinate along the track where this profile is valid.
r_prof_?? = The name of the ASCII-file describing the shape of the rail profile.

Reference Manuals   Calc menu    Input Data Menu
s_type = `gpdat_rail_info_left` and `gpdat_rail_info_right`

Same as gpdat_rail_prof_left and gpdat_rail_prof_right.
The only difference is that the rail profiles are read in millimeters.

  s_var gpdat_rail_info_left   X_coord_l1  r_prof_l1  
                               X_coord_l2  r_prof_l2  
                               X_coord_l3  r_prof_l3  
                               X_coord_l4  ,,,etc.    
                                                      
  s_var gpdat_rail_info_right  X_coord_r1  r_prof_r1  
                               X_coord_r2  r_prof_r2  
                               X_coord_r3  r_prof_r3  
                               X_coord_r4  ,,,etc.    
X_coord_?? = The X-coordinate along the track where this profile is valid.
r_prof_?? = The rail profile in millimeter.

Reference Manuals   Calc menu    Input Data Menu
s_type = `scalar_0`

Orders program TSIM and QUASI to write a variable's value at time=0 as a scalar on the MPdat-file.
These scalars can be read into the post processors MPLOT, MTABLE, CATAS or CATAF for post processing and plotting.

 s_var scalar_0  s_name
s_name = Name of the variable to be stored.

Reference Manuals   Calc menu    Input Data Menu
s_type = `sngl`

Store a variable as a vector in single precision in the MPdat-file.
The vector can be read into the post processors MPLOT, MTABLE, CATAS or CATAF for post processing and plotting. The variables are written every N*tout (where N is an arbitrary integer).

 s_var sngl  s_name    
s_name = Name of the variable to be stored.

Reference Manuals   Calc menu    Input Data Menu
s_type = `sngl_filt`

Same as sngl, but the variable is filtered through s_var_filter before storing.

 s_var sngl_filt  s_name    
s_name = Name of the variable to be stored.

Reference Manuals   Calc menu    Input Data Menu
s_type = `var_0`

Store a variable both as a vector and a scalar in the MPdat-file.
Its scalar value is taken for time= 0. These vectors and scalars can be read into the post processors MPLOT, MTABLE, CATAS or CATAF for post processing and plotting. The variables are written every N*tout (where N is an arbitrary integer). In apart from the commands s_var sngl and s_var scalar_0 above, no error message will appear if the variable is missing.

 s_var var_0 s_name    
s_name = Name of the variable to be stored.

Reference Manuals   Calc menu    Input Data Menu
s_type = `var_0_filt`

Same as var_0, but the variable is filtered through s_var_filter before storing.

 s_var var_0_filt s_name    
s_name = Name of the variable to be stored.

Reference Manuals   Calc menu    Input Data Menu

`s_var_filter` = 's_var_filter_type`, input(*)

Anti-aliasing filter to be passed before writing variables to MPdat-file. Following filters are available:

none No filtering. The variables are directly written to the MPdat-file
lpass2q Second order low-pass filter. Initial value copied from the unfiltered variables.
lpass2q_0 Second order low-pass filter. Initial value equal to 0. for all variables.
lpass4q Fourth order low-pass filter. Initial value copied from the unfiltered variables.
lpass4q_0 Fourth order low-pass filter. Initial value equal to 0. for all variables.

Default value: "s_var_filter= lpass4q   20. 0.9239 20. 0.3827"


s_var_filter_type = `none`

No filtering may lead to anti-aliasing error, if the value of timeout is too large.

 s_var_filter= none  

s_var_filter_type = `lpass2q`

Second order low-pass filter. To avoid anti-aliasing error the cut-off frequency should not be larger than 1./(2.*timeout).
The initial value of the filtered variable will be set equal to the first value of the unfiltered variable.

 s_var_filter= lpass2q f_cut-off set
f_cut-off = Cut-off frequency.
set = Relative damping.

s_var_filter_type = `lpass2q_0`

Second order low-pass filter. To avoid anti-aliasing error the cut-off frequency should not be larger than 1./(2.*timeout).
The initial value of the filtered variable will be set equal to 0.(zero).

 s_var_filter= lpass2q_0 f_cut-off set
f_cut-off = Cut-off frequency.
set = Relative damping.

s_var_filter_type = `lpass4q`

Fourth order low-pass filter. To avoid anti-aliasing error the cut-off frequency should not be larger than 1./(2.*timeout). The filter is built by two second order filters in serie.
The initial value of the filtered variable will be set equal to the first value of the unfiltered variable.

 s_var_filter= lpass4q  f_cut-off_1 set_1  f_cut-off_2 set_2
f_cut-off_1 = Cut-off frequency first filter.
set_1 = Relative damping first filter.
f_cut-off_2 = Cut-off frequency second filter.
set_2 = Relative damping second filter.

s_var_filter_type = `lpass4q_0`

Fourth order low-pass filter. To avoid anti-aliasing error the cut-off frequency should not be larger than 1./(2.*timeout). The filter is built by two second order filters in serie.
The initial value of the filtered variable will be set equal to 0.(zero).

 s_var_filter= lpass4q_0  f_cut-off_1 set_1  f_cut-off_2 set_2
f_cut-off_1 = Cut-off frequency first filter.
set_1 = Relative damping first filter.
f_cut-off_2 = Cut-off frequency second filter.
set_2 = Relative damping second filter.

Reference Manuals   Calc menu    Input Data Menu

`cosim_server`= port_number

Make a co-simulation with another program using the TCP-protocol.
After program CALC have read all input data, program CALC stops and waits for another program to connect. The other program must connect to the same port as given in port_number above.
When a client is connected program CALC continues its execution, but makes a halt every tout and waits for further instructions from the client.

The port number is stored as a 16 bit unsigned integer, therefore the port number must be less than 65535. The lower numbers are reserved in Unix for standard services, therefore the port number must be greater than 2000.

Example of a client program written in C which can be used for controlling program calc in server mode.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h> 

void error(char *msg)
{
    perror(msg);
    exit(1);
}

int main(int argc, char *argv[])
{
    int sockfd, portno, n;
    struct sockaddr_in serv_addr;
    struct hostent *server;

    char buffer[256];
    if (argc < 3) {
       fprintf(stderr,"usage %s hostname port\n", argv[0]);
       exit(1);
    }
    portno = atoi(argv[2]);
    sockfd = socket(AF_INET, SOCK_STREAM, 0);
    if (sockfd < 0) error("ERROR opening socket");

    server = gethostbyname(argv[1]);
    if (server == NULL) {
        fprintf(stderr,"ERROR, no such host\n");
        exit(1);
    }

    bzero((char *) &serv_addr, sizeof(serv_addr));
    serv_addr.sin_family = AF_INET;
    bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
                  server->h_length);

    serv_addr.sin_port = htons(portno);
    n= connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
    if (n < 0) error("ERROR connecting");

    while (1) {
     printf("Enter message: ");
     bzero(buffer,256);
     fgets(buffer,255,stdin);
     n = write(sockfd, buffer, strlen(buffer)); 
     if (n < 0) error("ERROR writing to socket");
     if (strncmp(buffer,"run_stop",8)==0) break;

     bzero(buffer,256);
     n = read(sockfd,buffer,255); 
     if (n < 0) error("ERROR reading from socket");
     printf("Server Return Value= %s\n",buffer);
     if (strncmp(buffer,"7FFFFFFFFFFFFFFD",16)==0 ||
         strncmp(buffer,"7FFFFFFFFFFFFFFE",16)==0) {
         fprintf(stderr,"Severe error code received from server_tsim\n");
         exit(1);
     }
    }
    bzero(buffer,256);
    n = read(sockfd,buffer,255); 
    if (n < 0) error("ERROR reading from socket");
    printf("Server Return Value= %s\n",buffer);

    return 0;
}

Compile the source code above by writing "gcc -o client client.c"

With the program above you can manually send commands to program calc (the server).

Following commands are valid:

ask_iadr  <var_name>
Send this command in the beginning of the simulation in order to find the addresses of the variables you are interested in to read or overwrite. Store the addresses in an array for later use during the simulation. If the transmission was successful program calc will answer with 7FF0000000000001, which means that the command requires one argument. After sending the argument (the name of the variable), program calc replies with the address of the variable.

get_iadr  <var_address>
Send this command to retrieve a value from tsim. On a successful transmission program calc sends 7FF0000000000001, which means that the command requires one argument. After sending the argument (the address of the variable), program calc replies with the value of the variable.

put_iadr  <var_address>  <value>
Send this command to change/overwrite a variable. On a successful transmission program calc sends 7FF0000000000002, which means that the command requires two argument. After sending the first argument (the address of the variable), program calc replies with 7FF0000000000001, which means that the command requires one additional argument. After sending the second argument (the new value of the variable), program calc replies with 0, indicating that the new value was successfully inserted in the main memory.

defgroup  <group_name>  <no of addresses>  <var_addresses>
Send this command to create a group of variables.
To speed up the communication in the co-simulation it is possible to create groups of variables. First argument is the name of the group. Second argument are number of variables in the group. After that a list of addresses for all variables in the group.

getgroup  <group_name>
Send this command to obtain the values to all variables in a group.
First argument is the name of the group. Gensys replies with a 290 long character string containing all values in the group

putgroup  <group_name>  <values>
Send this command to set the values of all variables in a group.
First argument is the name of the group. The other arguments shall contain all values for all variables. The string is read in free format.

run_tout
Start the calculation. Stop and wait for more instruction after tout seconds. Program calc replies with the value of variable "time".

run_stop
Stop the simulation. Program calc replies with 0(zero). Both server and client terminates.


Return codes greater than 7FFFFFFFFFFFFFF6 indicates an error.

Severe error codes are 7FFFFFFFFFFFFFFD and 7FFFFFFFFFFFFFFE. If program CALC replies with one of these return codes no further processing is possible.


For more information please read "Co-simulation of a mechatronic system using Gensys and Simulink", (Spiryagin M., Simson S., Cole C., Persson I., Vehicle System Dynamics, Vol. 50(3), 2012, pp. 495-507 )


Reference Manuals   Calc menu    Input Data Menu

`cosim_server_udp`=   recv_port   send_port

Make a co-simulation with another program using the UDP-protocol.
After program CALC have read all input data, program CALC stops and waits for another program to connect. The other program must connect to the same port as given in the port numbers above.
When a client is connected program CALC continues its execution, but makes a halt every tout and waits for further instructions from the client.

The port number is stored as a 16 bit unsigned integer, therefore the port number must be less than 65535. The lower numbers are reserved in Unix for standard services, therefore the port number must be greater than 2000.

Example of a client program written for octave, which can be used for controlling program calc in server mode:


%
%  Load the sockets package
% --------------------------
pkg load sockets

%
%  Socket for sending data
% -------------------------
send_sck = socket(AF_INET, SOCK_DGRAM, 0);
SEND_PORT= 3200;
send_info= struct("addr", "127.0.0.1", "port", SEND_PORT);
connect(send_sck, send_info);

%
%  Socket for reception
% -------------------------
rcv_sck = socket(AF_INET, SOCK_DGRAM, 0);
RCV_PORT= 3201;
bind(rcv_sck,RCV_PORT);


%
%  Ask for the position in storage of variable "sin2"
% ---------------------------------------------------
send(send_sck,"ask_iadr"); [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);
send(send_sck,"sin2");     [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);

%
%  Ask for the value of variable stored in position "52"
% -------------------------------------------------------------
send(send_sck,"get_iadr"); [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);
send(send_sck,"52");       [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);

%
%  Change the value of the variable stored in position "52"
% -------------------------------------------------------------
send(send_sck,"put_iadr"); [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);
send(send_sck,"52");       [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);
send(send_sck,"1.");       [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);

%
%  Run until next tout
% -------------------------------------------------------------
send(send_sck,"run_tout"); [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);

%
%  Finish simulation
% -------------------------------------------------------------
send(send_sck,"run_stop"); [mesg_s, len_s]= recv(rcv_sck, 100); printf(" From server= %s\n", strvcat(mesg_s)); fflush(stdout);

Above example is very simple and not so useful. The code only sets the value of the variable located in position number 52. Then run "tout" seconds and stops simulation. To see a more useful and practical example. please look at ../tutorial/intro_tutor_1_sine


Reference Manuals   Calc menu    Input Data Menu

`tout` = 'timeout`

Specifies the output step size when writing to MPdat-file after time simulation analysis.
Command tout sets the value of variable timeout. In main memory, timeout is stored as an ordinary variable, which means that its value can be changed/overwritten by ordinary func-commands.
Default value for variable timeout is 0.010 [s].


Reference Manuals   Calc menu    Input Data Menu

`tsim`

Order the CALC-program to perform a time integration analysis.
Normally this command is given via the script modal when the modal analysis is initiated, but can also be given manually if desired.


Reference Manuals   Calc menu    Input Data Menu

`tsim_param`= `i_name`, input(*)

Defines the integrator to be used in time integration analysis.
Command `tsim_param` has the following subcommands:

e1 Euler forward.
mp2 The midpoint method.
runge_kutta The four step Runge-Kutta method.
heun The two step Runge-Kutta method.
heun_u The two step Runge-Kutta method, with step size control.
heun_c Similar to heun_u but makes backsteps if the tolerance not is meet.
heun_d Similar to heun_c but executes faster.
heun2impl Implicit Heun's method.
dopri5 Explicit Runge-Kutta according to DORMAND & PRINCE a multistep method.
radau5 Implicit Runge-Kutta method of order 5. Authors: E. Hairer and G. Wanner
odassl Implicit DAE-solver by Claus Fuhrer, based on DASSL written by Linda Petzold.

 tsim_param= e1

Selects an integrator which works according to Euler's explicit method. Euler's method is a one-step method with fixed step, giving an integration error of O(h). Additional input data is not available, as the time step is taken from the tstep-command.

Method Euler:
yn+1= yn + tstep*f(tn,yn)

Where:

yn+1 = The value of the integrated variable at time tn+1
yn = The value of the integrated variable at time tn
tstep = The timestep
f(tn,yn) = The value of the integrand at tn and yn

As can be seen above, only one calculation of the integrand is needed for each timestep.
The values of the integrands is defined by the user in different input data commands, for example: mass m_rigid_1 , mass m_rigid_6 , mass m_rigid_36b, mass m_flex_1 , mass massless2 , func integ , func hpass* , func lpass* , coupl kc , coupl kckc , coupl kfrkc and coupl k_air3 .

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= mp2

Selects an integrator which works according to the Midpoint Method, which is a one-step method with fixed step, giving an integration error of 0(h2). Additional input data is not available, as the time step is taken from the tstep-command.

Method Midpoint:
yn+1= yn-1 + 2*tstep*f(tn,yn)

Where:

yn+1 = The value of the integrated variable at time tn+1
yn-1 = The value of the integrated variable at time tn-1
tstep = The timestep
f(tn,yn) = The value of the integrand at tn and yn


As can be seen above, only one calculation of the integrand is needed for each timestep.
The values of the integrands is defined by the user in different input data commands, for example: mass m_rigid_1, mass m_rigid_6, mass m_rigid_36b, mass m_flex_1, mass massless2, func integ, func hpass*, func lpass*, coupl kc, coupl kckc, coupl kfrkc and coupl k_air3.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= runge_kutta

Selects an integrator which works according to the Runge-Kuttas Method, which is a four-step method with fixed step, giving an integration error of 0(h4). Additional input data is not available, as the time step is taken from the special tstep-command.

Method Runge-Kutta:
yn+1= yn + (k1+2k2+2k3+k4)/6

Where:

yn+1 = The value of the integrated variable at time tn+1
yn = The value of the integrated variable at time tn
k1 = tstep*f(tn,yn)
k2 = tstep*f(tn+tstep/2,yn+k1/2)
k3 = tstep*f(tn+tstep/2,yn+k2/2)
k4 = tstep*f(tn+tstep ,yn+k3 )
tstep = The timestep
f(tn,yn) = The value of the integrand at tn and yn
f(tn+tstep,yn+k3) = The value of the integrand at tn+tstep and yn+k3

As can be seen above, four calculations of the integrand is made for each timestep (one in the beginning, one in the end and two in the middle of each time interval).
The values of the integrands is defined by the user in different input data commands, for example: mass m_rigid_1, mass m_rigid_6, mass m_rigid_36b, mass m_flex_1, mass massless2, func integ, func hpass*, func lpass*, coupl kc, coupl kckc, coupl kfrkc and coupl k_air3.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= heun

Selects an integrator which works according to the Heun's method, which is a two-step method with fixed step, giving an integration error of 0(h2). Additional input data is not available, as the time step is taken from the special tstep-command.

Method Heun:
yn+1= yn + (k1+k2)/2

Where:

yn+1 = The value of the integrated variable at time tn+1
yn = The value of the integrated variable at time tn
k1 = tstep*f(tn,yn)
k2 = tstep*f(tn+tstep,yn+k1)
tstep = The timestep
f(tn,yn) = The value of the integrand at tn and yn
f(tn+tstep,yn+k1) = The value of the integrand at tn+tstep and yn+k1

As can be seen above, two calculations of the integrand is made for each timestep (in the beginning and in the end of each time interval).
The values of the integrands is defined by the user in different input data commands, for example: mass m_rigid_1, mass m_rigid_6, mass m_rigid_36b, mass m_flex_1, mass massless2, func integ, func hpass*, func lpass*, coupl kc, coupl kckc, coupl kfrkc and coupl k_air3.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= heun_u, regl, (+-`)max_tstep, (+-`)min_tstep

Selects an integrator which works according to a modified Heun's method. The integrator has variable steps, and the length of the step is calculated based on how fast the error increases or decreases between two consecutive time steps. The absolute error value is not calculated at every individual time step, but the sensitivity of the step selection can be controlled with the help of the regulation variable regl. Practical tests have shown that regl= 0.2-0.8 provides a suitable size for integration steps, regl= 0.3 can be given as a recommended value. The integration method heun_u has a variable called fstep which contains the average step length for calculation. There is no average step length calculated in the initial phase of the time integration, which is why the program uses the value of tstep read from the input data file. The user has the possibility, with the help of max_tstep and min_tstep, to control heun_u so that too large or too small time steps are not chosen. If max_tstep and min_tstep not are defined, the default values max_tstep = 1. and min_tstep = 1.e-7 will apply. The input data argument max_tstep is applicable in those cases where the excitation level is very low, e.g. on tangent track without any track irregularities. I these cases the regulator in heun_u have no motions from where it can regulate the size of the time step. When simulating a railway vehicle, max_tstep= 0.002 and min_tstep= 1e-7 should be a suitable choice.

Default values for regl, max_tstep and min_tstep are 0.3, 0.002 and 1e-7 respectively.

Method heun_u creates a variable with the name IntegratorDebug, which contains the number of the equation which controls the size of the time step.

For more details about the Heun's method please look at heun.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= heun_c, regl, (+-`)max_tstep, (+-`)min_tstep   

Similar to heun_u but makes backsteps if the tolerance not is meet. Default values for regl, max_tstep and min_tstep are 0.05, 0.0015 and 1e-9 respectively.

For more details about the Heun's method please look at heun_u.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= heun_d, regl, (+-`)max_tstep, (+-`)min_tstep   

Similar to heun_c but executes faster. Default values for regl, max_tstep and min_tstep are 0.05, 0.0015 and 1e-9 respectively.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= heun2impl, tol, nloop

Implicit Heun's method. The integrator can be used if the eigenvalues are high but the motions are slow. E.g. a rolling contact surface at low speeds.

Input data parameter tol sets the tolerance of the integrator.

Input data parameter nloop sets the number of iterations before heun2impl makes a back step.

Default values for tol and nloop are 1e-6 and 50 respectively.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= dopri5, tol

Multistep explicit runge-kutta according to DORMAND & PRINCE. The source code to DOPRI5 is described in the book "SOLVING ORDINARY DIFFERENTIAL EQUATIONS I. NONSTIFF PROBLEMS", 2ND EDITION. SPRINGER SERIES IN COMPUTATIONAL MATHEMATICS, SPRINGER-VERLAG (1993), written by E. HAIRER, S.P. NORSETT and G. WANNER. A typical value for the tolerance can be 1.e-10.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= radau5, tol

Numerical solution of a stiff (or differential algebraic) system of first 0rder ordinary differential equations M*Y'=F(X,Y).
The system can be (linearly) implicit (mass-matrix M.ne.I) or explicit (M=I). The method used is an implicit runge-kutta method (radau iia) of order 5 with step size control and continuous output. CF. Section IV.8

Authors: E. Hairer and G. Wanner
Universite de Geneve, dept. de mathematiques
CH-1211 GENEVE 24, SWITZERLAND

This code is part of the book:
E. Hairer and G. Wanner, Solving ordinary differential equations ii. stiff and differential-algebraic problems.
Springer series in computational mathematics 14, Springer-verlag 1991, second edition 1996.

A typical value for the tolerance can be 1.e-3.

Reference Manuals   Calc menu    Input Data Menu
 tsim_param= odassl, tol

Implicit DAE-solver by Claus Fuhrer at Numerical Analysis, Lund University, based on the DASSL routine written by Linda Petzold, MIT. A typical value for the tolerance can be 1.e-5.

Reference Manuals   Calc menu    Input Data Menu

`tstart`

Specifies the start time in time integration analysis.


Reference Manuals   Calc menu    Input Data Menu

`tstep` = 'timestep`

Specifies the size of the time step in time integration analysis.
Command tstep sets the value of variable timestep. In main memory, timestep is stored as an ordinary variable, which means that its value can be changed/overwritten by ordinary func-commands.
Default value for variable timestep is 0.001 [s].


Reference Manuals   Calc menu    Input Data Menu

`tstop`

Specifies the stop time in time integration analysis.
Tstop is also stored in the main memory as a variable, which makes it possible to redefine its value in a func-command. If tstop not is defined, the default value tstop= 0. will apply.


Reference Manuals   Calc menu    Input Data Menu

`update_mass_matrix`

Keyword that forces an update of the mass matrix in every time step.
In order to save computation time, the inverse of the mass matrix is only calculated in the beginning of the calculation as default. After this command has been given, the user has later the possibility to update a mass with command func update_mass.


Reference Manuals   Calc menu    Input Data Menu

`wlog_beg`

Specifies start of input data which is to be logged on file "calc.log".
All the input data commands which are given between the command wlog_beg and wlog_end will be printed out on the file.


Reference Manuals   Calc menu    Input Data Menu

`wlog_end`

Ends the writing into file "calc.log" beginning with command wlog_beg


Reference Manuals   Calc menu    Input Data Menu

`wlog_store`

Specifies whether the log file will be saved or not.

 wlog_store  value

Wlog_store can be given the value 0 or 1. If wlog_store is set at 0, no log file will be created. If wlog_store is set at 1, a log file named "calc.log" will be created. See also wlog_beg and wlog_end.

Declared Integer*4   Default= 1


Reference Manuals   Calc menu    Input Data Menu

`write_ca_file`

When command write_ca_file has been given in input data, the results are continuously written to the harddisk during the time simulation phase. This however makes the processing time longer, but it has the advantage that it is possible to restore the results if the time simulation terminates abnormally.

If command write_ca_file has been given and the simulation has terminated abnormally, the user has now the possibility to restore the results if the command conv_ca *.ca is given in the genfile- or xterm- window.


Reference Manuals   Calc menu    Input Data Menu

`write_id_file`

During time-domain simulations, split up the results in many id-files.
When making very long simulations it can be unpractical with very big id-files, therefore this command has been introduced. The write_id_file -command writes several id-files during a simulation. Between the ident-string and the extension ".id", command write_id_file adds an underscore plus a serial number, in order to give a uniq name to each id-file.

 write_id_file No_tout     
No_tout = The number of tout passings before writing results to the next id-file.

Reference Manuals   Calc menu    Input Data Menu

Examples.

This chapter presents a number of examples to illustrate how the program is used, and what it can be used for.

This chapter contains the following examples:

Example 1)
Create a simple sinus-variable
Example 2)
A one-dimensional mass coupled to ground via a spring
Example 3)
Model of a pendulum.
Example 4)
A mass with 6 degrees of freedom following a moving coordinate system

  Example 1)
  Create a simple sinus-variable.

  head 1 Generation of a sinusoidal function
  head 2 with the frequency $frequency Hz.
#
  tsim_param= e1                      # Select integrator e1
  tstart= 0.  tstop= 4                # Select start and stop times.
  tout= 0.04  tstep= 0.04             # Select printing and integration steps
#
  func const frequency= 2             # Define a variable named "frequency"
  func operp sinarg=                  # Calculate the variable sinarg
   2 * 3.14159 * frequency * time
  func sin   sin2 sinarg              # Calculate sinus for sinarg
#
  s_var sngl sin2                     # Order storage of variable sin2

  Example 2)
  A mass connected with a spring to the body named "point".
  The body point do not have any degree of freedoms,
  but will move sinusoidally by func-commands.
  head 1 A mass of 2(kg) connected to point with a spring of 50(N/m)
  head 2 Point is sinusoidally excited with a frequency of .5(Hz)
  head 3 The amplitude of the is increased from 0(mm) to 10(mm) in 3(s)
#
#
  tsim_param= heun_u 0.5       #Select integrator heun_u
  tstart= 0.  tstop= 16.       #Select start and stop times
  tout= 0.020 tstep= 0.001     #Select printing and initial integration step
#
#
# Create the esys and lsys coordinate systems.
#
# lsys   type      name           coordinates
  lsys   e_fix     esys          0. 0. 0.  0. 0. 0.
  lsys   l_local   lsys   esys   0. 0. 0.
#
#
# Remove the gravity of earth.
#
  accel  local_all  0. 0. 0.
#
#
# Create a mass and a point to fasten the mass in.
#
# mass   m_type      m_name   lsys   center of gravity  mass matrix' diagonal
  mass   m_rigid_6   mass     lsys      0.  0.  0.       2 2 2  2 2 2
  mass   fixpoint_6  point    lsys      0.  0.  0.
#
# # Create a spring between mass and point.
#
# coupl  c_type    c_name  coupl    attachm.point  stiffness  dire.of.action
  coupl  k         kyy     point    0.  0.  0.
                           mass     0.  0.  0.     50         esys  y       
#
#
# Create excitation variable 1(Hz) with amplitude, which will increase to 10(mm)
#
  func mul timepi time   6.28318531
  func mul sinarg timepi .5                       # Frequency .5(Hz)
  func sin sinus  sinarg
#
  func intpl_l  ampl  time 0 0  3 .010  50 .010   # Amplitude
#
#
# Assign body point the sinus shaped motion in y-direction.
#
  func mul  point.y  ampl sinus
#
#
# Store variables for postprocessing
#
  s_var sngl point.y
  s_var sngl massa.y

  Example 3)
  Model of a pendulum which is connected to a fixed point.
  head 1 A body of 2(kg), excited by acceleration due to gravity
  head 2 Coupled to point by a spring of 50e3[N/m] and the length 1[m]
  head 3 At start the mass is extended 1[m] in the x-direction
#
#
  tsim_param= e1             # Select integrator
  tstart= 0.  tstop= 3.      # Select start and stop.
  tout= 0.020 tstep= 0.001   # Select printing steps and integration start steps
#
#
# Create esys and lsys coordinate systems.
#
# lsys   type      name           coordinate
  lsys   e_fix     esys          0. 0. 0.  0. 0. 0.
  lsys   l_local   lsys   esys   0. 0. 0.
#
#
# Create a mass and a point to attach the mass to.
#
# mass   m_type       m_name   lsys   center of gravity  mass matrix' diagonal
  mass   m_rigid_6    mass     lsys   1.  0.  0.            2 2 2  2 2 2
  mass   fixpoint_6   point    lsys   0.  0.  0.
#
#
# Create spring and small damper between body and point.
#
  coupl  p_lin  stiff   0.   10e3
  coupl  p_lin  damper  0.   10
  coupl  k      kstiff  point 0 0 0  massa 1 0 0  stiff  esys cu
  coupl  c      cdamper point 0 0 0  massa 1 0 0  damper esys cu
#
#
# Store variables for postprocessing
#
  s_var sngl massa.x       # Motion of the mass
  s_var sngl massa.y
  s_var sngl massa.z
  s_var sngl massa.f
  s_var sngl massa.k
  s_var sngl massa.p
#
  s_var sngl kstiff.d      # Force and displacement in the direction of the spring
  s_var sngl kstiff.F
#
  s_var sngl kstiff.F2x    # Force from the spring acting on the mass.
  s_var sngl kstiff.F2z

  Example 4)
  Modeling of a body which follows a moving coordinate system.
  Define the moving coordinate system in "lsys e_abs_bend".
  head 1 A body of 2(kg), with a speed of 30(m/s), at a height of 1(m)
  head 2 Attached to point via springs 1200(N/m) and dampers 150(Ns/m)
  head 3 Enters a curve of 1000(m) radius and a cant of .06(rad)
#
#
  tsim_param= heun_u 0.5        # Select an integrator with variable step
  tstart= 0.  tstop= 2.         # Select start and stop times.
  tout= 0.020 tstep= 0.001      # Select storing step and initial integration step
#
  func  const    speed 30       # Create a variable containing the speed.
  func  mul dist speed time     # Create a variable containing the position.
#
#
# Create esys- and lsys- coordinate system, and vectors which control the curve.
#
  func  intpl_r   krok_R   0 0   5 0  10  .001  30  .001
  func  intpl_r   krok_fi  0 0   5 0  10  .060  30  .060
  func  intpl_r   krok_z   0 0   5 0  10 -.045  30 -.045
#
  lsys  e_abs_bend esys0  speed  0. krok_R krok_fi krok_z
  lsys  l_local    lsys0  esys0     0  0  0
#
#
# Create a mass and a point to attach the mass to.
#
# mass   m_type       m_name   lsys   center of gravity  mass matrix' diagonal
  mass   m_rigid_6    massa    lsys0  0.  0. -1.          2 2 2  2 2 2
  mass   fixpoint_6   point    lsys0  0.  0.  0.
#
#
# Create springs and dampers.
#
  coupl  p_lin  stiff    0.   1200
  coupl  k      stiff.x  point 0 0 0  massa 0 0 0  stiff esys0 x
  coupl  k      stiff.y  point 0 0 0  massa 0 0 0  stiff esys0 y
  coupl  k      stiff.z  point 0 0 0  massa 0 0 0  stiff esys0 z
  coupl  k      stiff.f  point 0 0 0  massa 0 0 0  stiff esys0 f
  coupl  k      stiff.k  point 0 0 0  massa 0 0 0  stiff esys0 k
  coupl  k      stiff.p  point 0 0 0  massa 0 0 0  stiff esys0 p
  coupl  p_lin  damper   0.     50
  coupl  c      damper.x  point 0 0 0  massa 0 0 0  damper esys0 x
  coupl  c      damper.y  point 0 0 0  massa 0 0 0  damper esys0 y
  coupl  c      damper.z  point 0 0 0  massa 0 0 0  damper esys0 z
  coupl  c      damper.f  point 0 0 0  massa 0 0 0  damper esys0 f
  coupl  c      damper.k  point 0 0 0  massa 0 0 0  damper esys0 k
  coupl  c      damper.p  point 0 0 0  massa 0 0 0  damper esys0 p
#
#
# Store variables for postprocessing
#
#
  s_var sngl esys0.x    s_var sngl lsys0.x   # Motions of lsys and esys
  s_var sngl esys0.y    s_var sngl lsys0.y
  s_var sngl esys0.z    s_var sngl lsys0.z
  s_var sngl esys0.f    s_var sngl lsys0.f
  s_var sngl esys0.k    s_var sngl lsys0.k
  s_var sngl esys0.p    s_var sngl lsys0.p
  s_var sngl esys0.vx   s_var sngl lsys0.vx
  s_var sngl esys0.vy   s_var sngl lsys0.vy
  s_var sngl esys0.vz   s_var sngl lsys0.vz
  s_var sngl esys0.vf   s_var sngl lsys0.vf
  s_var sngl esys0.vk   s_var sngl lsys0.vk
  s_var sngl esys0.vp   s_var sngl lsys0.vp
  s_var sngl esys0.ax   s_var sngl lsys0.ax
  s_var sngl esys0.ay   s_var sngl lsys0.ay
  s_var sngl esys0.az   s_var sngl lsys0.az
  s_var sngl esys0.af   s_var sngl lsys0.af
  s_var sngl esys0.ak   s_var sngl lsys0.ak
  s_var sngl esys0.ap   s_var sngl lsys0.ap
#
#
#            position            speed
  s_var sngl massa.x  s_var sngl massa.vx   # Motions and speed of the mass
  s_var sngl massa.y  s_var sngl massa.vy
  s_var sngl massa.z  s_var sngl massa.vz
  s_var sngl massa.f  s_var sngl massa.vx
  s_var sngl massa.k  s_var sngl massa.vy
  s_var sngl massa.p  s_var sngl massa.vz
#
#  Sum of external force's acting on the mass
  s_var sngl massa.Fx
  s_var sngl massa.Fy
  s_var sngl massa.Fz
  s_var sngl massa.Fx
  s_var sngl massa.Fy
  s_var sngl massa.Fz
#
#  Acceleration of inertia, due to accelerating coordinate systems
  s_var sngl massa.Ax
  s_var sngl massa.Ay
  s_var sngl massa.Az
  s_var sngl massa.Af
  s_var sngl massa.Ak
  s_var sngl massa.Ap

Reference Manuals   Calc menu    Input Data Menu

Export of results


The results from a calculation is stored in two binary files in directory id id/$ident.id and id/$ident.id2. File id/$ident.id2 contains all time-steps from all variables. File id/$ident.id is a smaller file only containing the names of all variables inclusive their addresses in the dircet access file id/$ident.id2.
Results from the id-files can be exported with the following programs:

cataf Writes all results into an ASCII-file.
catas Writes a minor dump into an ASCII-file.
read_id_file.m A matlab-script which reads id-files directly. Located in directory $gensys/source/download/octave/m/gensys

Reference Manuals   Calc menu    Input Data Menu