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
Good day PTC Community!
I was wondering if someone could help me resolve my issue with the product. I tried the symbolic solve for an equation and it was amazing. I got stuck though. I was planning to use the value solved from the equation I made inside the worksheet and use it for other formulas. The problem is I can't extract it, it just prompts me "missing term or expression." Was what I'm doing wrong? or are there any workaround I should change in order to achieve extracting the variable solved?
Thanks in advance!
Solved! Go to Solution.
The one thing you did wrong, was to not (forget to?) attach the worksheet. A picture is said to paint a thousand words.... a worksheet paints much more!
Other than that: You can assign the result of a symbolic operation to a variable, or to a function. Like this:
I usually prefer a function...
Success!
Luc
The one thing you did wrong, was to not (forget to?) attach the worksheet. A picture is said to paint a thousand words.... a worksheet paints much more!
Other than that: You can assign the result of a symbolic operation to a variable, or to a function. Like this:
I usually prefer a function...
Success!
Luc
Good morning Luc,
My apologies. I forgot about the file. Your answer worked, I didn't know you can stack "definition" operator to an "evaluation." I really need to learn more. Thank you!
Can I add one more question? The picture I sent before was the equation I used as a workaround because the original equation was not working; technically, it did its job, but I don't know why the result was like that. I did the math fine and also the units. At the worksheet, you will see it above the function "d(d)."
It gave out random numbers (d=0.00452...). When I created a new equation and changed the variables to its exact value, it did the calculation correctly: d=0.218 meters (the function "d(d)"). As a checker, I also did it in Solve Block; it also worked fine--almost faster than symbolic (same answer from the exact value calculation: d=0.218 meters). Was the reason for the random numbers is that Mathcad cannot solve multiple variables in Symbolic Solve? or was it because maybe the units are not correctly placed? I'm lost. Any suggestion or recommendation is highly appreciated. Thanks!
Issue: Page 11
You should realise that the symbolic processor normally doesn't 'know' about units, at best they're handled as unknown variables. However in the latest version(s) of Prime you can set a symbolic option to deal with units. Look that up in the help! (I'm limited to Prime express, can't do symbolics, programming,..., but I can read your worksheet and see the stored results.)
Other that that, I'm used to solving symbolic equations only symbolically at first, and only after solving do I put in the numeric values (with units). And it is important to realise that a symbolic equation does not, and must not, contain units. As such, I would have done it this way:
So here d() is a function of all the symbols in the equation, and it gives two possible answers to the equations (because it's quadratic in d), of which one will generally be acceptable, because the other can be easily rejected due to giving negative length, mass, or whatever, or the result is complex (contains an imaginary part) where it should be real..
Now with your equation you did one thing VERY wrong. You put in a 10^3 (to convert some units, possibly). You should NEVER need to do that. Note that Prime's numeric processor can, and should handle your units perfectly well.
So after the 10^3 is taken out, we can get the correct answers:
And it's easy to see that the first answer is what you're looking for, the second is negative.
You can have the symbolic processor take that decision too, as you did in your example that worked: ALL>0.
You could also set d>0.
Yet another way to solve this, is to use the root() function. (You have to give a guess value for d)
or you can set the range within which to find it:
The advantage of root is that it will give only one answer without further ado, but your guess value, or range, must be set well:
Success!
Luc
Good evening Luc,
Spotless explanation. Amazing! you're so good at this! Just a few hours of checking my worksheet and you've already solved the problem single-handedly. You made the problem I'd been having for a few weeks seem like elementary-level.
This is my first forum post, and you've inspired me to pursue learning Mathcad even more. Thank you so much for considering my inquiry and also the tips, suggestions, and recommendations. I'll keep that in mind.
Keep safe!
Hector,
Student