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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Mathcad 15 gets confused when solving equations with units in them.

ptc-5128531
1-Newbie

Mathcad 15 gets confused when solving equations with units in them.

Why is it that mathcad is having trouble solving with units? Normally when I want to make a calculation with alot of units, it is no problem, or if I solve the equation my self and then hit the equal sign, there are no problems.

But when i use the solve or given/find function I will have to copypaste the result, remove alle the units, and then it works? It is like it gets confused with all the units

1 ACCEPTED SOLUTION

Accepted Solutions

Humptey Dumptey wrote:

I can write my equation, goto symbolics>variables>solve, and then it rewrites the expression below.

IMHO thats not the best method using the symbolics as what you do is a static evaluation. Changing the input equations won't change the result and you will have to do a lot of copy and paste which is rather failure prone and does not result in a universally useable worksheet. Better to use the dynamic evaluation.

The symbolic processor does not know anything about units, it treats them as unknown variables. If you follow the symbolic evaluation by a numeric one (the equal sign), the numeric processor will take care of the units, cancel them or whatever will be necessary. You can do this on the result of the dynamic symbolic evaluation (the one with the arrow) as well, but there may be better methods.

Attach you worksheet (upper right, chose "use advanced editor") to let us see your equations.

View solution in original post

10 REPLIES 10

Do you use the symbolic "solve" or are you talking about the numeric solve-block using "find".

Unfortunately both may have their problems with units but if you post your worksheet there may be a workaround which at least does not utilize copy and paste.

On possible cause may be that your solution vector contains values with different units which is a no go for Mathcad 15 and below. In that case usually there is an easy way out, though.

I can write my equation, goto symbolics>variables>solve, and then it rewrites the expression below. If I i do the equal sign on that new expression it works fines with units.

But if i just use the solve button in the "symbolic" window so it looks like "solve,x->" it is not happy with units. Also if I do the given/find it will not calculate.

Humptey Dumptey wrote:

I can write my equation, goto symbolics>variables>solve, and then it rewrites the expression below.

IMHO thats not the best method using the symbolics as what you do is a static evaluation. Changing the input equations won't change the result and you will have to do a lot of copy and paste which is rather failure prone and does not result in a universally useable worksheet. Better to use the dynamic evaluation.

The symbolic processor does not know anything about units, it treats them as unknown variables. If you follow the symbolic evaluation by a numeric one (the equal sign), the numeric processor will take care of the units, cancel them or whatever will be necessary. You can do this on the result of the dynamic symbolic evaluation (the one with the arrow) as well, but there may be better methods.

Attach you worksheet (upper right, chose "use advanced editor") to let us see your equations.

Worksheet too messy.

I found out. I had to redefine a definition. If I do a calculation that should give an enthalpy (kJ/kg), it writes the units as m^2/s^2(Whatever that is), instead of kJ/kg, so I have to correct it with ((1000*J)/kg) every time and also, it doesn't know what kilo Joule is (Argh!)

And yes I know that i can make equal sign after the result to get a more usable result

writes the units as m^2/s^2(Whatever that is), instead of kJ/kg,

SI-Units! Mathcad is correct in that respect

it doesn't know what kilo Joule is (Argh!)

Yes, but its very easy to overcome. Just define 1kJ:=1000J on top of your sheet. You may collect all such vital definitions and assumptions in a collapsed area and use it as a template.

How is J/kg m^2/s^2 ?

Thank you! I will try experimenting with that collapsed area thing. never used it before, but it is also smart when calculating with vectors in polar form, because you need to make polar definitions.

Then what about "ton" a ton is not 1000 kg if you ask mathcad

How is J/kg m^2/s^2 ?

Joule is not a SI base unit. In terms of base units we have 1 J = 1 kg * m^2 /s^2. Look it up in the books.

Then what about "ton" a ton is not 1000 kg if you ask mathcad

What you have in mind is a metric ton, thats "tonne" in Mathcad.

In localized versions of Mathcad its even simply "t", which is nice, as thats the usual abbrevation, but only on first look, as it would mean you cannot use t in a quickplot and get problems with laplace on some occasions. Same for seconds, which shortens from sec to s. Thats one of the reasons I use my Mathcad in the english flavor.

The "ton" you stumbled across is the US ton which is 2000 pounds (1 ton = 2000 lb) [short ton].

There are a some of other definitions of what a ton could be, e.g. 1 UK ton = 2240 pounds [long ton], which, AFAIK are not implemented in MC.

Ah that is the reason. Okay.

Is there a way to throw all those American units etc. away, and define new units? Like redefine "ton" as 1000 kg?

Is there a way to throw all those American units etc. away, and define new units? Like redefine "ton" as 1000 kg?

Easiest way would be as outlined for kJ. Simply redefine it the "normal" way.

If you want different base units, you can change that by going to Tools/Worksheet Options/UnitSystem. If you want it for every worksheet you create in the future, you will have to load the template file normal.mct and change it there.

You may want to search this forum for "custom units" for some discussions abou the pros and cons of doing so.

Thank you very much.

Top Tags