# Common commands used in the tsimf-file

#### lsys

Creates coordinate systems

Orientation of the coordinate axis:
 x = Along the track y = To the right, when looking in positive X-direction z = Downwards
When modeling a railway vehicle, the heights of the coordinate systems are always at ToR height. (ToR= Top Of Rail).
Rotations around the coordinate axis:
 Direction Greekletter Gensysabbrv. X-rot = φ = "f" Y-rot = χ = "k" Z-rot = ψ = "p"
The right hand rule gives the directions of positive rotations.
Example:
```lsys e_abs_bendrf esys_1  Vo  `Xtrac_start - (10+buff.A_1)`                # Create an Euler system
ro_trac_design f_trac_design z_trac_design  # The recommendation is to create
4 4            4 4           4 4            # one Euler system per vehicle

lsys l_local lsc_1   esys_1  0.         0. 0.    # Create a linear system for the car-body

lsys l_local lsb_11  esys_1  acb_       0. 0.    # Create a linear system for the leading bogie
lsys l_local lsa_111 esys_1  acb_+aba_  0. 0.    # Create a linear system for the first wheelset in leading bogie
lsys l_local lsa_112 esys_1  acb_-aba_  0. 0.    # Create a linear system for the second wheelset in leading bogie

lsys l_local lsb_12  esys_1 -acb_       0. 0.    # Create a linear system for the trailing bogie
lsys l_local lsa_121 esys_1 -acb_+aba_  0. 0.    # Create a linear system for the first wheelset in trailing bogie
lsys l_local lsa_122 esys_1 -acb_-aba_  0. 0.    # Create a linear system for the second wheelset in trailing bogie
```
Where:
 acb_ = Longitudinal distance from mid-point of car-body to mid-point of bogie aba_ = Longitudinal distance from mid-point of bogie to wheelset
Side view:
Top view:

#### mass

Creates masses
Example:

```
mass m_rigid_6  car_1   lsc_1   0 0 -hccg_  mc_ mc_ mc_  Jfc_ Jkc_ Jpc_    # Create a car-body
mass m_rigid_6  bog_11  lsb_11  0 0 -hbcg_  mb_ mb_ mb_  Jfb_ Jkb_ Jpb_    # Create a bogie frame
mass m_rigid_6  axl_111 lsa_111 0 0 -ro_    ma_ ma_ ma_  Jfa_ Jka_ Jpa_    # Create a wheelset
mass m_rigid_6f trc_111 lsa_111 0 0  0.     0.  mt_ mt_  Jft_  0.  0.      # Create a track-piece
. . .
mass m_rigid_36b  car_1   lsc_1   a b -h   mxx  mxy  mxz  mxf  mxk  mxp    # Defines a mass having
myx  myy  myz  myf  myk  myp    # products of inertia
mzx  mzy  mzz  mzf  mzk  mzp
mfx  mfy  mfz  mff  mfk  mfp
mkx  mky  mkz  mkf  mkk  mkp
mpx  mpy  mpz  mpf  mpk  mpp
. . .
mass m_flex_1  car_1  fq1 damp1  fq2 damp2  fq3 ,,,                        # Adding flexible modes to a rigid mass
. . .

```

#### coupl

Connecting the masses to each other.
Example:

```
coupl p_lin36 kmbl_=
0.   0.   0.   0.   0.   0.
12e6  0.   0.   0.   0.   0.   # Bushing property
0.   8e6  0.   0.   0.   0.   # A 6x6 dimensional linear coupling matrix
0.   0.  12e6  0.   0.   0.
0.   0.   0. 10e3   0.   0.
0.   0.   0.   0.  10e3  0.
0.   0.   0.   0.   0.  10e3
coupl k  kmbl   bog_11   aba_-.3 -1. -.4      # Bushing. The coupling
lnk_11l      -.3 -1. -.4
kmbl_                         # Property
esys_1  m                     # Coordinate system and direction of action

coupl k  ktr    car_1  7.5 0. -0.4            # Traction rod
bog_11 -.2 0. -0.3            # Body #2 and its attachment coordinate
25e6                          # Property
esys_1  c                     # Coordinate system and direction of action

coupl kc  czcb  car_1 `acb_+0.34`  1.25 -1.0  # Vertical damper
bog_11      0.34   1.25 -0.5  # Body #2 and its attachment coordinate
`2*pi*20.*40e3`   40e3         # Properties. Cut-off frequency at 20[Hz]
esys_1  z                     # Coordinate system and direction of action

coupl p_nlin_s  kycbs_=                       # Lateral bumpstop property
0.                            # Pre-stress force
0.030   0.                    # Break-point #1 [m],[N]
0.040  15e3                   # Break-point #2 [m],[N]
0.090   2e6                   # Break-point #3 [m],[N]
coupl k  kycbs  car_1  acb_  0. -1.0          # Lateral bumpstop. The coupling
bog_11 0.    0. -1.0          # Body #2 and its attachment coordinate
kycbs_                        # Property
esys_1  y                     # Coordinate system and direction of action

coupl k_coil3   kzcb                          # Compressed coil spring between car-body and bogie
car_1    acb_    1.  -1.      # Body #1 and its attachment coordinate
bog_11   0.      1.  -0.8     # Body #2 and its attachment coordinate
600e3 600e3 900e3  0. 0. 0.   # Stiffnesses in all 6 directions
hfree hcomp rf                # Height of spring
esys_1   m                    # Coordinate system and direction of action

```

Deformation in a coupling with zero-length

The deformation of the coupling is defined as:
```c_name.d= mass2.x - mass1.x
```
The force in the coupling is defined as:
```c_name.F= Stiffness * c_name.d
```
The forces acting on the two masses are defined as:
```c_name.F1x=  c_name.F
c_name.F2x= -c_name.F
```
Sum up the the total force acting on the masses:
```mass1.Fx= mass1.Fx + c_name.F1x
mass2.Fx= mass2.Fx + c_name.F2x
```
Both ends of a coupling with a direction of action equal to "x", "y", "z", "f", "k", "p", "m" must coinside. If not, a force will be generated.

Couplings with length
Must have a direction of action equal to "cx", "cy", "cz", "c" or "cu".
Direction "cx" means that the coupling is acting in longitudinal direction, but the initial longitudinal distance between its two ends are removed from the force calculation:

```c_name.F= Stiffness * ( c_name.d - c_name.l )
```
Direction "cy" and "cz" works in the same way as "cx", but they work in lateral and vertical direction.

Couplings with a direction of action equal to c or cu gives forces along the coupling. In these couplings a positive value in variable c_name.d means an elongation of the coupling. Also in these types of couplings the original length of the coupling is removed, when calculating the force in the coupling.

#### constr

Apply constraints on masses.
Example:

```
constr fix_free_1  axl_111.k= 0.     # Elliminate the pitch rotation in the wheelset

constr conn_free_1  abox_111l.x = 1. axl_111.x  +1.025 axl_111.p    # Force the axlebox to
constr conn_free_1  abox_111l.y = 1. axl_111.y                      # follow the wheelset
constr conn_free_1  abox_111l.z = 1. axl_111.z  -1.025 axl_111.f    # in all directions
constr conn_free_1  abox_111l.f = 1. axl_111.f                      # except pitch
constr conn_free_1  abox_111l.p = 1. axl_111.p
constr conn_free_1  abox_111l.vx= 1. axl_111.vx +1.025 axl_111.vp   # Also apply constraints
constr conn_free_1  abox_111l.vy= 1. axl_111.vy                     # on the velocity
constr conn_free_1  abox_111l.vz= 1. axl_111.vz -1.025 axl_111.vf   # equations
constr conn_free_1  abox_111l.vf= 1. axl_111.vf
constr conn_free_1  abox_111l.vp= 1. axl_111.vp

```

#### func

Low level commands.
Example:

```
func const  bo_ = 0.75                      # Define a constant

func operp vkmh= 400 - vkmh_deacc * time    # Evaluate formulas

func char  ctrack_irreg=  "Ideal_track"     # Define a character variable

```

#### if_then ‐ endif

Create a conditional if_then-statement.
Example:

```if_then lsa_111.pn .gt. Xtrac_stop
func print06_char_all " "
func print06_char_all " Execution interrupted due to lsa_111.pn > Xtrac_stop"
func print06_char_all " ----------------------------------------------------"
func stop
endif
```

#### if_then_init

Create a conditional if_then_init-statement.
Example:

```if_then_init .exist. cp3_111r.Fx
s_var gpdat_force1  cp3_111r.Fx
s_var gpdat_force1  cp3_111r.Fy
s_var gpdat_force1  cp3_111r.Fz
endif
```

#### if_then_char_init

Create a conditional if_then_init_char-statement.
Example:

```if_then_char_init  CalcType .eq. TSIM
pre_process=  'quasi \$CURRENT_FILE'
post_process= 'mplot mplotf/Tsim_All_BoBo.mplotf \$IDENT'
endif
```

#### insert

Include the contents from an other file
Example:

```insert file  \$genkpf/ENS1002t32.5_uic60i40.kpfr
```

#### substruct

Group of commands that are frequently used on each car-body, bogie or wheelset can put in a substruct to made the tsimf-file smaller.
Example:

```substruct interrupt_criterions [        # \$1 Wheelset number

func operp whe_\$1l.z= axl_\$1.z - bo_ * axl_\$1.f                     # Vert position of left and
func operp whe_\$1r.z= axl_\$1.z + bo_ * axl_\$1.f                     # right wheel

func operp wr_\$1l.gap= ral_\$1l.z + tral\$1l.z + 0.028 - whe_\$1l.z    # Vert difference between wheel and rail
func operp wr_\$1r.gap= ral_\$1r.z + tral\$1r.z + 0.028 - whe_\$1r.z    # (flange height= 28mm)

s_var sngl wr_\$1l.gap  s_var sngl wr_\$1r.gap                        # Save the variable on id-file

if_then wr_\$1l.gap .gt. 0.10
func print06_char_all " "
func print06_char_all " Execution interrupted due to wr_\$1l.gap > 0.10"
func print06_char_all " ----------------------------------------------"
func stop
endif

if_then wr_\$1r.gap .gt. 0.10
func print06_char_all " "
func print06_char_all " Execution interrupted due to wr_\$1r.gap > 0.10"
func print06_char_all " ----------------------------------------------"
func stop
endif
]
in_substruct interrupt_criterions [ 111 ]    # \$1 Wheelset number
in_substruct interrupt_criterions [ 112 ]
in_substruct interrupt_criterions [ 121 ]
... etc.
```

# Example of a rail road vehicle input data model

• Analysis specific input data
• Pre- & Post- Processing
• Designed Track Gauge
• Track irregularities
• Modify the track gauge
• Designed track geometry
• Wheel-rail contact model
• Wheel-rail geometry functions
• Wheel/Rail Friction Coefficients
• Substructs to build wheelsets and track pieces
• Wear- and RCF-indexes
• Noise and Corrugation
• Secant conicity
• Length to buffers
• Speed
• Euler coordinate systems
• Vehicle properties