3-Solve SliderCrank2 - NumIssues - FourBarLinkage
3-Solve SliderCrank2 - NumIssues - FourBarLinkage
Summary
Slider-crank
from last lesson
First_Kinematic
_Analysis.m
Acceleration
_Analysis.m
driver at Crank
SliderCrank
example
driver at Crank
Did you get the same plots?
See pp.28 Chapter1 (Ambrósio)
Change to be
driven by the
slider
l3 – l30 (1+0.25 cos(w t))
The velocity equations are obtained by differentiating
the position constraint equations with respect to time,
Change to be
driven by the
slider
l3 – l30 (1+0.25 cos(w t))
SliderCrankSimple.m → script to generate the SliderCrankSimple.mat
clear all %... Time analysis parameters
%... Model & simulation scenario filename Time.start = 0.0;
filename = 'SliderCrankSimple2.mat'; Time.end = 2.0;
%... Model dimensions Time.step = 0.01;
Model.l1 = 0.3; %... Analysis parameters
Model.l2 = 0.5; Parameter.NLTolerance = 0.0000001;
%... Driver characteristics Parameter.NLMaxIter = 12;
Model.l3init = 0.5; %... Initial positions (estimate)
Model.angvelocity = 2*pi; theta1 = 45*(pi/180);
Model.NCoordinates = 3; theta2 = 330*(pi/180);
%... Function for equations evaluations l3 = 0.7;
Model.Function = @Slider_Crank_Simple2; %... Initial coordinates vector
q0 = [theta1; theta2; l3];
%... Save the data in 'mat' file
save(filename);
Mechanical Engineering Department – Instituto Superior Técnico #8
Dynamics of Mechanical Systems 2024/25
Slider-crank
Change to be
driven by the
slider First_Kinematic_Analysis.m
clear all
close all %
clc load(filename);
% CPUStart = cputime;
% First kinematic analysis program %
% %% ... Perform the kinematic analysis
% (…) [t, q, qd, qdd] = First_Kinematic_Analysis(q0);
%% %(…)
%... Access global memory
global Model Parameter Time
%
%... Read (load) the model input data and analysis profile
%filename = 'SliderCrankSimple.mat';
filename = 'SliderCrankSimple2.mat'; % driven by slider
%filename = 'FourBarLinkageSimple.mat'; % Four-Bar-Linkage Simple
%filename = 'Four_Leafed_Curve.mat';
Slider_Crank_Simple2.m
Slider-crank
% …. %%
Change to be %... Transfer coordinates from global to local storage %... Evaluate vector with r.h.s. of velocity equations
driven by the o1 = q(1); o2 = q(2); l3 = q(3); if Flag.Velocity == 1
slider l1 = Model.l1; l2 = Model.l2; niu = [0.0;
%... Evaluate the position constraint vector Phi(q,t) 0.0;
if Flag.Position == 1 -0.25*Model.l3init*
phi = [ l1*cos(o1)+l2*cos(o2)-l3; sin(Model.angvelocity*time)*Model.angvelocity];
l1*sin(o1)+l2*sin(o2); end
l3-(Model.l3init+ %%
0.25*Model.l3init*cos(Model.angvelocity*time))]; %... Evaluate vector with r.h.s. of acceleration equations
end if Flag.Acceleration == 1
%... Evaluate the constraints Jacobian matrix Phi(q,t) o1d = qd(1); o2d = qd(2); l3d = qd(3);
if Flag.Jacobian == 1 gamma = [l1*cos(o1)*o1d^2+l2*cos(o2)*o2d^2;
Jac = [-l1*sin(o1) -l2*sin(o2) -1; l1*sin(o1)*o1d^2+l2*sin(o2)*o2d^2;
l1*cos(o1) l2*cos(o2) 0; -0.25*Model.l3init*
0 0 1]; cos(Model.angvelocity*time)*Model.angvelocity^2];
end end
%... Finalize function Slider_Crank_Simple
end
First_Kinematic
_Analysis.m
Acceleration
_Analysis.m
SliderCrank
example
driver at Crank
Did you get the same plots?
1. Unfeasible It may simply happen that the mechanical system cannot achieve a particular configuration required
solutions by its driver at a particular time.
The smallest gap is still a solution of
the optimal problem, although it is
not a physically feasible solution (not
a ‘zero’ of the nonlinear equations)
Observing the sequence of configurations, it is clear that when the crank angle is in between the
interrupted line in Figure 1.62(a) where theta is unfeasible, i.e. it is impossible to connect the
coupler to the follower link.
In an optimization problem configurations such as the one having a gap in Figure 1.62(a) are still
accepted as a valid solution.
Mechanical Engineering Department – Instituto Superior Técnico #13
Dynamics of Mechanical Systems 2024/25
1.9 PHYSICAL MEANING OF SELECTED NUMERICAL ISSUES
The solution of nonlinear equations may fail due to a null determinant of the Jacobian matrix. The
most common reason is that some position constraint equations become redundant, leading to a
1.9 PHYSICAL rank deficient system.
MEANING OF
SELECTED The two independent vector loops that span all links in the mechanical system result in 4 algebraic
NUMERICAL equations. The four angles of the moving links are the 4 coordinates of the system, which would
ISSUES mean that no dof exist.
2. Rank-deficient
Jacobian Matrix
But the system still has one dof, which implies that one of the algebraic constraints is redundant
and, consequently, that the Jacobian matrix is rank-deficient.
In a complex multibody system, the identification of potential redundant constraints may be less
obvious and also the redundancy may occur only for particular configurations and not for others.
A rank-deficient Jacobian matrix →failure of the solution of the position constraint equations by
numerical methods that require the Jacobian matrix of the constraint equations
2. Rank-deficient
Jacobian Matrix
The position constraint equations are nonlinear equation that may have multiple solutions.
At a particular instant, it is expected to converge to the closest configuration that is being
attempted. Nevertheless, this is not always the case and, in more complex mechanisms, an
alternative configuration may be obtained.
A case in which, starting from the same configuration, an increment of the crank angle may lead to
two completely different configurations of the mechanical system, but both fulfilling the position
constraint equations (during the iterative process of the nonlinear equation solver, only one of them
is identified).
Mechanical Engineering Department – Instituto Superior Técnico #15
Dynamics of Mechanical Systems 2024/25
1.9 PHYSICAL MEANING OF SELECTED NUMERICAL ISSUES
1.9 PHYSICAL • Other physical configurations may also lead to rank-deficient or ill-conditioned Jacobian matrices
MEANING OF even when position constraint equations are not redundant.
SELECTED
NUMERICAL • When the slope of the equation is null, it is the equivalent of having the Jacobian matrix of the
ISSUES system of nonlinear equations with null determinant and the complete solution process fails.
The error is reported as a rank-deficient Jacobian matrix.
3. Rank-deficient
or ill-conditioned
Jacobian
matrices
In simple mechanisms it is, generally, rather obvious the physical reasons for the failure of the
numerical methods. In more complex mechanical systems may not be simple.
Note that solutions of kinematic problems should always be closely monitored, at least to monitor
that among the possible solutions the one being computed is the one required.
Example: 1.8.1 Four-bar Linkage Mechanism If you have time, implement this one.
Coordinates
Four-bar
Linkage The position constraint equations are:
Mechanism
𝑙1 cos 𝜃1 + 𝑙2 cos 𝜃2 − 𝑙3 cos 𝜃3 + 𝑎
𝚽 𝐪, 𝑡 = 𝑙1 sin 𝜃1 + 𝑙2 sin 𝜃2 − 𝑙3 sin 𝜃3 + 𝑏 = 𝟎
𝜃1 − 𝜃10 + 𝜔𝑡
Example: 1.8.1 Four-bar Linkage Mechanism If you have time, implement this one.
Four-bar
Linkage
Mechanism
θ2
Four Leaf
Link CB has fixed length
Mechanism
Velocity equations
notice
2 = 1 + / 2 and 2 = 1
velocity equations
Six
BarMechanism
Geometric relations
6 = 1 + 270º
7 = 5 − 25º
XY decomposition
l AB cos 2 + lBC cos 6 + lCG cos 5 + lGD cos 7 − a = 0
l AB sin 2 + lBC sin 6 + lCG sin 5 + lGD sin 7 = 0
lCE cos 1 + lEF cos 3 + lFG cos 4 − lCG cos 5 = 0
Six
BarMechanism lCE sin 1 + lEF sin 3 + lFG sin 4 − lCG sin 5 = 0
Φ = 0 Φq q = ν
Jacobian matrix
−lBC sin 6 −l AB sin 2 0 0 − ( lGD sin 7 + lCG sin 5 ) 0
lBC cos 6 l AB cos 2 0 0 ( lCG cos 5 + lGD cos 7 ) 0
Φq = −lCE sin 1 0 −lEF sin 3 −lFG sin 4 lCG sin 5 ν = 0
0
lCE cos 1 0 lEF cos 3 lFG cos 4 −lCG cos 5
1 0 0 0 0
Vector coordinates −l AB sin 2 2 − lBC sin 6 6 − lCG sin 5 5 − lGD sin 7 7 0
qT = 1 2 3 4 5
T
l AB cos 2 2 + lBC cos 6 6 + lCG cos 5 5 + lGD cos 7 7 0
Φ = −lCE sin 1 1 − lEF sin 3 3 − lFG sin 4 4 + lCG sin 5 5 = 0
l cos + l cos + l cos − l cos 0
CE 1 1 EF 3 3 FG 4 4 CG 5 5
1 − 0
0
Six
BarMechanism
SLIDER-CRANK
BLADE
MECHANISM OF
A TRIMMING
MACHINE
SLIDER-CRANK
BLADE Vector loop-closure
MECHANISM OF
A TRIMMING l AB + lBC + lCD + lDA = 0 ( yellow)
MACHINE
lEF + lFK + lKD + lDH + lHE = 0 ( green)
lGM + lMA + l AH + lHE + lEF + lFG = 0 (blue)
Geometric relations
8 = 43.2 + 180 = 223.2
Vector coordinates 9 = 270.9
10 = 63.7
qT = 1 lGM
T
2 3 4 5 7
11 = 155.8 + 180 = 335.8
13 = 110 + 180 = 290
14 = 4 − 2.6
3 = 6 + 40º 6 = 3 − 40º
lFK
lKD
SLIDER-CRANK 3 lCD 5
6
BLADE
MECHANISM OF
13 = 290
A TRIMMING lBC 9 = 270.9 4 lDH
MACHINE lEF
7
2 lDA lHE
1
l AB
MACHINE lGM sin 8 + lMA sin 11 + l AH sin 10 + lHE sin 7 + lEF sin 4 + lFG sin 14
(
1 − 1 + t
0
)
l AB cos 1 + lBC cos 2 + lCD cos 3
l AB sin 1 + lBC sin 2 + lCD sin 5 + lDA
lEF cos 4 + lFK cos 5 + lKD cos ( 3 − 40 ) + lDH cos (110 ) + lHE cos 7
= lEF sin 4 + lFK sin 5 + lKD sin ( 3 − 40 ) + lDH sin (110 ) + lHE sin 7
lGM cos ( 223.2 ) + lMA cos ( 335.8 ) + l AH cos ( 63.7 ) + lHE cos 7 + lEF cos 4 + lFG cos ( 4 − 2.6 )
l sin ( 223.2 ) + l sin ( 335.8 ) + l sin ( 63.7 ) + l sin + l sin + l sin ( − 2.6 )
GM MA AH HE 7 EF 4 FG 4
1 (
− 0 + t
1 )
SLIDER-CRANK
BLADE
MECHANISM OF
A TRIMMING
MACHINE
Velocity Equations
SLIDER-CRANK
BLADE
MECHANISM OF
A TRIMMING
MACHINE
Jacobian matrix
Model Parameters
l AB 8.7
l
BC 88.58
10 lCD 18.58
0 137.8º
2 97.4º lDA 85.12
0 lEF 39.33
3 152.6º +180
0 lFK 55.20
4 = 177.2º =
0 53.3º lKD 36.32
5 lDH 53.41
0 125.2
7 lHE 45.71
lGM 0 30.9 l 143.44
MA
l AH 39.11
60.26
lFG
SLIDER-CRANK
BLADE
MECHANISM OF
A TRIMMING
MACHINE
velocity equations
The lengths of the elements in the mechanism follow the relations AB=CB=BM=1; CE=1.11;
MD=0.403; FD=0.12; and CF=2.05.
Point M of rod 2 of the four-bar EABC describes curve a-a, partially close to an arc of a circle
(thick solid line in the drawing) with radius DM centered at point D. At the time point M goes
over a-a, element 4 (manufactured as a wheel) stays quasi-static. Points F, D and M are collinear
on one of the extreme positions. From this position, the wheel 4 can rotate fast on the
clockwise or counterclockwise directions. So, when the crank makes one complete turn, the
wheel 4 can make a large turn in the same direction with one stop, or one turn in the opposite
direction without stopping.
Required: Trace the trajectory of point M
velocity equations
The lengths of the elements in the four-bar mechanism ACBE follow the relations
CB=BE=BD=2.5 AC; AE=2 AC.
When element 1 rotates around fixed point A, point D of element 2 describes the path q-q.
When point C follows the arc a-d-b, point D runs on segment a1 – d1 – b1, close to a straight
line.
Required: Trace the trajectory of point D
velocity equations
The lengths of the elements in the four-bar mechanism ABCD follow the relations
BC=DC=CE=2.17 AB; AD=2.83 AB.
When point B of element 1, which turns around fixed point A, passes over the arc abc, point E
of element 2 describes path q-q, where segments a1b1 and b1c1 are close to straight lines p-p
and t-t, perpendicular to each other.
Required: Trace the trajectory of point D
velocity equations
The lengths of the elements in the four-bar mechanism ABCD follow the relations
BC=DC=CM=3.12 AB; AD=2.94 AB and β=120°.
When element 1 turns around fixed point A, point M of element 2 describes a path q-q which is
close to a circle of radius R1 or R0, where ΔR= R0 - R1 is a small quantity.
Required: Trace the trajectory of point M