{VERSION 2 3 "IBM INTEL NT" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Fo nt 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 255 0 0 1 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "contact.ms" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 274 "A program to illust rate use of Heaviside functions to model contact between bodies with a spring. The spring is attached to the first body, which is moving. Th e first body strikes the second body, which is at rest. Motions of the bodies are then found as a function of time." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 92 "x1 refers to the body whi ch is moving initially. x2 refers to the initially stationary body" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "re start;with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "d:=-x 2(t)+x1(t)+x0; # spring compression" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "eq1:=-k*d*Heaviside(d) = m1*diff(x1(t),t,t);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "eq2:=+k*(d)*Heaviside(d) = m 2*diff(x2(t),t,t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "value s:=\{m1=1,m2=1,k=10,x0=1/2\};" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "eqs:=subs(values,eq1),subs(values,eq2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "s:=dsolve(\{eqs,x1(0)=0,D(x1)(0)=5,x2(0)=1,D(x2) (0)=0\},\{x1(t),x2(t)\},numeric);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "h:=odeplot(s,[t,x1(t)],0..1,color=red):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "j:=odeplot(s,[t,x2(t)],0..1,color=b lue):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "display(\{h,j\},ti tle=`x1(t)[red], x2(t)[blue] vs t`);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 6 0" 20 }{VIEWOPTS 1 1 0 1 1 1803 }