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
- :
- Solve equation with/without units

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

03-11-2020
10:48 AM

03-11-2020
10:48 AM

Solve equation with/without units

Hi All,

I am very new in Mathcad, have a very basic question.

consider the below equation:

Mathcad solves the equation and finds the "v" as is expected.

Now I add units to the equation:

I don't know why I don't get the same value here directly after "solve,v"?

In the following, I can return the value of "v" and get the values which are correct.

Is there any way to skip the part shows first within the [ ] and get the final answer?

In addition, Is it possible to rewrite the equation symbolically and get an expression for "v":

another example for clarification:

Thanks.

Labels:

4 REPLIES 4

Highlighted
##

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

03-11-2020
11:01 AM

03-11-2020
11:01 AM

Re: Solve equation with/without units

Welcome to the forum.

The symbolic solver does not 'know units'. It will allow them, but treat them as unknown variables, at best.

In general you are better off first solving whatever problem you have symbolically, WITHOUT entering any values. Symbolically, means: using only symbols (as much as possible).

The symbolic solution will give you an expression, if you're smart you make it result in a function.

Now in that function, you can enter your numbers, including units, if you want.

Example:

Note that I entered the 1.4 as 14/10, that is to prevent the symbolic solver to go into floating mode, at which it will give numbers with ridiculously many digits.

(Where I said, you shouldn't use numbers, you __can__ use integer values. But 'real' numbers, those with a point, should be avoided/replaced by symbols, pi and e are also known values to the symbolic solver.)

I guess the factor 1.4 is a parameter of some kind, then there should be a symbol for it. If by chance it is your approximation of the square root of two, it should be entered as the square root of two. Think of it this way: the symbolic solver knows mathematics, but not physics. And of course, mathematic rules state that the square root of 4 is 2, ... or -2 !)

Since your expression is quadratic, you get two (possible) solutions for every input. You may be able to bring that down to one, by adding assumptions. Maybe an "assume, v=positive" added to the solve command does the trick for you. Look up 'assume' in the help to see how to use it.

Success!

Luc

Highlighted
##

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

03-11-2020
11:32 AM

03-11-2020
11:32 AM

Re: Solve equation with/without units

Hi Luc, thanks for your swift reply.

Would you kindly answer the 2nd part of my question:

Is it possible to rewrite the equation symbolically and get an expression for "v"?

Highlighted
##

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

03-11-2020
12:05 PM

03-11-2020
12:05 PM

Re: Solve equation with/without units

Isn't that what my first function v(p,a) does?

As said, using/adding assumptions may result in getting you the first or second solution only. Be warned that in general it is hard to control the output of the symbolic solver.

As you can see from my pictures, I am using another version of Mathcad (Mathcad 11). I don't have a license for Prime, and am limited to the free Prime Express. This means I cannot use Prime symbolics and some other complicated stuff, such as the mean() function. But I can read whatever Prime file.

In general, when you post questions on this forum, you're advised to attach your sheet file. In case of problems that helps tremendously to debug, and prevents retyping.

Success!

Luc

Highlighted
##

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

03-11-2020
07:14 PM

03-11-2020
07:14 PM

Re: Solve equation with/without units