1.7 - slider crank 2.mws

by Roberto Lot
Pasquale de Luca - date 20/04/04

[Maple OLE 2.0 Object]        [Maple Plot]

> restart: mylib :="LIBS": libname := mylib,libname: with(MBsymba):

Vector loop

definition of the vectors

> AC := make_VECTOR(ground,a4,0,0): show(AC);

> AB := make_VECTOR(rotate('Z',theta),a1,0,0): show(AB);

> CB := make_VECTOR(rotate('Z',q),r,0,0): show(CB);

AC = VECTOR(comps = matrix([[a4], [0], [0], [0]]),f...

AB = VECTOR(comps = matrix([[a1], [0], [0], [0]]),f...

CB = VECTOR(comps = matrix([[r], [0], [0], [0]]),fr...

closing the vector loop: definition of a closure vector

> closure := AC + CB - AB: show(closure);

closure = VECTOR(comps = matrix([[-cos(theta)*a1+co...

this expression must be null

> {Xcomp(closure) , Ycomp(closure)};

we find the solution with respect to the variables a1 and theta which depend on the generalized coordinate q (rotation of the crank)

> solution := solve(%,{theta, a1}):

{-sin(theta)*a1+sin(q)*r, -cos(theta)*a1+cos(q)*r+a...

we extract the solutions

> eval([theta, a1], solution):

> theta := %[1];

> a1 := %%[2];

theta := arctan(sin(q)*r/RootOf(-2*cos(q)*r*a4-a4^2...

a1 := RootOf(-2*cos(q)*r*a4-a4^2+_Z^2-r^2)

Numerical Solution

numerical solution for specified crank and rod lengths:
frame a4 = 0.4 m
crank length r = 0.1 m
rod length l = 0.6 m

> dataset := [a4=0.4, r=0.1, l=0.6];

dataset := [a4 = .4, r = .1, l = .6]

> theta := subs(dataset, theta);

> a1 := subs(dataset,a1);

> a4 := subs(dataset,a4);

> l := subs(dataset,l);

theta := arctan(.1*sin(q)/RootOf(-.8e-1*cos(q)-.17+...

a1 := RootOf(-.8e-1*cos(q)-.17+_Z^2)

a4 := .4

l := .6

Plot of the mechanism

> A := origin(ground): #show(A);

> B := A + AB: show(B): show(B);

> C := A + AC: show(C): show(C);

B = POINT(frame = matrix([[1, 0, 0, 0], [0, 1, 0, 0...

C = POINT(frame = matrix([[1, 0, 0, 0], [0, 1, 0, 0...

> plot(theta, q=0..2*Pi, labels=[q, "theta"], title="theta vs. q");

> plot(a1, q=0..2*Pi, labels=[q, "a1"], title="location of the slider on the rod vs. q");

[Maple Plot]

[Maple Plot]

Animation of the Mechanism

Substitute in values for problem

> q:=2*Pi*t;

q := 2*Pi*t

> with(plots):
with(plottools):

Warning, the name changecoords has been redefined

Warning, the name arrow has been redefined

Warning, the previous bindings of the names project rotate, and translate have been removed and they now have an assigned value

Generate frames for the animation

> for t from 0 to 29/30 by 1/30 do

crank CB
crank || (30*t) := plot(
{[ [Xcomp(C)+0.01*cos(2*Pi*t),Ycomp(C)+0.01*sin(2*Pi*t)],
[Xcomp(B),Ycomp(B)] ]}, color=black, thickness=3
):

rod AD
rod || (30*t) := plot(
{[ [Xcomp(A)+0.01*cos(theta),Ycomp(A)+0.01*sin(theta)],
[l*cos(theta), l*sin(theta)] ]}, color=blue, thickness=3
):


pin joints
in A:

revj_A || (30*t) := disk(
[Xcomp(A),Ycomp(A)], 0.01, color=yellow
);
in B:
revj_B || (30*t) := disk(
[Xcomp(B),Ycomp(B)], 0.01, color=grey
);

in C:
revj_C || (30*t) := disk(
[Xcomp(C),Ycomp(C)], 0.01, color=yellow
);

total
total || (30*t) := display (
{crank || (30*t), rod || (30*t), revj_A || (30*t), revj_B || (30*t), revj_C || (30*t)}
);
od:
t:='t';

t := 't'

Display the animation.

> display([total || (0..29)], insequence=true, scaling=constrained);

[Maple Plot]