

  head 2 "Test of different wheel/rail couplings  coupl creep_contact_1"
  head 3 "axl_111 pure long.creep; axl_112 pure lat.creep; axl_113 pure spin"
  head 4 "Cylindric wheel profile  mu= $mu_"

##
## Analyse specific input data
##
  idebug= 1                                     # Dump memory to file
  idebug_file= out/quasi_contact_1.out          # File where memory dump will be written

  fresp_param= Fourier_CG1  1.e-4  fstart .2   fstop 20.  fstep -1.05
  modal_param= Schur_fact1  1.e-4
  quasi_param= Damped_Tens  1.e-4 0.1   20    20.
# tsim_param = heun              tstart= 0.  tstop= 500   tstep= 1.00    tout= 1.00
# tsim_param = heun_u .5         tstart= 0.  tstop= 2.50  tstep= 0.001   tout= .005
# tsim_param = heun              tstart= 0.  tstop= 2.50  tstep= 0.005   tout= .005
# tsim_param = heun              tstart= 0.  tstop= 3.00  tstep= 2e-5    tout= .005
# tsim_param = heun_c .01 .2e-3  tstart= 0.  tstop= 3.00  tstep= 0.0001  tout= .005
  tsim_param = heun_u            tstart= 0.  tstop= 1.00  tstep= 2e-5    tout= .005

##
##  Track irregularities and designed track geometry
##
  func intpl_r   lat_trac      -200    0.   100    0.
  func intpl_r   spv_trac      -200 1435.   100 1435.
  func intpl_r   vert_trac     -200    0.   100    0.
  func intpl_r   fi_trac       -200    0.   100    0.

  func intpl_r   krok_R  -200 0   100 0
  func intpl_r   krok_h  -200 0   100 0
  func intpl_r   krok_z  -200 0   100 0

##
##  Define constants for the wheel-rail-coupling substructure wr_coupl
##
  func const_block
   Vo     = 10.     # Speed of the vehicles
   mu_    = 0.5     # Friction coefficient, all wheels in the train
   ro_    = 0.45    # Wheel radius, all wheels in the train
   bo_    = 0.75    # Semi distance between the wheel profile origins, all wheels in the train
   ma_    =   1887  # Mass of wheelset
   ma_114 = 5*1887  # Mass of wheelset 114
   Jka_   =    100  # Moment of inertia in pitch, wheelset
   Jka_114=  5*100  # Moment of inertia in pitch, wheelset 114

   YMtrac= 1e-3         # From mm to m;   Scale factor 1.00; Lateral irregularities
   ZMtrac= 1e-3         # From mm to m;   Scale factor 1.00; Vertical irregularities
   GMtrac= 1e-3         # From mm to m;   Scale factor 1.00; Gauge irregularities
   CMtrac= 1e-3/(2*bo_) # From mm to rad; Scale factor 1.00; Cant irregularities

   gauge_average= 1435.    # Average gauge of the track
   gauge_dev_   = 0.000    # Deviation in gauge
  end_block


##
##  Create the wheelsets.
##  ---------------------
  lsys   e_abs_bendrf  esys  Vo  0.  krok_R krok_h krok_z
                                     4 4    4 4    4 4
  substruct create_axles [      # $1= axle number                                       
   lsys  l_local      lsa_$1  esys      0. 0. 0.                                        
   mass  m_rigid_6    axl_$1  lsa_$1    0. 0. -ro_$1  ma_$1 ma_$1 ma_$1  720 Jka_$1 720 
   mass  m_rigid_6    trc_$1  lsa_$1    0. 0. 0.      1.e3 1.e3 1.e3  1.e3 1.e3 1.e3    
   mass  fixpoint_6   grd_$1  lsa_$1    0. 0. 0.                                        
#  body  w_set_lsys   axl_$1  lsa_$1    ro_$1 bo_                                       
   body  whe_set_mass axl_$1            ro_$1 bo_                                       
   body  figure_lsys  trc_$1  lsa_$1    1 5        .5  1 0   .5 -1 0                    
                                                  -.5 -1 0  -.5  1 0  .5 1 0            
#
   constr fix_rigid_1  axl_$1  x   0.                                                   
   constr fix_rigid_1  axl_$1  y   0.                                                   
   constr fix_rigid_1  axl_$1  f   0.                                                   
   constr fix_rigid_1  axl_$1  p   0.                                                   
#                                                                                       
   constr fix_rigid_1  trc_$1  x   0.   constr fix_rigid_1  trc_$1  f   0.              
   constr fix_rigid_1  trc_$1  y   0.   constr fix_rigid_1  trc_$1  k   0.              
   constr fix_rigid_1  trc_$1  z   0.   constr fix_rigid_1  trc_$1  p   0.              
#                                                                                       
   force rel_mass1 vload_$1  axl_$1  0. 0. -ro_$1  0. 0. 200e3-ma_$1*9.81  0. 0. 0.     
#                                                                                       
#  coupl c czag$1l  axl_$1 0. -bo_ -ro_$1  grd_$1 0. -bo_ -ro_$1  .7*300e6/pi/40 esys z 
#  coupl c czag$1r  axl_$1 0.  bo_ -ro_$1  grd_$1 0.  bo_ -ro_$1  .7*300e6/pi/40 esys z 
#                                                                                       
   coupl c czag$1l  axl_$1 0. -bo_ -ro_$1  grd_$1 0. -bo_ -ro_$1  .7*60e6/pi/40 esys z 
   coupl c czag$1r  axl_$1 0.  bo_ -ro_$1  grd_$1 0.  bo_ -ro_$1  .7*60e6/pi/40 esys z 
  ]
#
  in_substruct create_axles [ 111 ]
  in_substruct create_axles [ 112 ]
  in_substruct create_axles [ 113 ]
  in_substruct create_axles [ 114 ]
#
  s_var force_on axl_114 z
  mass  fixpoint_6   car_1    lsa_111   0. 0. 0.

##
##  Define pure creepage on the three different axles
##  -------------------------------------------------
  constr fix_free_1     axl_111.k =  0.
  func   const          nom_pitch = -Vo/ro_
  constr fix_free_1     axl_111.vk= nom_pitch

  constr fix_free_1     axl_112.k =  0.
  initval set_var       axl_112.vk= nom_pitch

  constr fix_free_1     axl_113.k =   0.
  constr fix_free_1     axl_113.vk= nom_pitch

  constr fix_free_1     axl_114.k =   0.
  func const            axl_114.vk=  nom_pitch

##
##      Creepage and creep-forces
##      -----------------------------------

#
#       Wheel & rail profiles
#       ----------------------------
# ry_rail= 0.45;                        # Wheel radius, all wheels in the train
# x= [-.090:.002:0.090];                # Octave code for creating the rail profile
# y= ry_rail - sqrt(ry_rail^2 - x.^2);
# for i= 1 length(x)
#  printf("  %20.13e %20.13e\n", x(i), y(i))
# endfor
#
   func intpl_r   rail_prof=    
  -9.00000000000000e-02   9.09184629902793e-03
  -8.80000000000000e-02   8.68831875872578e-03
  -8.60000000000000e-02   8.29421556877930e-03
  -8.40000000000000e-02   7.90951152507252e-03
  -8.20000000000000e-02   7.53418211120532e-03
  -8.00000000000000e-02   7.16820349030939e-03
  -7.80000000000000e-02   6.81155249713472e-03
  -7.60000000000000e-02   6.46420663040059e-03
  -7.40000000000000e-02   6.12614404540562e-03
  -7.20000000000000e-02   5.79734354688960e-03
  -7.00000000000000e-02   5.47778458214260e-03
  -6.80000000000000e-02   5.16744723435536e-03
  -6.60000000000000e-02   4.86631221620620e-03
  -6.40000000000000e-02   4.57436086367907e-03
  -6.20000000000000e-02   4.29157513010814e-03
  -6.00000000000000e-02   4.01793758044483e-03
  -5.80000000000000e-02   3.75343138574163e-03
  -5.60000000000000e-02   3.49804031785034e-03
  -5.40000000000000e-02   3.25174874432915e-03
  -5.20000000000000e-02   3.01454162355574e-03
  -5.00000000000000e-02   2.78640450004208e-03
  -4.80000000000000e-02   2.56732349994820e-03
  -4.60000000000000e-02   2.35728532679103e-03
  -4.40000000000000e-02   2.15627725734502e-03
  -4.20000000000000e-02   1.96428713773272e-03
  -4.00000000000000e-02   1.78130337970056e-03
  -3.80000000000000e-02   1.60731495707916e-03
  -3.60000000000000e-02   1.44231140242396e-03
  -3.40000000000000e-02   1.28628280383492e-03
  -3.20000000000000e-02   1.13921980195242e-03
  -3.00000000000000e-02   1.00111358712707e-03
  -2.80000000000000e-02   8.71955896762089e-04
  -2.60000000000000e-02   7.51739012825992e-04
  -2.40000000000000e-02   6.40455759533254e-04
  -2.20000000000000e-02   5.38099501192435e-04
  -2.00000000000000e-02   4.44664140219542e-04
  -1.80000000000000e-02   3.60144115315320e-04
  -1.60000000000000e-02   2.84534399805192e-04
  -1.40000000000000e-02   2.17830500140903e-04
  -1.20000000000000e-02   1.60028454562533e-04
  -1.00000000000000e-02   1.11124831920273e-04
  -7.99999999999999e-03   7.11167306548521e-05
  -5.99999999999999e-03   4.00017779358386e-05
  -3.99999999999999e-03   1.77781289575907e-05
  -2.00000000000000e-03   4.44446639252805e-06
   0.00000000000000e+00   0.00000000000000e+00
   2.00000000000000e-03   4.44446639252805e-06
   4.00000000000000e-03   1.77781289575907e-05
   6.00000000000001e-03   4.00017779358386e-05
   8.00000000000001e-03   7.11167306548521e-05
   1.00000000000000e-02   1.11124831920273e-04
   1.20000000000000e-02   1.60028454562533e-04
   1.40000000000000e-02   2.17830500140903e-04
   1.60000000000000e-02   2.84534399805192e-04
   1.80000000000000e-02   3.60144115315320e-04
   2.00000000000000e-02   4.44664140219542e-04
   2.20000000000000e-02   5.38099501192435e-04
   2.40000000000000e-02   6.40455759533254e-04
   2.60000000000000e-02   7.51739012825992e-04
   2.80000000000000e-02   8.71955896762089e-04
   3.00000000000000e-02   1.00111358712707e-03
   3.20000000000000e-02   1.13921980195242e-03
   3.40000000000000e-02   1.28628280383492e-03
   3.60000000000000e-02   1.44231140242396e-03
   3.80000000000000e-02   1.60731495707916e-03
   4.00000000000000e-02   1.78130337970056e-03
   4.20000000000000e-02   1.96428713773272e-03
   4.40000000000000e-02   2.15627725734502e-03
   4.60000000000000e-02   2.35728532679103e-03
   4.80000000000000e-02   2.56732349994820e-03
   5.00000000000000e-02   2.78640450004208e-03
   5.20000000000000e-02   3.01454162355574e-03
   5.40000000000000e-02   3.25174874432915e-03
   5.60000000000000e-02   3.49804031785034e-03
   5.80000000000000e-02   3.75343138574163e-03
   6.00000000000000e-02   4.01793758044483e-03
   6.20000000000000e-02   4.29157513010814e-03
   6.40000000000000e-02   4.57436086367907e-03
   6.60000000000000e-02   4.86631221620620e-03
   6.80000000000000e-02   5.16744723435536e-03
   7.00000000000000e-02   5.47778458214260e-03
   7.20000000000000e-02   5.79734354688960e-03
   7.40000000000000e-02   6.12614404540562e-03
   7.60000000000000e-02   6.46420663040059e-03
   7.80000000000000e-02   6.81155249713472e-03
   8.00000000000000e-02   7.16820349030944e-03
   8.20000000000000e-02   7.53418211120532e-03
   8.40000000000000e-02   7.90951152507252e-03
   8.60000000000000e-02   8.29421556877930e-03
   8.80000000000000e-02   8.68831875872578e-03
   9.00000000000000e-02   9.09184629902793e-03

  func intpl2_r  rail_prof_memfield=   0.   rail_prof
                                     200.   rail_prof


  func intpl_r   wheel_prof_right_    =  -1.00  0.0
                                          1.00  0.0

  func intpl_r   wheel_prof_right_114 =  -1.00  -.1
                                          1.00  0.1

  func intpl_r   wheel_prof_left_     =  -1.00  0.0
                                          1.00  0.0

  func intpl_r   wheel_prof_left_114  =  -1.00  -.1
                                          1.00  0.1

  func const_block
   tral.yl_    =  0.   # Lateral position track irregularity
   tral.zl_    =  0.   # Vertical position track irregularity
   tral.vyl_   =  0.   # Lateral velocity track irregularity
   tral.vzl_   =  0.   # Vertical velocity track irregularity

   tral.yr_    =  0.
   tral.zr_    =  0.
   tral.vyr_   =  0.
   tral.vzr_   =  0.

   tral.yl_114 = -4.47766735594495e-02   # Move the rail laterally, to make the contact point to happen on the nominal running circle
   tral.zl_114 = -2.23326440550488e-03   # Move the rail vertical, to give the wheelset a height of 0(zero)
   tral.vyl_114=  0.                     # The rail has a constant lateral curvature
   tral.vzl_114=  0.                     # The wheel has a cone angle of 0.1

   tral.yr_114 =  4.47766735594495e-02
   tral.zr_114 = -2.23326440550488e-03
   tral.vyr_114=  0.
   tral.vzr_114=  0.
  end_block

  func intpl_l  laythk= time            # Vary the thickness of the interfacial layer
                        0.    1e-6      # during the simulation
                       10.48  1e-6
                       10.50  1e-5
                       11.    1e-5


  substruct wr_coupl [    # $1=axle #                                                                   
#                                                                                                       
   mass m_rigid_6f  ral_$1l lsa_$1    0. -bo_ 0.   0. 300  300    0. 0. 0.                              
   mass m_rigid_6f  ral_$1r lsa_$1    0.  bo_ 0.   0. 300  300    0. 0. 0.                              
#                                                                                                       
   force rel_mass1 Fralz_$1l ral_$1l  0. -bo_ 0.   0. 0. -(300-60)*9.81  0. 0. 0.                       
   force rel_mass1 Fralz_$1r ral_$1r  0.  bo_ 0.   0. 0. -(300-60)*9.81  0. 0. 0.                       
#                                                                                                       
   func  operp whe_$1l.x= axl_$1.x + bo_ * axl_$1.p                                                     
   func  operp whe_$1r.x= axl_$1.x - bo_ * axl_$1.p                                                     
#                                                                                                       
   func  operp whe_$1l.vx= axl_$1.vx + bo_ * axl_$1.vp                                                  
   func  operp whe_$1r.vx= axl_$1.vx - bo_ * axl_$1.vp                                                  
#
#
#
#  func tral_interp_spline $1           # Interpolate track irregularities tral*                        
#                                                                                                       
   coupl creep_contact_1        cp_$1r                                                                  
                axl_$1  0.         bo_  0.                                                              
                ral_$1r whe_$1r.x  bo_  0.   esys m                                                     
                tral.yr_$1                 # tral$1r.y   # Lateral position track irregularity          
                tral.zr_$1                 # tral$1r.z   # Vertical position track irregularity         
                tral.vyr_$1                # tral$1r.vy  # Lateral velocity track irregularity          
                tral.vzr_$1                # tral$1r.vz  # Vertical velocity track irregularity         
                ro_$1r                     # Wheel rolling radius, will vary for OOR-wheels             
                -1                         # Orientation                                                
                1                          # Circular shape in long direction                           
                1.    # mulfact_nux_$1r    # Longitudinal creep relaxation due to contaminated surfaces 
                1.    # mulfact_nuy_$1r    # Lateral      creep relaxation due to contaminated surfaces 
                1.    # mulfact_spin_$1r   # Spin         creep relaxation due to contaminated surfaces 
#                                                                                                       
                wheel_prof_right_$1r       # Wheel profile                                              
                .001 .001                  # Distance between brushes in mesh long&lat direction        
                rail_prof_memfield         # Rail profile                                               
#                                                                                                       
                 82000.e6                  # Shear Modulus body 1                                       
                 0.28                      # Poisson's ratio body 1                                     
                 82000.e6                  # Shear Modulus body 2                                       
                 0.28                      # Poisson's ratio body 2                                     
#                                                                                                       
                 0.                        # Vertical curvature rail head                               
#
#                                            Wheel/rail-friction                                        
                 0                         # Coulomb friction                                           
                 .5, .5                    #  cp1 params= [fstat,fkin]                                  
                 .5, .5                    #  cp2 params= [fstat,fkin]                                  
                 .5, .5                    #  cp3 params= [fstat,fkin]                                  
                 .5, .5                    #  cp4 params= [fstat,fkin]                                  
                 .5, .5                    #  cp5 params= [fstat,fkin]                                  
                 .5, .5                    #  cp6 params= [fstat,fkin]                                  
                 .5, .5                    #  cp7 params= [fstat,fkin]                                  
                 .5, .5                    #  cp8 params= [fstat,fkin]                                  
                 .5, .5                    #  cp9 params= [fstat,fkin]                                  
#                                                                                                       
#               5                          # Exponential falling friction acc.to Polach                 
#               .3, .6, log(2)/1.25        #  cp1 params= [fstat,polach_a,polach_b]                     
#               .3, .6, log(2)/1.25        #  cp2                                                       
#               .3, .6, log(2)/1.25        #  cp3,,, etc.                                               
#
#                                            Interfacial layer                                          
                 0                         # No layer                                                   
#                4                         # Elasto-plastic intfc.layer                                 
#                100e6 laythk 950e6 75e6     #  cp1 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp2 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp3 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp4 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp5 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp6 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp7 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp8 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp9 params= [G3,laythk,taucrt,ggplst]                     
#
   coupl creep_contact_1        cp_$1l                                                                  
                axl_$1  0.        -bo_  0.                                                              
                ral_$1l whe_$1l.x -bo_  0.   esys m                                                     
                  tral.yl_$1    # tral$1l.y        # Lateral position track irregularity                
                  tral.zl_$1    # tral$1l.z        # Vertical position track irregularity               
                  tral.vyl_$1   # tral$1l.vy       # Lateral velocity track irregularity                
                  tral.vzl_$1   # tral$1l.vz       # Vertical velocity track irregularity               
                  ro_$1l                   # Wheel rolling radius, will vary for OOR-wheels             
                   1                       # Orientation                                                
                  1                        # Circular shape in long direction                           
                  1.    # mulfact_nux_$1l  # Longitudinal creep relaxation due to contaminated surfaces 
                  1.    # mulfact_nuy_$1l  # Lateral      creep relaxation due to contaminated surfaces 
                  1.    # mulfact_spin_$1l # Spin         creep relaxation due to contaminated surfaces 
#                                                                                                       
                wheel_prof_left_$1l        # Wheel profile                                              
                .001 .001                  # Distance between brushes in mesh long&lat direction        
                rail_prof_memfield         # Rail profile                                               
#                                                                                                       
                 82000.e6                  # Shear Modulus body 1                                       
                 0.28                      # Poisson's ratio body 1                                     
                 82000.e6                  # Shear Modulus body 2                                       
                 0.28                      # Poisson's ratio body 2                                     
#                                                                                                       
                 0.                        # Vertical curvature rail head                               
#
#                                            Wheel/rail-friction                                        
                 0                         # Coulomb friction                                           
                 .5, .5                    #  cp1 params= [fstat,fkin]                                  
                 .5, .5                    #  cp2 params= [fstat,fkin]                                  
                 .5, .5                    #  cp3 params= [fstat,fkin]                                  
                 .5, .5                    #  cp4 params= [fstat,fkin]                                  
                 .5, .5                    #  cp5 params= [fstat,fkin]                                  
                 .5, .5                    #  cp6 params= [fstat,fkin]                                  
                 .5, .5                    #  cp7 params= [fstat,fkin]                                  
                 .5, .5                    #  cp8 params= [fstat,fkin]                                  
                 .5, .5                    #  cp9 params= [fstat,fkin]                                  
#                                                                                                       
#               5                          # Exponential falling friction acc.to Polach                 
#               .3, .6, log(2)/1.25        #  cp1 params= [fstat,polach_a,polach_b]                     
#               .3, .6, log(2)/1.25        #  cp2                                                       
#               .3, .6, log(2)/1.25        #  cp3,,, etc.                                               
#
#                                            Interfacial layer                                          
                 0                         # No layer                                                   
#                4                         # Elasto-plastic intfc.layer                                 
#                100e6 laythk 950e6 75e6     #  cp1 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp2 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp3 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp4 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp5 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp6 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp7 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp8 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp9 params= [G3,laythk,taucrt,ggplst]                     
 ]
  in_substruct wr_coupl [ 111 ]
  in_substruct wr_coupl [ 112 ]
# in_substruct wr_coupl [ 113 ]
  in_substruct wr_coupl [ 114 ]








#                                                                                       
   force rel_mass1 vload_113b axl_113  0. 0. -ro_113  0. 0. -100e3  0. 0. 0.     
#
   mass m_rigid_6f  ral_113r lsa_113  0.  bo_  0.    0. 60 60  0. 0. 0.                           
   mass m_rigid_6f  ral_113l lsa_113  0. -bo_  0.    0. 60 60  0. 0. 0.                           
#
   func  operp whe_113r.x= axl_113.x - bo_ * axl_113.p
   func  operp whe_113l.x= axl_113.x + bo_ * axl_113.p
#
   func  operp whe_113r.vx= axl_113.vx - bo_ * axl_113.vp
   func  operp whe_113l.vx= axl_113.vx + bo_ * axl_113.vp
#
#
#
#
   func tral_interp_spline 113    # Interpolate track irregularities
#
   coupl creep_contact_1        cp_113r
                axl_113  0.         bo_  0.
                ral_113r whe_113r.x  bo_  0.   esys m
                  tral.yr_113   # tral113r.y        # Lateral position track irregularity
                  tral.zr_113   # tral113r.z        # Vertical position track irregularity
                  tral.vyr_113  # tral113r.vy       # Lateral velocity track irregularity
                  tral.vzr_113  # tral113r.vz       # Vertical velocity track irregularity
                  ro_113r                   # Wheel rolling radius, will vary for OOR-wheels
                  -1                       # Orientation
                  1                        # Circular shape in long direction                           
                  1.    # mulfact_nux_113r  # Longitudinal creep relaxation due to contaminated surfaces
                  1.    # mulfact_nuy_113r  # Lateral      creep relaxation due to contaminated surfaces
                  1.    # mulfact_spin_113r # Spin         creep relaxation due to contaminated surfaces
#
                wheel_prof_right_113r      # Wheel profile                                              
                .001 .001                  # Distance between brushes in mesh long&lat direction         
                rail_prof_memfield         # Rail profile                                               
#
                 82000.e6                  # Shear Modulus body 1                                       
                 0.28                      # Poisson's ratio body 1                                     
                 82000.e6                  # Shear Modulus body 2                                       
                 0.28                      # Poisson's ratio body 2                                     
#                                                                                                       
                 0.                        # Vertical curvature rail head                               
#
#                                            Wheel/rail-friction                                        
                 0                         # Coulomb friction                                           
                 .5, .5                    #  cp1 params= [fstat,fkin]                                  
                 .5, .5                    #  cp2 params= [fstat,fkin]                                  
                 .5, .5                    #  cp3 params= [fstat,fkin]                                  
                 .5, .5                    #  cp4 params= [fstat,fkin]                                  
                 .5, .5                    #  cp5 params= [fstat,fkin]                                  
                 .5, .5                    #  cp6 params= [fstat,fkin]                                  
                 .5, .5                    #  cp7 params= [fstat,fkin]                                  
                 .5, .5                    #  cp8 params= [fstat,fkin]                                  
                 .5, .5                    #  cp9 params= [fstat,fkin]                                  
#                                                                                                       
#               5                          # Exponential falling friction acc.to Polach                 
#               .3, .6, log(2)/1.25        #  cp1 params= [fstat,polach_a,polach_b]                     
#               .3, .6, log(2)/1.25        #  cp2                                                       
#               .3, .6, log(2)/1.25        #  cp3,,, etc.                                               
#
#                                            Interfacial layer                                          
                 0                         # No layer                                                   
#                4                         # Elasto-plastic intfc.layer                                 
#                100e6 laythk 950e6 75e6     #  cp1 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp2 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp3 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp4 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp5 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp6 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp7 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp8 params= [G3,laythk,taucrt,ggplst]                     
#                100e6 laythk 950e6 75e6     #  cp9 params= [G3,laythk,taucrt,ggplst]                     

   constr fix_rigid_1  ral_111l x 0.  constr fix_rigid_1  ral_111l y 0.  constr fix_rigid_1  ral_111l z 0.
   constr fix_rigid_1  ral_111l f 0.  constr fix_rigid_1  ral_111l k 0.  constr fix_rigid_1  ral_111l p 0.
   constr fix_rigid_1  ral_111r x 0.  constr fix_rigid_1  ral_111r y 0.  constr fix_rigid_1  ral_111r z 0.
   constr fix_rigid_1  ral_111r f 0.  constr fix_rigid_1  ral_111r k 0.  constr fix_rigid_1  ral_111r p 0.
#
   constr fix_rigid_1  ral_112l x 0.  constr fix_rigid_1  ral_112l y 0.  constr fix_rigid_1  ral_112l z 0.
   constr fix_rigid_1  ral_112l f 0.  constr fix_rigid_1  ral_112l k 0.  constr fix_rigid_1  ral_112l p 0.
   constr fix_rigid_1  ral_112r x 0.  constr fix_rigid_1  ral_112r y 0.  constr fix_rigid_1  ral_112r z 0.
   constr fix_rigid_1  ral_112r f 0.  constr fix_rigid_1  ral_112r k 0.  constr fix_rigid_1  ral_112r p 0.
#
   constr fix_rigid_1  ral_113l x 0.  constr fix_rigid_1  ral_113l y 0.  constr fix_rigid_1  ral_113l z 0.
   constr fix_rigid_1  ral_113l f 0.  constr fix_rigid_1  ral_113l k 0.  constr fix_rigid_1  ral_113l p 0.
   constr fix_rigid_1  ral_113r x 0.  constr fix_rigid_1  ral_113r y 0.  constr fix_rigid_1  ral_113r z 0.
   constr fix_rigid_1  ral_113r f 0.  constr fix_rigid_1  ral_113r k 0.  constr fix_rigid_1  ral_113r p 0.
#
   constr fix_rigid_1  ral_114l x 0.
   constr fix_rigid_1  ral_114l f 0.  constr fix_rigid_1  ral_114l k 0.  constr fix_rigid_1  ral_114l p 0.
   constr fix_rigid_1  ral_114r x 0.
   constr fix_rigid_1  ral_114r f 0.  constr fix_rigid_1  ral_114r k 0.  constr fix_rigid_1  ral_114r p 0.
#
  coupl k kyrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0.  17e6    esys y
  coupl k kyrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0.  17e6    esys y
  coupl c cyrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0. 100e3    esys y
  coupl c cyrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0. 100e3    esys y
# coupl c cyrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0.  .05*17e6/pi/4    esys y
# coupl c cyrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0.  .05*17e6/pi/4    esys y
# coupl c cyrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0.  ral_damp.y       esys y
# coupl c cyrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0.  ral_damp.y       esys y
#
  coupl p_lin kzrt_114= -100e3-ral_114r.zz*9.81 230e6
  coupl k kzrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0. kzrt_114 esys z
  coupl k kzrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0. kzrt_114 esys z
  coupl c czrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0.   1e6    esys z
  coupl c czrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0.   1e6    esys z
# coupl c czrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0.   .05*kzrt_114.v1/pi/4    esys z
# coupl c czrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0.   .05*kzrt_114.v1/pi/4    esys z
# coupl c czrt114l  ral_114l  0. -bo_ 0.  grd_114  0. -bo_ 0.   ral_damp.z              esys z
# coupl c czrt114r  ral_114r  0.  bo_ 0.  grd_114  0.  bo_ 0.   ral_damp.z              esys z

# func fl_wear_w 111r  mu_111r1 mu_111r2 mu_111r3
# func fl_wear_w 112r  mu_112r1 mu_112r2 mu_112r3
# func fl_wear_w 113r  mu_113r1 mu_113r2 mu_113r3
# func fl_wear_w 114r  mu_114r1 mu_114r2 mu_114r3

##
##  Modal parameters of the wheelsets.
##  ----------------------------------
# mass  m_flex_1 axl_111  70   0.10               ## Torsionsform
# coupl m_flex_1 cp3_111r end_2  0.0636396 0. 0.  # 0. 0.14142 0.
# coupl m_flex_1 cp3_111l end_2  -.0636396 0. 0.  # 0. 0.14142 0.
# s_var sngl axl_111.c1
# s_var sngl axl_111.v1

##
##  Store variables for postprocessing
##  ----------------------------------
  s_var gpdat_r1                   # Write the motions of all masses to the GPdat-file
#
  s_var scalar_0 mu_
#
  s_var sngl ro_
  s_var sngl bo_
  s_var sngl Vo
#
  s_var var_0 esys.x
  s_var var_0 esys.y
  s_var var_0 esys.z
  s_var var_0 esys.f
  s_var var_0 esys.k
  s_var var_0 esys.p
#
  s_var var_0 esys.vx
  s_var var_0 esys.vy
  s_var var_0 esys.vz
  s_var var_0 esys.vf
  s_var var_0 esys.vk
  s_var var_0 esys.vp
#
  s_var var_0 esys.ax
  s_var var_0 esys.ay
  s_var var_0 esys.az
  s_var var_0 esys.af
  s_var var_0 esys.ak
  s_var var_0 esys.ap
#
  substruct store_axle [        
   s_var var_0 axl_$1.x         
   s_var var_0 axl_$1.y         
   s_var var_0 axl_$1.z         
   s_var var_0 axl_$1.f         
   s_var var_0 axl_$1.k         
   s_var var_0 axl_$1.p         
#
   s_var var_0 axl_$1.vx        
   s_var var_0 axl_$1.vy        
   s_var var_0 axl_$1.vz        
   s_var var_0 axl_$1.vf        
   s_var var_0 axl_$1.vk        
   s_var var_0 axl_$1.vp        
#
   s_var var_0 axl_$1.Fx        
   s_var var_0 axl_$1.Fy        
   s_var var_0 axl_$1.Fz        
   s_var var_0 axl_$1.Mf        
   s_var var_0 axl_$1.Mk        
   s_var var_0 axl_$1.Mp        
#
   s_var var_0 axl_$1.Ax        
   s_var var_0 axl_$1.Ay        
   s_var var_0 axl_$1.Az        
   s_var var_0 axl_$1.Af        
   s_var var_0 axl_$1.Ak        
   s_var var_0 axl_$1.Ap        
#
  s_var var_0 trc_$1.x     s_var var_0 trc_$1.y     s_var var_0 trc_$1.z        
  s_var var_0 trc_$1.f     s_var var_0 trc_$1.k     s_var var_0 trc_$1.p        
  s_var var_0 trc_$1.vx    s_var var_0 trc_$1.vy    s_var var_0 trc_$1.vz       
  s_var var_0 trc_$1.vf    s_var var_0 trc_$1.vk    s_var var_0 trc_$1.vp       
  ]
#
  substruct store_wheel [       
   s_var var_0 ral_$1.y         
   s_var var_0 ral_$1.z         
   s_var var_0 ral_$1.vy        
   s_var var_0 ral_$1.vz        
#
   s_var var_0 cp_$1.eta        
   s_var var_0 cp_$1.Fx         
   s_var var_0 cp_$1.Fy         
   s_var var_0 cp_$1.Fz         
   s_var var_0 cp_$1.Mf         
   s_var var_0 cp_$1.Mk         
   s_var var_0 cp_$1.Mp         
#
   s_var var_0 cp_$1.F1x        
   s_var var_0 cp_$1.F1y        
   s_var var_0 cp_$1.F1z        
   s_var var_0 cp_$1.M1f        
   s_var var_0 cp_$1.M1k        
   s_var var_0 cp_$1.M1p        
#
   s_var var_0 cp_$1.F2x        
   s_var var_0 cp_$1.F2y        
   s_var var_0 cp_$1.F2z        
   s_var var_0 cp_$1.M2f        
   s_var var_0 cp_$1.M2k        
   s_var var_0 cp_$1.M2p        
#
   s_var var_0 tral$1.y         
   s_var var_0 tral$1.z         
   s_var var_0 tral$1.vy        
   s_var var_0 tral$1.vz        
#
   s_var var_0 cp3_$1.z         
   s_var var_0 cp3_$1.dr        
   s_var var_0 cp3_$1.gam       
   s_var var_0 cp3_$1.area      
   s_var var_0 cp3_$1.ksi       
   s_var var_0 cp3_$1.posw      
   s_var var_0 cp3_$1.posr      
   s_var var_0 cp3_$1.bo_       
#
   s_var var_0 cp3_$1.nux       
   s_var var_0 cp3_$1.nuy       
   func  atan2 cp3_$1.nya= cp3_$1.nuy cp3_$1.nux        # Direction of creepage         
   s_var var_0 cp3_$1.nya       
   s_var var_0 cp3_$1.spin      
   s_var var_0 cp3_$1.uny       
   s_var var_0 cp3_$1.usp       
#
   s_var var_0 cp3_$1.vx        
   s_var var_0 cp3_$1.vy        
   s_var var_0 cp3_$1.vz        
   s_var var_0 cp3_$1.vf        
   s_var var_0 cp3_$1.vk        
   s_var var_0 cp3_$1.vp        
   s_var var_0 cp3_$1.vux       
   s_var var_0 cp3_$1.vuy       
   s_var var_0 cp3_$1.vuz       
   s_var var_0 cp3_$1.Vref      
   s_var var_0 cp3_$1.trl_h     
#
   s_var var_0 cp3_$1.Fn        
   s_var var_0 cp3_$1.Fny       
#
   s_var var_0 cp3_$1.Fx        
   s_var var_0 cp3_$1.Fy        
   s_var var_0 cp3_$1.Fz        
   s_var var_0 cp3_$1.Mspin     
#
   s_var var_0 cp3_$1.wArchH    # Archard with Hertz pressure distribution      
   s_var var_0 cp3_$1.wArchS                                                    
#
   if_then cp3_$1.Vref .ge. 0.
    func  operp cp3_$1.Fnu =  cp3_$1.Fx * cp3_$1.nux + cp3_$1.Fny * cp3_$1.nuy    # Tgamma      
   else
    func  operp cp3_$1.Fnu = -cp3_$1.Fx * cp3_$1.nux - cp3_$1.Fny * cp3_$1.nuy    # Tgamma      
   endif
   func  operp cp3_$1.FMnu= cp3_$1.Fnu + cp3_$1.spin * cp3_$1.Mspin               # Energy dissipation

   s_var var_0 cp3_$1.Fnu                                               
   s_var var_0 cp3_$1.FMnu                                              
#
   s_var var_0 cp3_$1.pen       # Undeformed penetration                
   s_var var_0 cp3_$1.udefa     # Undeformed elliptic semi-axis a       
   s_var var_0 cp3_$1.udefb     # Undeformed elliptic semi-axis b       
   s_var var_0 cp3_$1.slip_area                                         
   s_var var_0 cp3_$1.idamp                                             
   if_then_init .exist. cp3_$1.Fx                                       
    func div cp3_$1.mux= cp3_$1.Fx cp3_$1.Fn                            
    s_var var_0 cp3_$1.mux       # Utilized friction                    
   endif                                                                
  ]
  in_substruct store_axle  [ 111  ]
  in_substruct store_axle  [ 112  ]
  in_substruct store_axle  [ 113  ]
  in_substruct store_axle  [ 114  ]
  in_substruct store_wheel [ 111l ]
  in_substruct store_wheel [ 111r ]
  in_substruct store_wheel [ 112l ]
  in_substruct store_wheel [ 112r ]
# in_substruct store_wheel [ 113l ]
  in_substruct store_wheel [ 113r ]
  in_substruct store_wheel [ 114l ]
  in_substruct store_wheel [ 114r ]
#
# in_substruct store [ 111l ]
# in_substruct store [ 112l ]
# in_substruct store [ 113l ]
#
# initval read_gpdat gp/quasi_contact_1.gp 601
#
 eof
