(reset) (si) (add-gravity :direction -[nz])
(add-point pt1 :body n :coordinates (L3 0 h))
(add-point pt2 :body n :coordinates (L4 0 0))
(add-point pt3 :body n :coordinates (L2 0 0))
(add-point pt4 :body n :coordinates (L4 B1 0))
(add-point pt5 :body n :coordinates (L4 -B1 0))
(add-point pt6 :body n :coordinates (L2 B1 0))
(add-point pt7 :body n :coordinates (L2 -B1 0))
(add-point pt8 :body n :coordinates (L4 a -r))
(add-point pt9 :body n :coordinates (L4 -a -r))
(add-point pt10 :body n :coordinates (L2 a -r))
(add-point pt11 :body n :coordinates (L2 -a -r))
(add-point pt12 :body n :coordinates (L4 B2 0))
(add-point pt13 :body n :coordinates (L5 B1 0))
(add-point pt14 :body n :coordinates (L4 B1 h))
(add-point pt15 :body n :coordinates (L4 -B2 0))
(add-point pt16 :body n :coordinates (L5 -B1 0))
(add-point pt17 :body n :coordinates (L4 -B1 h))
(add-point pt18 :body n :coordinates (L2 B2 0))
(add-point pt19 :body n :coordinates (L1 B1 0))
(add-point pt20 :body n :coordinates (L2 B1 h))
(add-point pt21 :body n :coordinates (L2 -B2 0))
(add-point pt22 :body n :coordinates (L1 -B1 0))
(add-point pt23 :body n :coordinates (L2 -B1 h))
(add-point pt24 :body n :coordinates (L3 B2 h))
(add-point pt25 :body n :coordinates (L3 -B2 h))
(add-point pt27 :body n :coordinates (L4 B2 h))
(add-point pt28 :body n :coordinates (L3 B3 h))
(add-point pt29 :body n :coordinates (L3 B2 h1))
(add-point pt30 :body n :coordinates (L4 -B2 h))
(add-point pt31 :body n :coordinates (L3 -B3 h))
(add-point pt32 :body n :coordinates (L3 -B2 h1))
(add-point pt26 :body n :coordinates (0 0 hs))
(add-point spt1 :body n :coordinates (-L3 0 h))
(add-point spt2 :body n :coordinates (-L2 0 0))
(add-point spt3 :body n :coordinates (-L4 0 0))
(add-point spt4 :body n :coordinates (-L2 B1 0))
(add-point spt5 :body n :coordinates (-L2 -B1 0))
(add-point spt6 :body n :coordinates (-L4 B1 0))
(add-point spt7 :body n :coordinates (-L4 -B1 0))
(add-point spt8 :body n :coordinates (-L2 a -r))
(add-point spt9 :body n :coordinates (-L2 -a -r))
(add-point spt10 :body n :coordinates (-L4 a -r))
(add-point spt11 :body n :coordinates (-L4 -a -r))
(add-point spt12 :body n :coordinates (-L2 B2 0))
(add-point spt13 :body n :coordinates (-L1 B1 0))
(add-point spt14 :body n :coordinates (-L2 B1 h))
(add-point spt15 :body n :coordinates (-L2 -B2 0))
(add-point spt16 :body n :coordinates (-L1 -B1 0))
(add-point spt17 :body n :coordinates (-L2 -B1 h))
(add-point spt18 :body n :coordinates (-L4 B2 0))
(add-point spt19 :body n :coordinates (-L5 B1 0))
(add-point spt20 :body n :coordinates (-L4 B1 h))
(add-point spt21 :body n :coordinates (-L4 -B2 0))
(add-point spt22 :body n :coordinates (-L5 -B1 0))
(add-point spt23 :body n :coordinates (-L4 -B1 h))
(add-point spt24 :body n :coordinates (-L3 B2 h))
(add-point spt25 :body n :coordinates (-L3 -B2 h))
(add-point spt27 :body n :coordinates (-L2 B2 h))
(add-point spt28 :body n :coordinates (-L3 B3 h))
(add-point spt29 :body n :coordinates (-L3 B2 h1))
(add-point spt30 :body n :coordinates (-L2 -B2 h))
(add-point spt31 :body n :coordinates (-L3 -B3 h))
(add-point spt32 :body n :coordinates (-L3 -B2 h1))
;;; add carbody mass
(add-body cmass
:name "carbody mass"
:joint-coordinates pt26
:cm-coordinates pt26
:translate (y z)
:body-rotation-axes (x y z)
:mass "mc"
:inertia-matrix ("Icx" "Icy" "Icz"))
(add-point cmass27 :body cmass :coordinates pt27))
(add-point cmass28 :body cmass :coordinates pt28))
(add-point cmass29 :body cmass :coordinates pt29))
(add-point cmass30 :body cmass :coordinates pt30))
(add-point cmass31 :body cmass :coordinates pt31))
(add-point cmass32 :body cmass :coordinates pt32))
(add-point scmass27 :body cmass :coordinates spt27))
(add-point scmass28 :body cmass :coordinates spt28))
(add-point scmass29 :body cmass :coordinates spt29))
(add-point scmass30 :body cmass :coordinates spt30))
(add-point scmass31 :body cmass :coordinates spt31))
(add-point scmass32 :body cmass :coordinates spt32))
;;; add bogie mass
(add-body bmass
:name "bogie mass"
:joint-coordinates pt1
:cm-coordinates pt1
:translate (x y z)
:body-rotation-axes (x y z)
:mass "mb"
:inertia-matrix ("Ibx" "Iby" "Ibz"))
(add-point bmass12 :body bmass :coordinates pt12))
(add-point bmass13 :body bmass :coordinates pt13))
(add-point bmass14 :body bmass :coordinates pt14))
(add-point bmass15 :body bmass :coordinates pt15))
(add-point bmass16 :body bmass :coordinates pt16))
(add-point bmass17 :body bmass :coordinates pt17))
(add-point bmass18 :body bmass :coordinates pt18))
(add-point bmass19 :body bmass :coordinates pt19))
(add-point bmass20 :body bmass :coordinates pt20))
(add-point bmass21 :body bmass :coordinates pt21))
(add-point bmass22 :body bmass :coordinates pt22))
(add-point bmass23 :body bmass :coordinates pt23))
(add-point bmass24 :body bmass :coordinates pt24))
(add-point bmass25 :body bmass :coordinates pt25))
;;; add sbogie mass
(add-body sbmass
:name "sbogie mass"
:joint-coordinates spt1
:cm-coordinates spt1
:translate (x y z)
:body-rotation-axes (x y z)
:mass "mb"
:inertia-matrix ("Ibx" "Iby" "Ibz"))
(add-point sbmass12 :body sbmass :coordinates spt12))
(add-point sbmass13 :body sbmass :coordinates spt13))
(add-point sbmass14 :body sbmass :coordinates spt14))
(add-point sbmass15 :body sbmass :coordinates spt15))
(add-point sbmass16 :body sbmass :coordinates spt16))
(add-point sbmass17 :body sbmass :coordinates spt17))
(add-point sbmass18 :body sbmass :coordinates spt18))
(add-point sbmass19 :body sbmass :coordinates spt19))
(add-point sbmass20 :body sbmass :coordinates spt20))
(add-point sbmass21 :body sbmass :coordinates spt21))
(add-point sbmass22 :body sbmass :coordinates spt22))
(add-point sbmass23 :body sbmass :coordinates spt23))
(add-point sbmass24 :body sbmass :coordinates spt24))
(add-point sbmass25 :body sbmass :coordinates spt25))
;;; add front wheel mass
(add-body fwmass
:name "front wheel mass"
:joint-coordinates pt2
:cm-coordinates pt2
:translate (x y z)
:body-rotation-axes (x z)
:mass "mw"
:inertia-matrix ("Iwx" 0 "Iwz"))
(add-point fwmass2 :body fwmass :coordinates pt2)
(add-point fwmass4 :body fwmass :coordinates pt4)
(add-point fwmass5 :body fwmass :coordinates pt5)
(add-point fwmass8 :body fwmass :coordinates pt8)
(add-point fwmass9 :body fwmass :coordinates pt9)
;;; add rear wheel mass
(add-body rwmass
:name "rear wheel mass"
:joint-coordinates pt3
:cm-coordinates pt3
:translate (x y z)
:body-rotation-axes (x z)
:mass "mw"
:inertia-matrix ("Iwx" 0 "Iwz"))
(add-point rwmass3 :body rwmass :coordinates pt3)
(add-point rwmass6 :body rwmass :coordinates pt6)
(add-point rwmass7 :body rwmass :coordinates pt7)
(add-point rwmass10 :body rwmass :coordinates pt10)
(add-point rwmass11 :body rwmass :coordinates pt11)
;;; add sfront wheel mass
(add-body sfwmass
:name "sfront wheel mass"
:joint-coordinates spt2
:cm-coordinates spt2
:translate (x y z)
:body-rotation-axes (x z)
:mass "mw"
:inertia-matrix ("Iwx" 0 "Iwz"))
(add-point sfwmass2 :body sfwmass :coordinates spt2)
(add-point sfwmass4 :body sfwmass :coordinates spt4)
(add-point sfwmass5 :body sfwmass :coordinates spt5)
(add-point sfwmass8 :body sfwmass :coordinates spt8)
(add-point sfwmass9 :body sfwmass :coordinates spt9)
;;; add srear wheel mass
(add-body srwmass
:name "srear wheel mass"
:joint-coordinates spt3
:cm-coordinates spt3
:translate (x y z)
:body-rotation-axes (x z)
:mass "mw"
:inertia-matrix ("Iwx" 0 "Iwz"))
(add-point srwmass3 :body srwmass :coordinates spt3)
(add-point srwmass6 :body srwmass :coordinates spt6)
(add-point srwmass7 :body srwmass :coordinates spt7)
(add-point srwmass10 :body srwmass :coordinates spt10)
(add-point srwmass11 :body srwmass :coordinates spt11)
(setsym e1 "e+tu(bmass,1)+tu(fwmass,1)")
(setsym e2 "e+tu(bmass,1)+tu(rwmass,1)")
(setsym e3 "e+tu(sbmass,1)+tu(sfwmass,1)")
(setsym e4 "e+tu(sbmass,1)+tu(srwmass,1)")
;;;add inerter between carbody and bogie
(add-body bsx1 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body bsx2 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(setsym beta1 "sqrt(bsx/Ibb)")
(add-speed-constraint "dot([nx],vel(cmass27,bmass24))-1/@beta1*ru(bsx1)" :u "ru(bsx1)")
(add-speed-constraint "dot([nx],vel(cmass30,bmass25))-1/@beta1*ru(bsx2)" :u "ru(bsx2)")
(add-body bsy1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bsy2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta2 "sqrt(bsy/Ibb)")
(add-speed-constraint "dot([ny],vel(cmass28,bmass24))-1/@beta2*ru(bsy1)" :u "ru(bsy1)")
(add-speed-constraint "dot([ny],vel(cmass31,bmass25))-1/@beta2*ru(bsy2)" :u "ru(bsy2)")
(add-body bsz1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bsz2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta3 "sqrt(bsz/Ibb)")
(add-speed-constraint "dot([nz],vel(cmass29,bmass24))-1/@beta3*ru(bsz1)" :u "ru(bsz1)")
(add-speed-constraint "dot([nz],vel(cmass32,bmass25))-1/@beta3*ru(bsz2)" :u "ru(bsz2)")
;;;add inerter between bogie and wheelset
(add-body bpx1 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body bpx2 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body bpx3 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body bpx4 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(setsym beta4 "sqrt(bpx/Ibb)")
(add-speed-constraint "dot([nx],vel(bmass13,fwmass4))-1/@beta4*ru(bpx1)" :u "ru(bpx1)")
(add-speed-constraint "dot([nx],vel(bmass16,fwmass5))-1/@beta4*ru(bpx2)" :u "ru(bpx2)")
(add-speed-constraint "dot([nx],vel(bmass19,rwmass6))-1/@beta4*ru(bpx3)" :u "ru(bpx3)")
(add-speed-constraint "dot([nx],vel(bmass22,rwmass7))-1/@beta4*ru(bpx4)" :u "ru(bpx4)")
(add-body bpy1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bpy2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bpy3 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bpy4 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta5 "sqrt(bpy/Ibb)")
(add-speed-constraint "dot([ny],vel(bmass12,fwmass4))-1/@beta5*ru(bpy1)" :u "ru(bpy1)")
(add-speed-constraint "dot([ny],vel(bmass15,fwmass5))-1/@beta5*ru(bpy2)" :u "ru(bpy2)")
(add-speed-constraint "dot([ny],vel(bmass18,rwmass6))-1/@beta5*ru(bpy3)" :u "ru(bpy3)")
(add-speed-constraint "dot([ny],vel(bmass21,rwmass7))-1/@beta5*ru(bpy4)" :u "ru(bpy4)")
(add-body bpz1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bpz2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bpz3 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body bpz4 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta6 "sqrt(bpz/Ibb)")
(add-speed-constraint "dot([nz],vel(bmass14,fwmass4))-1/@beta6*ru(bpz1)" :u "ru(bpz1)")
(add-speed-constraint "dot([nz],vel(bmass17,fwmass5))-1/@beta6*ru(bpz2)" :u "ru(bpz2)")
(add-speed-constraint "dot([nz],vel(bmass20,rwmass6))-1/@beta6*ru(bpz3)" :u "ru(bpz3)")
(add-speed-constraint "dot([nz],vel(bmass23,rwmass7))-1/@beta6*ru(bpz4)" :u "ru(bpz4)")
;;;add inerter between carbody and sbogie
(add-body sbsx1 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body sbsx2 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(setsym beta1 "sqrt(bsx/Ibb)")
(add-speed-constraint "dot([nx],vel(scmass27,sbmass24))-1/@beta1*ru(sbsx1)" :u "ru(sbsx1)")
(add-speed-constraint "dot([nx],vel(scmass30,sbmass25))-1/@beta1*ru(sbsx2)" :u "ru(sbsx2)")
(add-body sbsy1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbsy2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta2 "sqrt(bsy/Ibb)")
(add-speed-constraint "dot([ny],vel(scmass28,sbmass24))-1/@beta2*ru(sbsy1)" :u "ru(sbsy1)")
(add-speed-constraint "dot([ny],vel(scmass31,sbmass25))-1/@beta2*ru(sbsy2)" :u "ru(sbsy2)")
(add-body sbsz1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbsz2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta3 "sqrt(bsz/Ibb)")
(add-speed-constraint "dot([nz],vel(scmass29,sbmass24))-1/@beta3*ru(sbsz1)" :u "ru(sbsz1)")
(add-speed-constraint "dot([nz],vel(scmass32,sbmass25))-1/@beta3*ru(sbsz2)" :u "ru(sbsz2)")
;;;add inerter between sbogie and swheelset
(add-body sbpx1 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body sbpx2 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body sbpx3 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(add-body sbpx4 :body-rotation-axes y :mass 0
:inertia-matrix (0 "Ibb" 0) )
(setsym beta4 "sqrt(bpx/Ibb)")
(add-speed-constraint "dot([nx],vel(sbmass13,sfwmass4))-1/@beta4*ru(sbpx1)" :u "ru(sbpx1)")
(add-speed-constraint "dot([nx],vel(sbmass16,sfwmass5))-1/@beta4*ru(sbpx2)" :u "ru(sbpx2)")
(add-speed-constraint "dot([nx],vel(sbmass19,srwmass6))-1/@beta4*ru(sbpx3)" :u "ru(sbpx3)")
(add-speed-constraint "dot([nx],vel(sbmass22,srwmass7))-1/@beta4*ru(sbpx4)" :u "ru(sbpx4)")
(add-body sbpy1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbpy2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbpy3 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbpy4 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta5 "sqrt(bpy/Ibb)")
(add-speed-constraint "dot([ny],vel(sbmass12,sfwmass4))-1/@beta5*ru(sbpy1)" :u "ru(sbpy1)")
(add-speed-constraint "dot([ny],vel(sbmass15,sfwmass5))-1/@beta5*ru(sbpy2)" :u "ru(sbpy2)")
(add-speed-constraint "dot([ny],vel(sbmass18,srwmass6))-1/@beta5*ru(sbpy3)" :u "ru(sbpy3)")
(add-speed-constraint "dot([ny],vel(sbmass21,srwmass7))-1/@beta5*ru(sbpy4)" :u "ru(sbpy4)")
(add-body sbpz1 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbpz2 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbpz3 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(add-body sbpz4 :body-rotation-axes x :mass 0
:inertia-matrix ("Ibb" 0 0) )
(setsym beta6 "sqrt(bpz/Ibb)")
(add-speed-constraint "dot([nz],vel(sbmass14,sfwmass4))-1/@beta6*ru(sbpz1)" :u "ru(sbpz1)")
(add-speed-constraint "dot([nz],vel(sbmass17,sfwmass5))-1/@beta6*ru(sbpz2)" :u "ru(sbpz2)")
(add-speed-constraint "dot([nz],vel(sbmass20,srwmass6))-1/@beta6*ru(sbpz3)" :u "ru(sbpz3)")
(add-speed-constraint "dot([nz],vel(sbmass23,srwmass7))-1/@beta6*ru(sbpz4)" :u "ru(sbpz4)")
(add-line-force u4x :direction [nx] :point2 fwmass4 :point1 bmass13 :magnitude "-kpx*(x-x0)-cpx*v")
(add-line-force u4y :direction [ny] :point2 fwmass4 :point1 bmass12 :magnitude "-kpy*(x-x0)-cpy*v")
(add-line-force u4z :direction [nz] :point2 fwmass4 :point1 bmass14 :magnitude "-kpz*(x-x0) -cpz*v +(2*mb+mc)*g/8")
(add-line-force u5x :direction [nx] :point2 fwmass5 :point1 bmass16 :magnitude "-kpx*(x-x0) -cpx*v")
(add-line-force u5y :direction [ny] :point2 fwmass5 :point1 bmass15 :magnitude "-kpy*(x-x0) -cpy*v")
(add-line-force u5z :direction [nz] :point2 fwmass5 :point1 bmass17 :magnitude "-kpz*(x-x0) -cpz*v +(2*mb+mc)*g/8")
(add-line-force u6x :direction [nx] :point2 rwmass6 :point1 bmass19 :magnitude "-kpx*(x-x0)-cpx*v ")
(add-line-force u6y :direction [ny] :point2 rwmass6 :point1 bmass18 :magnitude "-kpy*(x-x0) -cpy*v ")
(add-line-force u6z :direction [nz] :point2 rwmass6 :point1 bmass20 :magnitude "-kpz*(x-x0) -cpz*v +(2*mb+mc)*g/8 ")
(add-line-force u7x :direction [nx] :point2 rwmass7 :point1 bmass22 :magnitude "-kpx*(x-x0)-cpx*v ")
(add-line-force u7y :direction [ny] :point2 rwmass7 :point1 bmass21 :magnitude "-kpy*(x-x0) -cpy*v")
(add-line-force u7z :direction [nz] :point2 rwmass7 :point1 bmass23 :magnitude "-kpz*(x-x0) -cpz*v+(2*mb+mc)*g/8 ")
(add-line-force u24x :direction [nx] :point2 bmass24 :point1 cmass27 :magnitude "-ksx*(x-x0) -csx*v")
(add-line-force u24y :direction [ny] :point2 bmass24 :point1 cmass28 :magnitude "-ksy*(x-x0) -csy*v ")
(add-line-force u24z :direction [nz] :point2 bmass24 :point1 cmass29 :magnitude "-ksz*(x-x0) -csz*v+(mc)*g/4 ")
(add-line-force u25x :direction [nx] :point2 bmass25 :point1 cmass30 :magnitude "-ksx*(x-x0) -csx*v")
(add-line-force u25y :direction [ny] :point2 bmass25 :point1 cmass31 :magnitude "-ksy*(x-x0) -csy*v")
(add-line-force u25z :direction [nz] :point2 bmass25 :point1 cmass32 :magnitude "-ksz*(x-x0) -csz*v +(mc)*g/4 ")
(add-line-force u8x :point1 fwmass8 :direction [nx] :magnitude "(-f33/@e1)*(@e1*(-y*tq(fwmass,2))/r-a*ru(fwmass,2)) +((f11/@e1)*(tu(fwmass,2)+(r+y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(f12/@e1)*(ru(fwmass,2)-@e1*y/r))*rq(fwmass,2)")
(add-line-force u8y :point1 fwmass8 :direction [ny] :magnitude "(-f33/@e1)*(@e1*(-y*tq(fwmass,2))/r-a*ru(fwmass,1))*rq(fwmass,2)+((-f11/@e1)*(tu(fwmass,2)+(r+y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(-f12/@e1)*(ru(fwmass,2)-@e1*y/r))")
(add-line-force u8z :point1 fwmass8 :direction [nz] :magnitude "((-f11/@e1)*(tu(fwmass,2)+(r+y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(-f12/@e1)*(ru(fwmass,2)-@e1*y/r))*(y+rq(fwmass,1))")
(add-line-force u9x :point1 fwmass9 :direction [nx] :magnitude "(-f33/@e1)*(@e1*y*tq(fwmass,2)/r+a*ru(fwmass,2))+((f11/@e1)*(tu(fwmass,2)+(r-y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(f12/@e1)*(ru(fwmass,2)+@e1*y/r))*rq(fwmass,2)")
(add-line-force u9y :point1 fwmass9 :direction [ny] :magnitude "(-f33/@e1)*(@e1*y*tq(fwmass,2)/r+a*ru(fwmass,2))*rq(fwmass,2)+((-f11/@e1)*(tu(fwmass,2)+(r-y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(-f12/@e1)*(ru(fwmass,2)+@e1*y/r))")
(add-line-force u9z :point1 fwmass9 :direction [nz] :magnitude "((f11/@e1)*(tu(fwmass,2)+(r-y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(f12/@e1)*(ru(fwmass,2)+@e1*y/r))*(y-rq(fwmass,1))")
(add-line-force u10x :point1 rwmass10 :direction [nx] :magnitude "(-f33/@e2)*(@e2*(-y*tq(rwmass,2))/r-a*ru(rwmass,2))+((f11/@e2)*(tu(rwmass,2)+(r+y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(f12/@e2)*(ru(rwmass,2)-@e2*y/r))*rq(rwmass,2)")
(add-line-force u10y :point1 rwmass10 :direction [ny] :magnitude "(-f33/@e2)*(@e2*(-y*tq(rwmass,2))/r-a*ru(rwmass,1))*rq(rwmass,2)+((-f11/@e2)*(tu(rwmass,2)+(r+y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(-f12/@e2)*(ru(rwmass,2)-@e2*y/r))")
(add-line-force u10z :point1 rwmass10 :direction [nz] :magnitude "((-f11/@e2)*(tu(rwmass,2)+(r+y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(-f12/@e2)*(ru(rwmass,2)-@e2*y/r))*(y+rq(rwmass,1))")
(add-line-force u11x :point1 rwmass11 :direction [nx] :magnitude "(-f33/@e2)*(@e2*y*tq(rwmass,2)/r+a*ru(rwmass,2))+((f11/@e2)*(tu(rwmass,2)+(r-y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(f12/@e2)*(ru(rwmass,2)+@e2*y/r))*rq(rwmass,2)")
(add-line-force u11y :point1 rwmass11 :direction [ny] :magnitude "(-f33/@e2)*(@e2*y*tq(rwmass,2)/r+a*ru(rwmass,2))* rq(rwmass,2)+((-f11/@e2)*(tu(rwmass,2)+(r-y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(-f12/@e2)*(ru(rwmass,2)+@e2*y/r))")
(add-line-force u11z :point1 rwmass11 :direction [nz] :magnitude "((f11/@e2)*(tu(rwmass,2)+(r-y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(f12/@e2)*(ru(rwmass,2)+@e2*y/r))* (y-rq(rwmass,1))")
(add-moment T8x :body1 fwmass :direction [nx] :magnitude "((f12/@e1)*(tu(fwmass,2)+(r+y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(-f22/@e1)*(ru(fwmass,2)-@e1*y/r))*rq(fwmass,2)*(y+rq(fwmass,1))")
(add-moment T8z :body1 fwmass :direction [nz] :magnitude "((f12/@e1)*(tu(fwmass,2)+(r+y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(-f22/@e1)*(ru(fwmass,2)-@e1*y/r))")
(add-moment T9x :body1 fwmass :direction [nx] :magnitude "((-f12/@e1)*(tu(fwmass,2)+(r-y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+( f22/@e1)*(ru(fwmass,2)+@e1*y/r))*rq(fwmass,2)*(y-rq(fwmass,1))")
(add-moment T9z :body1 fwmass :direction [nz] :magnitude "((f12/@e1)*(tu(fwmass,2)+(r-y*tq(fwmass,2))*ru(fwmass,1)-@e1*rq(fwmass,2))+(-f22/@e1)*(ru(fwmass,2)+@e1*y/r))")
(add-moment T10x :body1 rwmass :direction [nx] :magnitude "((f12/@e2)*(tu(rwmass,2)+(r+y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(-f22/@e2)*(ru(rwmass,2)-@e2*y/r))*rq(rwmass,2)*(y+rq(rwmass,1))")
(add-moment T10z :body1 rwmass :direction [nz] :magnitude "((f12/@e2)*(tu(rwmass,2)+(r+y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(-f22/@e2)*(ru(rwmass,2)-@e2*y/r))")
(add-moment T11x :body1 rwmass :direction [nx] :magnitude "((-f12/@e2)*(tu(rwmass,2)+(r-y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(f22/@e2)*(ru(rwmass,2)+@e2*y/r))*rq(rwmass,2)*(y-rq(rwmass,1))")
(add-moment T11z :body1 rwmass :direction [nz] :magnitude "((f12/@e2)*(tu(rwmass,2)+(r-y*tq(rwmass,2))*ru(rwmass,1)-@e2*rq(rwmass,2))+(-f22/@e2)*(ru(rwmass,2)+@e2*y/r))")
(add-line-force n8y :point1 fwmass8 :direction [ny] :magnitude "-((mc+2*mb+4*mw)*g/8)*(y+rq(fwmass,1))")
(add-line-force n9y :point1 fwmass9 :direction [ny] :magnitude "((mc+2*mb+4*mw)*g/8)*(y-rq(fwmass,1))")
(add-line-force n10y :point1 rwmass10 :direction [ny] :magnitude "-((mc+2*mb+4*mw)*g/8)*(y+rq(rwmass,1))")
(add-line-force n11y :point1 rwmass11 :direction [ny] :magnitude "((mc+2*mb+4*mw)*g/8)*(y-rq(rwmass,1))")
(add-line-force n8z :point1 fwmass8 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-line-force n9z :point1 fwmass9 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-line-force n10z :point1 rwmass10 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-line-force n11z :point1 rwmass11 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-moment n2x :body1 fwmass :direction [nx] :magnitude "(Iwy*@e1*ru(fwmass,2)/r)")
(add-moment n2z :body1 fwmass :direction [nz] :magnitude "-Iwy*@e1*ru(fwmass,1)/r")
(add-moment n3x :body1 rwmass :direction [nx] :magnitude "(Iwy*@e2*ru(rwmass,2)/r)")
(add-moment n3z :body1 rwmass :direction [nz] :magnitude "-Iwy*@e2*ru(rwmass,1)/r")
(add-line-force su4x :direction [nx] :point2 sfwmass4 :point1 sbmass13 :magnitude "-kpx*(x-x0) -cpx*v")
(add-line-force su4y :direction [ny] :point2 sfwmass4 :point1 sbmass12 :magnitude "-kpy*(x-x0) -cpy*v")
(add-line-force su4z :direction [nz] :point2 sfwmass4 :point1 sbmass14 :magnitude "-kpz*(x-x0)-cpz*v +(2*mb+mc)*g/8 ")
(add-line-force su5x :direction [nx] :point2 sfwmass5 :point1 sbmass16 :magnitude "-kpx*(x-x0) -cpx*v")
(add-line-force su5y :direction [ny] :point2 sfwmass5 :point1 sbmass15 :magnitude "-kpy*(x-x0) -cpy*v")
(add-line-force su5z :direction [nz] :point2 sfwmass5 :point1 sbmass17 :magnitude "-kpz*(x-x0)-cpz*v +(2*mb+mc)*g/8 ")
(add-line-force su6x :direction [nx] :point2 srwmass6 :point1 sbmass19 :magnitude "-kpx*(x-x0)-cpx*v ")
(add-line-force su6y :direction [ny] :point2 srwmass6 :point1 sbmass18 :magnitude "-kpy*(x-x0) -cpy*v")
(add-line-force su6z :direction [nz] :point2 srwmass6 :point1 sbmass20 :magnitude "-kpz*(x-x0) -cpz*v +(2*mb+mc)*g/8 ")
(add-line-force su7x :direction [nx] :point2 srwmass7 :point1 sbmass22 :magnitude "-kpx*(x-x0) -cpx*v ")
(add-line-force su7y :direction [ny] :point2 srwmass7 :point1 sbmass21 :magnitude "-kpy*(x-x0) -cpy*v")
(add-line-force su7z :direction [nz] :point2 srwmass7 :point1 sbmass23 :magnitude "-kpz*(x-x0) -cpz*v +(2*mb+mc)*g/8 ")
(add-line-force su24x :direction [nx] :point2 sbmass24 :point1 scmass27 :magnitude "-ksx*(x-x0) -csx*v ")
(add-line-force su24y :direction [ny] :point2 sbmass24 :point1 scmass28 :magnitude "-ksy*(x-x0) -csy*v ")
(add-line-force su24z :direction [nz] :point2 sbmass24 :point1 scmass29 :magnitude "-ksz*(x-x0) -csz*v +(mc)*g/4 ")
(add-line-force su25x :direction [nx] :point2 sbmass25 :point1 scmass30 :magnitude "-ksx*(x-x0) -csx*v")
(add-line-force su25y :direction [ny] :point2 sbmass25 :point1 scmass31 :magnitude "-ksy*(x-x0) -csy*v")
(add-line-force su25z :direction [nz] :point2 sbmass25 :point1 scmass32 :magnitude "-ksz*(x-x0) -csz*v +(mc)*g/4 ")
(add-line-force su8x :point1 sfwmass8 :direction [nx] :magnitude "(-f33/@e3)*(@e3*(-y*tq(sfwmass,2))/r-a*ru(sfwmass,2)) +((f11/@e3)*(tu(sfwmass,2)+(r+y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(f12/@e3)*(ru(sfwmass,2)-@e3*y/r))*rq(sfwmass,2)")
(add-line-force su8y :point1 sfwmass8 :direction [ny] :magnitude "(-f33/@e3)*(@e3*(-y*tq(sfwmass,2))/r-a*ru(sfwmass,1))*rq(sfwmass,2)+((-f11/@e3)*(tu(sfwmass,2)+(r+y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(-f12/@e3)*(ru(sfwmass,2)-@e3*y/r))")
(add-line-force su8z :point1 sfwmass8 :direction [nz] :magnitude "((-f11/@e3)*(tu(sfwmass,2)+(r+y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(-f12/@e3)*(ru(sfwmass,2)-@e3*y/r))*(y+rq(sfwmass,1))")
(add-line-force su9x :point1 sfwmass9 :direction [nx] :magnitude "(-f33/@e3)*(@e3*y*tq(sfwmass,2)/r+a*ru(sfwmass,2))+((f11/@e3)*(tu(sfwmass,2)+(r-y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(f12/@e3)*(ru(sfwmass,2)+@e3*y/r))*rq(sfwmass,2)")
(add-line-force su9y :point1 sfwmass9 :direction [ny] :magnitude "(-f33/@e3)*(@e3*y*tq(sfwmass,2)/r+a*ru(sfwmass,2))*rq(sfwmass,2)+((-f11/@e3)*(tu(sfwmass,2)+(r-y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(-f12/@e3)*(ru(sfwmass,2)+@e3*y/r))")
(add-line-force su9z :point1 sfwmass9 :direction [nz] :magnitude "((f11/@e3)*(tu(sfwmass,2)+(r-y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(f12/@e3)*(ru(sfwmass,2)+@e3*y/r))*(y-rq(sfwmass,1))")
(add-line-force su10x :point1 srwmass10 :direction [nx] :magnitude "(-f33/@e4)*(@e4*(-y*tq(srwmass,2))/r-a*ru(srwmass,2))+((f11/@e4)*(tu(srwmass,2)+(r+y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(f12/@e4)*(ru(srwmass,2)-@e4*y/r))*rq(srwmass,2)")
(add-line-force su10y :point1 srwmass10 :direction [ny] :magnitude "(-f33/@e4)*(@e4*(-y*tq(srwmass,2))/r-a*ru(srwmass,1))*rq(srwmass,2)+((-f11/@e4)*(tu(srwmass,2)+(r+y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(-f12/@e4)*(ru(srwmass,2)-@e4*y/r))")
(add-line-force su10z :point1 srwmass10 :direction [nz] :magnitude "((-f11/@e4)*(tu(srwmass,2)+(r+y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(-f12/@e4)*(ru(srwmass,2)-@e4*y/r))*(y+rq(srwmass,1))")
(add-line-force su11x :point1 srwmass11 :direction [nx] :magnitude "(-f33/@e4)*(@e4*y*tq(srwmass,2)/r+a*ru(srwmass,2))+((f11/@e4)*(tu(srwmass,2)+(r-y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(f12/@e4)*(ru(srwmass,2)+@e4*y/r))*rq(srwmass,2)")
(add-line-force su11y :point1 srwmass11 :direction [ny] :magnitude "(-f33/@e4)*(@e4*y*tq(srwmass,2)/r+a*ru(srwmass,2))* rq(srwmass,2)+((-f11/@e4)*(tu(srwmass,2)+(r-y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(-f12/@e4)*(ru(srwmass,2)+@e4*y/r))")
(add-line-force su11z :point1 srwmass11 :direction [nz] :magnitude "((f11/@e4)*(tu(srwmass,2)+(r-y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(f12/@e4)*(ru(srwmass,2)+@e4*y/r))* (y-rq(srwmass,1))")
(add-moment sT8x :body1 sfwmass :direction [nx] :magnitude "((f12/@e3)*(tu(sfwmass,2)+(r+y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(-f22/@e3)*(ru(sfwmass,2)-@e3*y/r))*rq(sfwmass,2)*(y+rq(sfwmass,1))")
(add-moment sT8z :body1 sfwmass :direction [nz] :magnitude "((f12/@e3)*(tu(sfwmass,2)+(r+y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(-f22/@e3)*(ru(sfwmass,2)-@e3*y/r))")
(add-moment sT9x :body1 sfwmass :direction [nx] :magnitude "((-f12/@e3)*(tu(sfwmass,2)+(r-y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+( f22/@e3)*(ru(sfwmass,2)+@e3*y/r))*rq(sfwmass,2)*(y-rq(sfwmass,1))")
(add-moment sT9z :body1 sfwmass :direction [nz] :magnitude "((f12/@e3)*(tu(sfwmass,2)+(r-y*tq(sfwmass,2))*ru(sfwmass,1)-@e3*rq(sfwmass,2))+(-f22/@e3)*(ru(sfwmass,2)+@e3*y/r))")
(add-moment sT10x :body1 srwmass :direction [nx] :magnitude "((f12/@e4)*(tu(srwmass,2)+(r+y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(-f22/@e4)*(ru(srwmass,2)-@e4*y/r))*rq(srwmass,2)*(y+rq(srwmass,1))")
(add-moment sT10z :body1 srwmass :direction [nz] :magnitude "((f12/@e4)*(tu(srwmass,2)+(r+y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(-f22/@e4)*(ru(srwmass,2)-@e4*y/r))")
(add-moment sT11x :body1 srwmass :direction [nx] :magnitude "((-f12/@e4)*(tu(srwmass,2)+(r-y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(f22/@e4)*(ru(srwmass,2)+@e4*y/r))*rq(srwmass,2)*(y-rq(srwmass,1))")
(add-moment sT11z :body1 srwmass :direction [nz] :magnitude "((f12/@e4)*(tu(srwmass,2)+(r-y*tq(srwmass,2))*ru(srwmass,1)-@e4*rq(srwmass,2))+(-f22/@e4)*(ru(srwmass,2)+@e4*y/r))")
(add-line-force sn8y :point1 sfwmass8 :direction [ny] :magnitude "-((mc+2*mb+4*mw)*g/8)*(y+rq(sfwmass,1))")
(add-line-force sn9y :point1 sfwmass9 :direction [ny] :magnitude "((mc+2*mb+4*mw)*g/8)*(y-rq(sfwmass,1))")
(add-line-force sn10y :point1 srwmass10 :direction [ny] :magnitude "-((mc+2*mb+4*mw)*g/8)*(y+rq(srwmass,1))")
(add-line-force sn11y :point1 srwmass11 :direction [ny] :magnitude "((mc+2*mb+4*mw)*g/8)*(y-rq(srwmass,1))")
(add-line-force sn8z :point1 sfwmass8 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-line-force sn9z :point1 sfwmass9 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-line-force sn10z :point1 srwmass10 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-line-force sn11z :point1 srwmass11 :direction [nz] :magnitude "-kzz*(x-x0)+((mc+2*mb+4*mw)*g/8)")
(add-moment sn2x :body1 sfwmass :direction [nx] :magnitude "(Iwy*@e3*ru(sfwmass,2)/r)")
(add-moment sn2z :body1 sfwmass :direction [nz] :magnitude "-Iwy*@e3*ru(sfwmass,1)/r")
(add-moment sn3x :body1 srwmass :direction [nx] :magnitude "(Iwy*@e4*ru(srwmass,2)/r)")
(add-moment sn3z :body1 srwmass :direction [nz] :magnitude "-Iwy*@e4*ru(srwmass,1)/r")
(install-table road "road pro(t vs. x)" :table-function tabf :npts 1000
:xunits T :yunits F :keyword road-pro
:values ((0 0) (0 100000) (0.001 100000) (0.001 0)))
(add-line-force Yinpt_fw8 :point1 fwmass8 :direction [ny] :magnitude "road(t,1,1)")
;;;add output
(add-out "dot([ny],pos(cmasscm))" "Carbody")
(add-out "dot([ny],pos(bmasscm))" "Bogie")
(add-out "dot([ny],pos(fwmasscm))" "Wheel")
(finish)
(set-defaults mc 8040 mb 350.26 mw 1117.9
Icx 28540 Icz 312367.4 Icy 86763.995
Ibx 300 Ibz 105.2 Iby 851.28
Iwx 608.1 Iwy 72 Iwz 608.1
B1 1 B2 1.29 B3 2.29
L1 0.9 L2 1.9 L3 3.29 L4 4.68 L5 5.68
h 0.47 hs 1.67 h1 1
a 0.7175 r 0.43 y 0.05
kpx 9e5 kpy 3.9e5 kpz 4.32e5
cpx 1e4 cpy 1e4 cpz 30000
ksx 4.5e4 ksy 4.5e4 ksz 4.5e5
csx 9e4 csy 1.8e3 csz 4000
f11 2.212e6 f12 3120 f22 16 f33 2.563e6 kzz 1e6 e 100/3.6 )
(write-to-file write-c "C:\\Dev-Cpp\\bin\\NONDOF37.c")