Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
I'm trying to use a the symbolic solve function to rearrange an equation and solve for a variable, but I'm having trouble because the answer is a vector with units.
Example: given the area of a circle, find the radius. I enter:
A:= 3.14 cm^2
(A = pi * r^2) solve,r->
and it spits out a column vector (displayed here as a row vector)... -> (1cm, -1cm)
and I want to set that to another variable, say, R1, so I now have:
A:= 3.14 cm^2
R1:= [ (A = pi * r^2) solve,r-> (1cm, -1cm) ]
R1= (1cm, -1cm)
I know it can only be the positive value, so I want to pull that value out:
R2:= R1[0
this gives me an error: R1 is red and the hover text reads "this value must be an array"
How can I set a variable to be the positive radius? (R= 1cm)
(I know I could just rearrange the equation here for the radius in the first place, but I want to keep it clear where I got the equation from. Also, this is just a simple example and I'd want to do it with something more complicated and want to avoid an algebra mistake)
Thank you very much!
Eli
(using Mathcad, version 14.0.0.163 [build 701291152] on windows7, 64bit)
Solved! Go to Solution.
Hi Richard,
thank you so much for your response. That is exactly what I was looking for BUT...
when I try the same thing you're doing, whether in the same document with different variables or in a new document, I still get an error. This time it's saying that my radius variable is undefined (with both methods).
I think I must be entering it wrong, although it looks the same as yours (from what I can see).
Any thoughts on what I'm doing differently? My file is attached.
thanks!
Eli
It should work. Try downloading and installing the latest available service release for version 14.
Please check the attached Mathcad document below.