Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I've used a solve block to find the 3 roots of an equation. The 3 answers should just be in newtons (N) but it gives me an answer as Nmm2 / m2 and equations. Can I change this so it gives 3 just values?
I can use the root function as below as I'm after the lowest value, but would prefer to see the 3 roots?
Solved! Go to Solution.
You may get other solutions using the solve block by using a different guess value, but that can be quite tricky and would involve setting up your solve block as a function depending on the guess value.
The problem with the symbolic solution is that the symbol processor knows nothing about units at all. So mm and m are just two different variables of any type and value, so sqrt(m^2) might not be m and so is not simplifed.
The best way in my opionion is to turn the solve block into a function (dependable on alpha.zw) and evaluate this function numerically - that way the units are treated correct.
Onother way would be to substitute m=10^3 and mm=1 and evaluate symbolically - we can do this as we know the the length will cancel in the solution (as does alpha.yw).
See attached sheet.
You may get other solutions using the solve block by using a different guess value, but that can be quite tricky and would involve setting up your solve block as a function depending on the guess value.
The problem with the symbolic solution is that the symbol processor knows nothing about units at all. So mm and m are just two different variables of any type and value, so sqrt(m^2) might not be m and so is not simplifed.
The best way in my opionion is to turn the solve block into a function (dependable on alpha.zw) and evaluate this function numerically - that way the units are treated correct.
Onother way would be to substitute m=10^3 and mm=1 and evaluate symbolically - we can do this as we know the the length will cancel in the solution (as does alpha.yw).
See attached sheet.
Thats great, thanks for the explanation. I actually know the alpha values so I've tweaked 2 of your solutions both of which display the answers in a way I want.
Solution 1 is the easiest for me as a weak mathcad user whereas solution 2 (which I am struggling to understand) is more elegant!
I guessed that solution1 would be the best as you would only be interested in the three numeric values. As you don't need to vary the values of alpha you don't need is a a function, of course.
The second way was just to show how you could get the symbolics itself to cancel out the m and mm by telling it a bit more about those units. I wasn't sure if you wanted the symblics itself to show you a simplified solution but I already guessed, no 😉
Unless there is some specific reason for wanting a symbolic answer, most engineering problems will be fine with just a numerical answer.
TTFN
Arbiter 007 wrote:
Unless there is some specific reason for wanting a symbolic answer, most engineering problems will be fine with just a numerical answer.
TTFN
I agree, but as Graham wanted to see ALL three solutions of his equation (although just numerical) it would be quite tricky and cumbersome to find them (for any input values) using just numeric methods w/o symbolics.
... Graham wanted to see ALL three solutions of his equation (although just numerical) it would be quite tricky and cumbersome to find them (for any input values) using just numeric methods w/o symbolics.
Could do it using polyroots, as long as one were willing to identify the coefficients of the cubic equation first (which could be done by hand or using symbolics) - see below:
Alan