# Equation Solving with Multiple Square Roots

I am trying to solve the following equation in Excel for over a year now but the size of it is absolutely massive. This equation is used in a spreadsheet that I am making to model the suspension of my Jeep. I have no idea how to enter all of this information into Mathematica. Any help at all would be greatly appreciated.

I want to solve the following equation in terms of y and B and solve for B based on a given y:

y=B+RearCoupler101*(B-D) -SQRT(RearCoupler102^2-RearCoupler101^2)*(C-A);


where:

C = RearLowerFrameX - SQRT(RearLowerDistance^2-(D-RearLowerFrameY)^2);

A = RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2);

D = ( (B+RearLowerFrameY) * (A-RearLowerFrameX)^2 +
(RearLowerDistance^2-RearAxleDistance^2-RearLowerFrameY^2+B^2) * (B-RearLowerFrameY) +(A-RearLowerFrameX) * SQRT(2* (RearLowerDistance^2+RearAxleDistance^2) * ((A-RearLowerFrameX)^2+(B-RearLowerFrameY)^2)-((A-RearLowerFrameX)^2 +(B-RearLowerFrameY)^2)^2-(RearLowerDistance^2-RearAxleDistance^2)^2))/(2*(A-RearLowerFrameX)^2+2*(B-RearLowerFrameY)^2);

RearCoupler101 = (RearLowertoAxleDistance^2 - RearUppertoAxleDistance^2 - RearAxleDistance^2)/(2*RearAxleDistance^2);

RearCoupler102 = RearUppertoAxleDistance/RearAxleDistance;

RearUpperDistance = SQRT((RearUpperFrameX-RearUpperAxleX)^2+(RearUpperFrameY-RearUpperAxleY)^2);

RearLowerDistance = SQRT((RearLowerFrameX-RearLowerAxleX)^2+(RearLowerFrameY-RearLowerAxleY)^2);

Rear Axle Distance = SQRT((RearUpperAxleX-RearLowerAxleX)^2+(RearUpperAxleY-RearLowerAxleY)^2);

RearUppertoAxleDistance = SQRT((RearUpperAxleX-RearTireCenterX)^2+(RearUpperAxleY-RearTireCenterY)^2);

RearLowertoAxleDistance = SQRT((RearLowerAxleX-RearTireCenterX)^2+(RearLowerAxleY-RearTireCenterY)^2);

RearUpperFrameX = 31.625;

RearUpperFrameY = 27;

RearUpperAxleX = 3.375;

RearUpperAxleY = 30.125;

RearLowerFrameX = 37.875;

RearLowerFrameY = 23.25;

RearLowerAxleX = 3.75;

RearLowerAxleY = 20.375;

RearTireCenterX = 0;

RearTireCenterY = 20.5;


When I combine all of the pieces together I can create a single equation that has only y and B but it has three square roots and I am about half way through solving it by hand, but hopefully some genius here can solve it ten minutes. I would like to see how it is entered into Mathematica so I can possibly try an even more complicated formula for the articulation of the axles. Thanks in advance for any help you guys can provide.

Here is the full equation:

0 = -y + B -RearCoupler101 * (B- ( (B+RearLowerFrameY) * ( (RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2 +
(RearLowerDistance^2-RearAxleDistance^2-RearLowerFrameY^2+B^2) * (B-RearLowerFrameY) +( (RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX) * SQRT(2 *  (RearLowerDistance^2+RearAxleDistance^2) * (( (RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2+(B-RearLowerFrameY)^2)-(( (RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2 +(B-RearLowerFrameY)^2)^2-(RearLowerDistance^2-RearAxleDistance^2)^2))/(2 * ( (RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2+2 * (B-RearLowerFrameY)^2))+SQRT(RearCoupler102^2-RearCoupler101^2) * (RearLowerFrameX - SQRT(RearLowerDistance^2-( ( (B+RearLowerFrameY) * ((RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2 +
(RearLowerDistance^2-RearAxleDistance^2-RearLowerFrameY^2+B^2) * (B-RearLowerFrameY) +((RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX) * SQRT(2 *  (RearLowerDistance^2+RearAxleDistance^2) * (((RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2+(B-RearLowerFrameY)^2)-(((RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2 +(B-RearLowerFrameY)^2)^2-(RearLowerDistance^2-RearAxleDistance^2)^2))/(2 * ((RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2))-RearLowerFrameX)^2+2 * (B-RearLowerFrameY)^2)-RearLowerFrameY)^2)-(RearUpperFrameX - SQRT(RearUpperDistance^2-(B-RearUpperFrameY)^2)));


Thank you all for the responses. Here is a graphical representation of what I am trying to come up with. In this graph I am changing the RearUpperAxleY coordinate and the rest of the coordinates are calculated.

https://www.geogebra.org/m/wxnwM45t

What I am looking for is to be able to change the RearTireCenterY coordinate and calculate the rest of the coordinates. Someone at Geogebra used a locus to approximate what I am trying to do, but I need an exact calculation. Perhaps I am trying to solve the equation the wrong way. I don't care what order the coordinates are solved, just so long as I can calculate all the coordinates after changing RearTireCenterY.

https://www.geogebra.org/m/dDRQwtqE

What I really need to know is the equation, but also how the equation was created. I have several other formulas after this one that can be solved in the same manner, I just to figure out how to solve it the first time.

• D is a protected symbol in Mathematica. You'll have to change it to something else. It's always a good idea to use lower case letters for your variables and functions. – aardvark2012 Jul 28 '17 at 23:30

Since y only appears once and outside all the square roots, that is fairly simple. B is much more challenging.

Perhaps this will give you an idea how y and B behave and show you the Mathematica syntax. And we will let Mathematica do all the substitutions. Note that C and D already mean something to Mathematica so I rename those CapC and CapD. Notice I have ordered the lines to try to have each line only refer to previous lines.

RearUpperFrameX = 31.625;
RearUpperFrameY = 27;
RearUpperAxleX = 3.375;
RearUpperAxleY = 30.125;
RearLowerFrameX = 37.875;
RearLowerFrameY = 23.25;
RearLowerAxleX = 3.75;
RearLowerAxleY = 20.375;
RearTireCenterX = 0;
RearTireCenterY = 20.5;
RearUpperDistance = Sqrt[(RearUpperFrameX - RearUpperAxleX)^2 + (RearUpperFrameY -
RearUpperAxleY)^2];
RearLowerDistance = Sqrt[(RearLowerFrameX - RearLowerAxleX)^2 + (RearLowerFrameY -
RearLowerAxleY)^2];
RearAxleDistance = Sqrt[(RearUpperAxleX - RearLowerAxleX)^2 + (RearUpperAxleY -
RearLowerAxleY)^2];
RearUppertoAxleDistance = Sqrt[(RearUpperAxleX - RearTireCenterX)^2 + (RearUpperAxleY -
RearTireCenterY)^2];
RearLowertoAxleDistance = Sqrt[(RearLowerAxleX - RearTireCenterX)^2 + (RearLowerAxleY -
RearTireCenterY)^2];
RearCoupler101 = (RearLowertoAxleDistance^2 - RearUppertoAxleDistance^2 -
RearAxleDistance^2)/(2*RearAxleDistance^2);
RearCoupler102 = RearUppertoAxleDistance/RearAxleDistance;
A = RearUpperFrameX - Sqrt[RearUpperDistance^2 - (B - RearUpperFrameY)^2];
CapD = ((B + RearLowerFrameY)*(A - RearLowerFrameX)^2 + (RearLowerDistance^2 -
RearAxleDistance^2 - RearLowerFrameY^2 + B^2)*(B - RearLowerFrameY) +
(A - RearLowerFrameX)*Sqrt[2*(RearLowerDistance^2 + RearAxleDistance^2)*
((A - RearLowerFrameX)^2 + (B - RearLowerFrameY)^2) - ((A - RearLowerFrameX)^2 +
(B - RearLowerFrameY)^2)^2 - (RearLowerDistance^2 - RearAxleDistance^2)^2])/
(2*(A - RearLowerFrameX)^2 + 2*(B - RearLowerFrameY)^2);
CapC = RearLowerFrameX - Sqrt[RearLowerDistance^2 - (CapD - RearLowerFrameY)^2];
eqn = -y + B + RearCoupler101*(B - CapD) - Sqrt[RearCoupler102^2 - RearCoupler101^2]*
(CapC - A);


Instead of trying to solve for y and B let's look at how they relate to each other. A 3D plot showing this relationship

It appears that for somewhere near B == -1.5 some argument to a square root probably goes negative, the result goes complex and the plot stops. But for B greater than that it appears for these modest values of y and B there is a linear relationship.

I have no idea what range of values y or B might have so I have just guessed three small integers and plotted the three on top of each other. You can try replacing these with reasonable values for y or B and see what you get.