
Vpasolve not working with a set of equations for bar linkage
8 views (last 30 days)
Show older comments
Hello,
I am trying to model steering response of the right axle of a car when I move the left axle. See the following crude image of my bar linkage:

P1 and P6 are fixed points, P3 and P4 each have fixed y values (P1y - 0). The orange letters correspond to linkage/constraint lengths. I want to provide the angle at P1 to P2 which at the moment is represented as 90, and the get the angle at P6 which is represented at 90 as well.
I am using Vpasolve to no avail! I tried using euler's formula for this as well with no luck. I keep getting no answer! I've tried as much as I can but I have no other ideas. Does anyone know how I can solve for th5? Knowing the x and y for each point would be nice as well and I'm trying to solve it all.
Thank you so much in advance.
close all;clear;clc
b=17.625;
a=14;
p=1.75; %Pivot length
l=23.25;
d=(b-a)/2;%Stub axle length
r=16; %rack length
o=0.255; %rack offset
%exp(i*th)
%body points
blc=-a/2; %bottom left corner
brc=a/2;
tlc=blc+1i*l;
trc=brc+1i*l;
Body=[blc,brc,trc,tlc];
%Axle points
bla=blc-d; %Bottom left axle
bra=brc+d;
tla=tlc-d;
tra=trc+d;
%% Linkage Math
%Set up cartesian coordinates
p1x=real(tla);p1y=imag(tla);
p6x=real(tra);p6y=imag(tra);
%% Short Link, s
%Setting point 2
p2x=p1x+p*cosd(270);
p2y=p1y+p*sind(270);
p5x=p6x+p*cosd(270);
p5y=p6y+p*sind(270);
%Constants
p3y=(l-o);p3x=-r/2;
p4y=(l-o);p4x=r/2;
s=sqrt((p3x-p2x)^2+(p3y-p2y)^2);
%% Full Link Math
%Setting point 2
th1=270;
p2x=p1x+p*cosd(th1);
p2y=p1y+p*sind(th1);
p3y=(l-o);
p4y=(l-o);
syms th2 th4 th5 p3x p4x p5x p5y
eq1=p3x==p2x+s*cosd(th2);
eq2=p3y==p2y+s*sind(th2);
eq3=p4x==p3x+r;
% eq=p4y==p3y;
eq4=p5x==p4x+s*cosd(th4);
eq5=p5y==p4y+s*sind(th4);
eq6=p6x==p5x+p*cosd(th5);
eq7=p6y==p5y+p*sind(th5);
Solved=vpasolve([eq1,eq2,eq3,eq4,eq5,eq6],[th2 th4 th5 p3x p4x p5x p5y],[70,310,90,0,0,0,0])
0 Comments
Accepted Answer
Arnav
on 10 Mar 2025
Hi Vasko,
I see that you are trying to solve for the output angle at P6. Without loss of generality, your system can be assigned coordinates as follows:

As you have mentioned in the question, we can assume values for the linkage lengths as follows:
a = 14;
p = 1.75;
r = 16;
o = 0.225;
s = 1.7015;
th1 = pi/2;
This system has 2 unknown variables th2 and p3x which can be solved for as follows:
syms th2 p3x
eq1 = (p*cos(th1) - p3x)^2 + (-p*sin(th1) + o)^2 == s^2;
eq2 = (p3x + r - a + p*cos(th2))^2 + (-o + p*sin(th2)) == s^2;
result = vpasolve([eq1 eq1], [p3x, th2])
You can also use a symbolic solver to find multiple solutions (if they exist). You may refer to the following MATLAB documentation page for solve for the same: https://www.mathworks.com/help/symbolic/sym.solve.html
Hope it helps!
1 Comment
More Answers (0)
See Also
Categories
Find more on Control System Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!