Application Center - Maplesoft

App Preview:

Universal method of kinematic analysis of spatial and planar link mechanisms

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application




 

restart; with(LinearAlgebra); with(plots); r := 3; h := 0.25e-1; N := 120; smin := 0; smax := (2*3.05)*r; f1 := x1^2+(x2+1)^2+(x3-.5)^2-r^2; f2 := x1-.5*x2+.5*x3; f3 := (x1-x4)^2+(x2-x5)^2+(x3-x6)^2-19; f4 := sin(x4)-x5; f5 := sin(2*x4)-x6; x01 := 1.18325; x02 := 1.18325; x03 := -1.18325; x04 := -2.07809; x05 := -.87406; x06 := .84926; n := 5; x := cat(x, 1 .. n+1); x0 := cat(x0, 1 .. n+1); F := [seq(unapply(eval(cat('f', i)), [x]), i = 1 .. n)]; A := MTM:-jacobian(F(x), [x]); A := MTM:-subs(A, [x], [x(t)]); for i to n do b[i] := simplify(Determinant(DeleteColumn(ColumnOperation(A, [i, n+1]), n+1))) end do; b[n+1] := simplify(-Determinant(DeleteColumn(A, n+1))); deqs := seq(diff(x[i](t), t) = b[i]/(b[1]^2+b[2]^2+b[3]^2)^.5, i = 1 .. n+1); ics := seq(x[i](0) = x0[i], i = 1 .. n+1); sln := dsolve([deqs, ics], numeric, method = rkf45, abserr = (1/100)*h, maxfun = 10000, range = smin .. smax); a1 := sln(smin+smax*nn/N)[2]; a2 := sln(smin+smax*nn/N)[3]; a3 := sln(smin+smax*nn/N)[4]; a4 := sln(smin+smax*nn/N)[5]; a5 := sln(smin+smax*nn/N)[6]; a6 := sln(smin+smax*nn/N)[7]; AB := seq(plottools[line]([rhs(a1), rhs(a2), rhs(a3)], [rhs(a4), rhs(a5), rhs(a6)], color = black, thickness = 2), nn = 0 .. N); AO := seq(plottools[line]([rhs(a1), rhs(a2), rhs(a3)], [-.5, -.75, .25], color = black, thickness = 2), nn = 0 .. N); LL := seq(pointplot3d([rhs(a1), rhs(a2), rhs(a3)], symbolsize = 16, symbol = solidsphere, color = green), nn = 0 .. N); LLL := seq(pointplot3d([rhs(a4), rhs(a5), rhs(a6)], symbolsize = 16, symbol = solidsphere, color = red), nn = 0 .. N); P := pointplot3d([-.5, -.75, .25], symbolsize = 12, symbol = solidsphere, color = blue); B := `~`[rhs](Matrix(`~`[sln]([seq(i, i = smin .. smax+20*h, h)]))[() .. (), 1 .. n+2]); m := ArrayNumElems(B[() .. (), 1]); m; k := 1; for j to n+1 do L[j] := B[() .. (), k+j] end do; S := [seq(seq(L[j][i], j = 1 .. 3), i = 1 .. m)]; SS := [seq(seq(L[j][i], j = 4 .. 6), i = 1 .. m)]; FACE := plottools[polygon]([seq([L[1][i], L[2][i], L[3][i]], i = 1 .. m)], color = RGB(12, .1, 5), transparency = .7, style = patchnogrid); MS := pointplot3d(S, color = blue, style = line, thickness = 2, axes = normal, labels = ["x1", " x2", " x3"]); MSS := pointplot3d(SS, color = RGB(.5, .1, .21), style = line, thickness = 1); E := seq(display(MSS, MS, AB[k], AO[k], P, FACE, LL[k], LLL[k]), k = 1 .. N); display(E, insequence = true, view = [-6 .. 2, -4 .. 4, -4 .. 4], axes = normal)

1.18325

1.18325

-1.18325

-2.07809

-.87406

.84926

753

753

 

``

``

``