{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 225 " restart; with(plot s):\n Su := [Cx=0.64, r=0.1925, o=2.98, Xv=2., Yv=-0.2, alpha=1*pi/180 ,\n beta=35*pi/180, S=1.3, s[1]=0.1, s[2]=0.3, s[3]=1.085,\n \+ h=0.4, pi=evalf(Pi)];\n assign(Su);\n omega:=2*pi*o; v:=omega*r :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " L := [Cx, r*pi, Cx, r *pi];\n L := [seq(sum(L[i], i=1..j), j=1..4)];" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 37 " Tau := map(u->u/v,L);\n Tf := Tau[4]:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 328 " Gx[1] := v*t: Gy[1]:=r: \+ #motion to right\n Gx[2] := Cx+r*cos(pi/2-omega*(t-Ta u[1])):\n Gy[2] := r*sin(pi/2-omega*(t-Tau[1])): #right semicircle \n Gx[3] := Cx-v*(t-Tau[2]): Gy[3]:=-r: #motion to left\n Gx[4] \+ := r*cos(3/2*pi-omega*(t-Tau[3])):\n Gy[4] := r*sin(3/2*pi-omega*(t-Ta u[3])): #left semicircle" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 160 " Gx := piecewise(seq([t<=Tau[j], Gx[j]][],j=1..4),\n subs( t=t-Tf,Gx[1]));\n Gy := piecewise(seq([t<=Tau[j], Gy[j]][], j=1..4),\n subs(t=t-Tf,Gy[1]));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 85 " AP[1] := plot([Gx, Gy, t=0..Tf], scaling=constrained, labels=[ \"x [m]\", \"y [m]\"]): %;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 205 " Line := y=k*x+q; # line - general equation\n L1 := subs(K=tan(al pha),\n [k=K, q=solve(subs(x=Xv, y=Yv, k=K, Line), q)]);\n L2 := subs(K=tan(beta),\n [k=K, q=solve(subs(x=Xv, y=Yv, k=K,Line), q )]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 " e := (Gx-Xv)^2+(Gy -Yv)^2-S^2:\n AP[2] := plot(e, t=0..Tf, labels=[\"t [s]\",\"[m^2]\"]): %;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " tau := [fsolve(e, t =0.2..0.3), fsolve(e, t=0.3..0.4)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 " eK := (X-x)^2+(Y-y)^2 = S^2:\n sol := [allvalues(sol ve(\{eK, Line\}, \{x, y\}))]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 " solf := evalf(subs(X=Gx, Y=Gy, L2, t=(Tau[1]+Tau[2])*0.5, sol)) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 " solf := map(u -> eval b(subs(u, x-Xv) > 0), solf);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 " sol := normal(zip((u, v) -> `if`(u, v, NULL), solf, sol)[]);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 349 " Hx := subs(X=X(t), Y=Y(t ), piecewise(t " 0 "" {MPLTEXT 1 0 249 " DSu := [X(t)='Gx', diff(X(t), t)= Gxt, diff(X(t), t, t)=Gxtt,\n Y(t)='Gy', diff(Y(t), t)=Gyt, di ff(Y(t), t, t)=Gytt];\n dsu := [x(t)='Hx', diff(x(t), t)=Hxt, diff(x(t ), t, t)=Hxtt,\n y(t)='Hy', diff(y(t), t)=Hyt, diff(y(t), t, t )=Hytt];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 239 " Gxt := diff(G x, t): Hxt := subs(DSu, diff(Hx, t)):\n Gxtt := diff(Gx, t, t): \+ Hxtt := subs(DSu, diff(Hx, t, t)):\n Gyt := diff(Gy,t): Hyt : = subs(DSu, diff(Hy, t)):\n Gytt := diff(Gy, t, t): Hytt := subs(DSu , diff(Hy, t, t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 153 " Opt :=color=black,thickness=3,linestyle=1:\n PL1 := plot([Hxt, Hyt], t=0.. Tf, Opt):\n PL2 := plot([Hxtt, Hytt], t=0..Tf, Opt):\n save PL1, PL2, \+ \"plots.sav\":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 387 " Ex := ( x(t)-X(t))/S: Ey := (y(t)-Y(t))/S;\n for j from 1 to 3 do;\n Px[j] \+ := X(t)+Ex*s[j]+Ey*h; Py[j] := Y(t)+Ey*s[j]-Ex*h;\n Vx[j] := dif f(Px[j],t); Vy[j] := diff(Py[j],t);\n Ax[j] := diff(Vx[j],t) ; Ay[j] := diff(Vy[j],t);\n V[j] := sqrt(Vx[j]^2+Vy[j]^2); A [j] := sqrt(Ax[j]^2+Ay[j]^2);\n At[j] := diff(V[j],t); An[j ] := sqrt(A[j]^2-At[j]^2);\n end do:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1370 " PlotOpt := color=[black, black, black, grey, grey, grey],\n thickness=[3, 2, 1, 3, 2, 1]:\n AP[4] := plot(subs( dsu, DSu, [seq([Px[j], Vx[j], t=0..Tf],\n j=1..3), seq([Py[j] , Vy[j], t=0..Tf], j=1..3)]),\n PlotOpt, labels=[\"x,y [m]\", \"Vx,Vy [m/s]\"]): %;\n AP[5] := plot(subs(dsu, DSu, [seq([Px[j], Ax[ j], t=0..Tf],\n j=1..3), seq([Py[j], Ay[j], t=0..Tf], j=1..3) ]),\n PlotOpt, labels=[\"x,y [m]\", \"Ax,Ay [m/s^2]\"]): %;\n AP[6] := plot(subs(dsu, DSu, [seq([Vx[j], Ax[j], t=0..Tf],\n \+ j=1..3), seq([Vy[j], Ay[j], t=0..Tf], j=1..3)]),\n PlotOpt, \+ labels=[\"Vx,Vy [m/s]\", \"Ax,Ay [m/s^2]\"]): %;\n AP[7] := plot(subs( dsu, DSu, [seq(Px[j], j=1..3), seq(Py[j],\n j=1..3)]), t=0..T f, PlotOpt,\n labels=[\"t [s]\", \"x,y [m]\"]): %;\n AP[8] := plot(subs(dsu, DSu, [seq(Vx[j], j=1..3),\n seq(Vy[j], j=1..3 )]), t=0..Tf, PlotOpt,\n labels=[\"t [s]\", \"Vx,Vy [m/s]\"]) : %;\n AP[9] := plot(subs(dsu, DSu, [seq(Ax[j], j=1..3),\n se q(Ay[j], j=1..3)]), t=0..Tf, PlotOpt,\n labels=[\"t [s]\", \" Ax,Ay [m/s^2]\"]): %;\n AP[10] := plot(subs(dsu, DSu, [seq(At[j], j=1. .3),\n seq(An[j], j=1..3)]), t=0..Tf, PlotOpt,\n lab els=[\"t [s]\", \"At,An [m/s^2]\"]): %;\n AP[11] := plot(subs(dsu, DSu , [seq([V[j], A[j], t=0..Tf],\n j=1..3)]), PlotOpt, labels=[ \"|V| [m/s]\",\n \"|A| [m/s^2]\"]): %;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 598 " A1 := display([seq(plot(subs(dsu, DSu, t=tt, \{[[Gx,Gy], [Hx,Hy]],\n seq([[Px[j], Py[j]], [Px[j]-Ey*h, Py[j] +Ex*h]], j=1..3)\}),\n color=brown), tt=[seq(Tf*i/200, i=0..200) ])],\n insequence=true,thickness=3,scaling=constrained):\n A2 := display([seq(plot(subs(dsu, DSu, [seq([Px[j], Py[j],\n t=0..Tf* i/200], j=1..3)]), color=[black, blue, red]),\n i=1..200)], inse quence=true, thickness=3,\n scaling=constrained):\n A3 := plot(s ubs(dsu, DSu, \{[Gx, Gy, t=0..Tf], [Hx, Hy,\n t=0..Tf]\}), scali ng=constrained, color=grey, thickness=3):\n AT := display(\{A1, A2, A3 \}):\n AT;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 136 " plotsetup(g if, plotoutput=`animation.gif`,\n plotoptions=`portrait, noborder, h eight=600,\n width=800, colors=16`);\n AT;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 193 " save Gx, Gy, Gxt, Gyt, Gxtt, Gytt , Tf, v, \"drive.sav\":\n for j from 1 to 11 do;\n plotsetup(ps, p lotoutput=cat(ap, j, `.ps`),\n plotoptions=`landscape, noborder `);\n AP[j];\n end do;" }}}{EXCHG }}{MARK "21 0 0" 193 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }