Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Solving with several unknown variables

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
08:24 AM

12-02-2018
08:24 AM

Why can't MathCAD solve this equation? It obviously works after simplifying it manually first as shown in the last step. But how can i get MathCAD to do it in the previous step?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:46 AM

12-02-2018
09:46 AM

Ah, I think I see the problem. You're trying to have the symbolic solver find m.Rd and you are using units. You should be aware that the symbolic solver does not know units, it treats each unit as an undefined variable. Prime's numeric processor knows, and can transform units as required, but the symbolic solver does nothing with/to them In some cases, depending on the equation, they will cancel out, and then it does not hinder the symbolic processor...

Attached is a different approach, using the root function (Prime 4)

Success!

Luc

16 REPLIES 16

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:12 AM

12-02-2018
09:12 AM

Re: Solving with several unknown variables

The problem might occur because you are using a variable named delta, that is undefined. Mathcad assumes that it's the delta function, which requires an argument...

You can change delta to be a variable, by setting its label (see the ribbon) accordingly.

Success!

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:29 AM

12-02-2018
09:29 AM

Re: Solving with several unknown variables

I have tried changing delta to variable, replacing it with an other letter and even defining it as "1".

But nothing works.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:33 AM

12-02-2018
09:33 AM

Re: Solving with several unknown variables

What is the error message that you get from the first symbolic 'solve'?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:36 AM

12-02-2018
09:36 AM

Re: Solving with several unknown variables

This variable is undefined. Check that the label is set correctly.

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:46 AM

12-02-2018
09:46 AM

Ah, I think I see the problem. You're trying to have the symbolic solver find m.Rd and you are using units. You should be aware that the symbolic solver does not know units, it treats each unit as an undefined variable. Prime's numeric processor knows, and can transform units as required, but the symbolic solver does nothing with/to them In some cases, depending on the equation, they will cancel out, and then it does not hinder the symbolic processor...

Attached is a different approach, using the root function (Prime 4)

Success!

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2019
07:08 AM

01-02-2019
07:08 AM

Re: Solving with several unknown variables

So you are saying that it's pure luck when the solver get units right like in this example?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2019
08:38 AM

01-02-2019
08:38 AM

Re: Solving with several unknown variables

@Rafael1 wrote:

So you are saying that it's pure luck when the solver get units right like in this example?

Absolutely! The symbolics engine doesn't understand units, so if it comes out right it's a happy accident. At first look in your example the units look wrong; but you got lucky:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2019
07:10 AM

01-02-2019
07:10 AM

Re: Solving with several unknown variables

Does the root function always work with units?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-02-2019
08:40 AM

01-02-2019
08:40 AM

Re: Solving with several unknown variables

@Rafael1 wrote:

Does the root function always work with units?

"root" is a numeric function. Mathcad numerics deal properly with units.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-03-2019
12:45 PM

01-03-2019
12:45 PM

Re: Solving with several unknown variables

In Mathcad 11 root is not per se a numeric function:

I haven't found examples of Prime (trying) to use root symbolically...

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-03-2019
09:11 PM

01-03-2019
09:11 PM

Re: Solving with several unknown variables

Mathcad 15 and also Prime will not accept the 2-argument flavor of "root" but insist on using the 4-argument form. There is no logic in doing so as the symbolic evaluation of "root" does NOT require the function values of the end points of the interval to be of opposite sign and will happily return all roots within that interval.

What hast changed concerning symbolic evaluation are at least two things:

1) We cannot evaluate a solve block sybolically

2) We cannot copy a symbolic evaluation inside a program

Mathcad 15:

Prime 5:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2019
02:05 AM

01-04-2019
02:05 AM

Re: Solving with several unknown variables

That explains why I did not find examples in the help files using the root function symbolically. The preferred method is to use the solve keyword.

What happens if you set the two range parameters wrongly, like 0, 2 (does it find one root...) or -1, 1 (no roots) ?

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-04-2019
09:18 AM

01-04-2019
09:18 AM

Re: Solving with several unknown variables

@LucMeekes wrote:

That explains why I did not find examples in the help files using the root function symbolically. The preferred method is to use the solve keyword.

What happens if you set the two range parameters wrongly, like 0, 2 (does it find one root...) or -1, 1 (no roots) ?

Luc

In case of interval [0;2] both MC15 and P5 return correctly just the one solution in this interval.

In case of [-1;1] only P5 fails with no solution found. MC15 strangely switches into float mode and returns both solutions. Only when start and end value are the same, MC15 fails, too.

The very same behaviour is shown by the symbolic "solve" in conjunction with "assume":

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-05-2019
05:51 AM

01-05-2019
05:51 AM

Re: Solving with several unknown variables

Mathcad 11's symbolics knows the bracketed root function, but:

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
09:30 AM

12-02-2018
09:30 AM

Re: Solving with several unknown variables

Other than that, your equation is indeed simple. Here's how Mathcad can solve it fully symbolically:

Note that delta is not part of the solution, so can be any value that does not lead to (other) problems.

Success!

Luc

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

12-02-2018
10:40 AM

12-02-2018
10:40 AM

Re: Solving with several unknown variables

Your problem is basically that you define variables using an unknown, then you solve symbolically for this unknown and then you expect all those defined variables magically have their appropriate value based on the now solved for variable.

Thats not the way Mathcad works. It will never go back to a variable definition and insert a value for a variable which was calculated or assigned later. If you want this to be done, you have to define a function instead of a variable.

Her is a simplified version of your problem as I understand it

and her a three possible solutions/work-arounds:

1) Simply assign the solved for value to the appropriate variable and repeat/copy the variable definitions which will happily use the calculated value now.

2) Turn your variable definitions into functions as this is the mathematical construct which changes its value depending on one ore more input arguments

3) Do without the symbolic solve and use a numeric solve block instead. Note the picture below is erratically missing a guess value for x (we don't get an error because x was already assigned a value before in my sheet)!. Note that you have to "find" all variables which depend on the unknown, even though you might not be interested in all of them