# Debugging a vehicle model

Before starting the analysis of a new model in GENSYS, it is advisable to check the model for any possibly errors. Here follows a of check-list:

• Graphical check
Start program gplot and read the input data model. Check that all couplings are correctly mounted, by clicking on the couplings with the left button of your mouse.

• Check of abnormal data
Run program runf_info on your input data model. Program runf_info will print warnings for both very stiff and soft couplings. Warnings for very long couplings will also be made. In addition to the warning messages program runf_info will also draw a 2D-plot of the model showing how all masses and couplings connects to each other.

• Tsim check
Make a time-domain simulation on tangent track without track irregularities.
Start program GPLOT and set deform_scale to 300-400 times. Animate the simulation and look for unexpected motions.

• Quasi check #1
Apply constrains to the car-body in vertical direction and move the car-body 0.05[m] in positive direction. Make a new quasi-static calculation in program QUASI. Check that the results for the two bogies are symmetric and that vertical contact forces has increased according to the total stiffness in the primary and secondary suspension.

• Quasi check #2
Apply constrains to the car-body in lateral direction and move the car-body 0.05[m] in positive direction. Make a new quasi-static calculation in program QUASI. Check that both bogies has a negative yaw angle in the track.

• Modal check
Read the input data file into program MODAL, and do the following checks:

• Check that the real part of all eigenvalues are negative.
(A positive real part indicates that the eigenvalue has negative damping)

• Check that the absolute value of the largest eigenvalue are not more than approx. 5000 [rad/s].
(A high eigenvalue indicates that the problem is stiff, and long calculation times are expected)

• Check that the basic eigenvalues can be found in the model. Typical eigenvalues for a passenger vehicle can be:  Lower sway : 0.6-0.7 [Hz] Body bounce : 1.0-1.2 [Hz] Body pitch : 1.2-1.5 [Hz]
N.B. Do not forget to read initial values from a previous QUASI-calculation, in order to get correct contact forces between wheel and rail.

• Critical speed
Calculate critical speed of the vehicle by starting the simulation at a very high speed and then gradually reduce the speed. This can be done by defining variable vkmh equal to:
```func const vkmh_deacc=  5                    # Deacceleration when calculating critical speed
func operp vkmh= 400 - vkmh_deacc * time     # Vary vkmh linearily
```
In order to initiate the instability mode apply an initial excitation on the car-body:
```initval set_var  car_1.vy= .15
initval set_var  car_1.vp= .15
```
Apply negative forces on all masses to make the vehicle follow the coordinate systems:
```force rel_lsys1  deacc_car_1    car_1   0 0 -hccg_1   -mc_1*vkmh_deacc/3.6  0. 0.  0. 0. 0.     # Deacceleration vkmh_deacc in [km/h/s]
force rel_lsys1  deacc_bog_11   bog_11  0 0 -hbcg_11  -mb_11*vkmh_deacc/3.6 0. 0.  0. 0. 0.     # as external forces
force rel_lsys1  deacc_bog_12   bog_12  0 0 -hbcg_12  -mb_12*vkmh_deacc/3.6 0. 0.  0. 0. 0.
force rel_lsys1  deacc_axl_111  axl_111 0 0 -ro_111  -(ma_111+Jka_111/ro_111^2)*vkmh_deacc/3.6 0. 0.  0. 0. 0.
force rel_lsys1  deacc_axl_112  axl_112 0 0 -ro_112  -(ma_112+Jka_112/ro_112^2)*vkmh_deacc/3.6 0. 0.  0. 0. 0.
force rel_lsys1  deacc_axl_121  axl_121 0 0 -ro_121  -(ma_121+Jka_121/ro_121^2)*vkmh_deacc/3.6 0. 0.  0. 0. 0.
force rel_lsys1  deacc_axl_122  axl_122 0 0 -ro_122  -(ma_122+Jka_122/ro_122^2)*vkmh_deacc/3.6 0. 0.  0. 0. 0.
```