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
- :
- Units won't cancel with Solver

Options

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

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

Showing results for

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

04-15-2012
06:21 PM

04-15-2012
06:21 PM

Units won't cancel with Solver

I'm setting up an equation to solve for a final temperature, and inserting the units makes Solver fail. From the way it's acting, it appears it's treating the symbol 'K" as a variable rather than Kelvin temperature. For example, if I write xK, it doesn't insert the tiny dot that means it's recognized the "K" as a Kelvin temperature. Typing x*K will insert a multiplication sign, but Solver still produces gibberish.

Take all the units out, and it works fine. But I'd much, much rather have MathCad track the units as an additional check. If possible. I can't find anything in the manual or online help that even comes close to addressing this.

File attached as MathCad 12 .mcd file, although I'm using MathCad 14.

Jeff Corkern

15 REPLIES 15

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

04-15-2012
06:32 PM

04-15-2012
06:32 PM

Re: Units won't cancel with Solver

For example, if I write xK, it doesn't insert the tiny dot that means it's recognized the "K" as a Kelvin temperature.

Are you sure it doesn't think you've created a single variable called "xK"?

Also, when in doubt, use the Insert>Units menu.

You would be surprised what happens when Mathcad doesn't know you mean for "g" to be grams, not 9.8 m/sec^2.

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

04-15-2012
07:15 PM

04-15-2012
07:15 PM

Re: Units won't cancel with Solver

There are several errors in your worksheet.

The heats of formation need to be cal/mol or similar.

The heat of reaction in the equation you are solving should have a negative sign to make the right hand side positive.

There is not a unit "grams", only "gm" or "kg".

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

04-15-2012
07:47 PM

04-15-2012
07:47 PM

Re: Units won't cancel with Solver

Tried Insert Unit. Didn't work. My variable x went completely away, to be replaced by K.

I had a user-defined unit "gram" in the worksheet I cut this from. "gm" kept causing problems, so I re-defined a new unit.

Yeah, it should be cal/mol and the sign should be different.

But after doing all that, I still have the original problem.

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

04-15-2012
07:54 PM

04-15-2012
07:54 PM

Re: Units won't cancel with Solver

Jeff,

Try using the symbolics>solve>variable and selecting x. That's what I did. If that doesn't work, please attach the modified worksheet.

Harvey

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

04-15-2012
12:54 AM

04-15-2012
12:54 AM

Re: Units won't cancel with Solver

On my version, it's "Symbolics, Variable,Solve" and somehow it just won't take it. I tried "solve, x" and it's still not recognizing the degree units

File attached as MathCad 12 .cmd file.

Jeff Corkern

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

04-15-2012
01:18 AM

04-15-2012
01:18 AM

Re: Units won't cancel with Solver

Here (x-298)K x is unitless

I think the correct solution ison this way:

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

04-16-2012
04:23 AM

04-16-2012
04:23 AM

Re: Units won't cancel with Solver

Is this what you need?

Regards

Andy

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

04-16-2012
10:09 AM

04-16-2012
10:09 AM

Re: Units won't cancel with Solver

What was my mistake?

I have tried that before and gotten gibberish.

I copied and pasted your entire page, put it in mine, and it worked.

The only difference I can see between the two is their alignment.

How was it aligned incorrectly?

Hmm, further examination shows you removed where I used the equals sign and forced it to calculate to a number for the delta-H of reaction. Forcing your worksheet to do the sames makes the Solve part crash on your worksheet.

Howsomever, removing the equals sign from my delta-H calculation still doesn't make it calculate correctly on my worksheet.

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

04-16-2012
12:14 PM

04-16-2012
12:14 PM

Re: Units won't cancel with Solver

The major change was from (x-298)K to (x-298K) ; the solve function is calculating the 'x' in K so the constant needs to be dimensioned accordingly.

Regards

Andy

Top Tags