Jeremy,

I solved it! I have the code working now and it seems to mirror Mathematica's output in the sample situations I have tried so far. It's hard to explain exactly what I did because I only somewhat understand... but I followed how mathematica broke down the equation piece by piece, watching to see when the i imaginary numbers disappeared. The trick seems to be to keep the (1-i*SQRT(3)) and (1+i*SQRT(3)) portions of the equation seperate, as they are used to cancel out the "i" that would have resulted from the cubed root of (p2+p4).

p5a and p5b are the two values that make up the complex number that results from the cubed root. I noticed that when mathematica multiplied this complex number by (1-i*SQRT(3)) the result was the same as if p5b had been multiplied by 3 instead of SQRT(3), and the "i" number disappeared. So the "i"'s canceled each other out, and the square root signs canceled each other out. So i never even included the (1-i*SQRT(3)) portion of the equation in what I wrote up in Qlarity, I just modified p5b accordingly when I incorporated it in to p6.

That might not be the clearest explanation, but here is the working code. p13 is the value (Vs) I was looking to solve for in the original equation.

**Code:**

p1=(1/(6*power(2,(1.0/3.0))*dur))

p2=(-2*power(dist,3))-(6*MA*power(dist,2))-(6*dist*power(MA,2))-(2*power(MA,3))+(6*power(dist,2)*MD)+(12*dist*MA*MD)+(6*power(MA,2)*MD)-(6*dist*power(MD,2))-(6*MA*power(MD,2))+(2*power(MD,3))+(18*dist*MA*dur*initspeed)+(18*power(MA,2)*dur*initspeed)-(18*MA*MD*dur*initspeed)-(27*MA*power(dur,2)*power(initspeed,2))

p3=(4*power(((6*MA*dur*initspeed)-power(dist+MA-MD,2)),3))

p4=SQRT((p3+power(p2,2)))

tmp=(p2+p4)

if tmp < 0 then

p5 = power(-tmp, 1.0/3.0)

else

p5= power(tmp, 1.0/3.0)

endif

p5a= p5/2

p5b= ((p5/2)*SQRT(3))

p6 = p5/2+((p5/2)*3)

p7=(dist+MA-MD)/(3*dur)

p8=((6*MA*dur*initspeed)-power(dist+MA-MD,2))

p9=(3*power(2,(2.0/3.0))*dur)

p10=p8/p9

p11=1+SQRT(3)

p12=p5a+p5b

p13=(p1*p6)+(p7-(p10*(p11/p12)))

Thanks for all your help on this Jeremy!