cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Solved variable from symbolic solve cannot be extracted into worksheet

SOLVED
HR_9263482
Visitor

Solved variable from symbolic solve cannot be extracted into worksheet

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!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Solved variable from symbolic solve cannot be extracted into worksheet

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:

LucMeekes_0-1620927009846.png

I usually prefer a function...

 

Success!
Luc

View solution in original post

4 REPLIES 4

Re: Solved variable from symbolic solve cannot be extracted into worksheet

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:

LucMeekes_0-1620927009846.png

I usually prefer a function...

 

Success!
Luc

View solution in original post

Re: Solved variable from symbolic solve cannot be extracted into worksheet

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

 

Random result.png

 

Re: Solved variable from symbolic solve cannot be extracted into worksheet

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:

LucMeekes_0-1620974495975.png

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:

LucMeekes_1-1620975296959.png

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)

LucMeekes_2-1620975800060.png

or you can set the range within which to find it:

LucMeekes_3-1620975886628.png

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:

LucMeekes_4-1620976003508.png

Success!
Luc

 

 

 

Re: Solved variable from symbolic solve cannot be extracted into worksheet

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

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."