> restart: mylib :="C:/LIBS": libname := mylib,libname: with(MBSymba_r5.1):
MBSymba release 5.1 - Copyright (C) 2009 - by Roberto.Lot@unipd.it & Matteo.Massaro@unipd.it
Warning, Non-Linear Modeling option has been choosen
points definition
> A := make_POINT(ground,0,0,0): show(A); frame pin joint
> B := make_POINT(ground,xB,yB,0): show(B);
> xC := d; constan value
C := make_POINT(ground,xC,yC,0): show(C); slider
> P := make_POINT(ground,xP,yP,0): show(P);
variables
> q := { xB,yB,yC,xP,yP }; nq := nops(q);
Since the single-degree-of-freedom mechanism is described by means of 5 variables,
4 constraint equations must be written. All they correspond to the lenght of constant segments
> AB := make_VECTOR(A,B): phi[1] := dot_prod(AB,AB)-lAB^2;
> BC := make_VECTOR(B,C): phi[2] := dot_prod(BC,BC)-lBC^2;
> AP := make_VECTOR(A,P): phi[3] := dot_prod(AP,AP)-lAP^2;
> BP := make_VECTOR(B,P): phi[4] := dot_prod(BP,BP)-lBP^2;
> phi:=convert(phi,list):
Numerical solution (Newton-Rapson algorithm)
mechanims characteristics
> geometric_data := lAB=0.230, lBP=0.450, lBC=0.250+.15, lAP=0.650, d=0.27;
numerical equations
> eqns := convert(subs(geometric_data,phi),set);
definition of the independent variable and unknowns variables
> yP;
unks := q minus {%};
numerical solution
> np:=9: solz:=array[np]:
for i from 1 to np do
x := 0.5-0.2*(i-1)/(np-1):
solz[i] := {yP=x, d=subs(geometric_data,d) } union
fsolve(subs(yP=x,eqns),unks, {xP=0..1, yC=-1..0.1, xB=0..0.15})
end do:
tabbed results
> printf(" | xP yP | xB yB | xC yC |");
for i from 1 to np do
printf("%2.0f | %+06.3f %+06.3f | %+06.3f %+06.3f | %+06.3f %+06.3f |",
i ,op( subs(solz[i],geometric_data, [xP,yP,xB,yB,d,yC])));
writeline(default):
end do:
| xP yP | xB yB | xC yC |
1 | +0.415 +0.500 | +0.062 +0.222 | +0.270 -0.120 |
2 | +0.444 +0.475 | +0.075 +0.218 | +0.270 -0.131 |
3 | +0.469 +0.450 | +0.086 +0.213 | +0.270 -0.142 |
4 | +0.492 +0.425 | +0.097 +0.208 | +0.270 -0.152 |
5 | +0.512 +0.400 | +0.108 +0.203 | +0.270 -0.162 |
6 | +0.531 +0.375 | +0.117 +0.198 | +0.270 -0.172 |
7 | +0.548 +0.350 | +0.126 +0.192 | +0.270 -0.181 |
8 | +0.563 +0.325 | +0.135 +0.186 | +0.270 -0.190 |
9 | +0.577 +0.300 | +0.143 +0.180 | +0.270 -0.199 |
mechanism drawing
> with(plots): with(plottools):
> draw_mechanism := proc(q)
local revj_A,revj_B,revj_C, mech,lever,rod,blade,guide:
revj_A := disk([ 0, 0], 0.02, color=yellow);
revj_B := disk(subs(q,[xB,yB]), 0.02, color=yellow);
revj_C := disk(subs(q,[xC,yC]), 0.02, color=yellow);
lever := polygon(subs(q,[[0,0],[xB,yB],[xP,yP]]), color=green, thickness=1);
rod := line( subs(q,[xB,yB]),subs(q,[xC,yC]), color=black, thickness=5);
blade := polygon(subs(q,[[xC+0.03,yC+0.03],[xC-0.03,yC+0.03],[xC-0.03,yC-0.05],[xC+0.03,yC-0.13]]), color=blue, thickness=1);
guide := rectangle( subs(q,[xC+0.03, 0]), subs(q,[xC+0.13, -0.4]), color=grey ):
mech := rod,guide,revj_A,revj_B,revj_C,blade,lever;
end:
display a single configuration
> #display(draw_mechanism(solz[1]), scaling=constrained);
animation
> display([seq(display(draw_mechanism(solz[i])),i=1..np)], insequence=true, scaling=constrained);
>