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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Units error when solving

Mardi
2-Explorer

Units error when solving

Hello

 

I have a problem calculating with units in Mathcad Prime 4.0

When using the solver with units, it often gives the error "This value must be a scalar or a matrix" but it seems to solve just fine, with small modifications.

Capture1.PNG

As you can see, it solves the problem, but when i put an equal sign afterwards it gives the error.
When i copy the result and pase it (underneath the error) and put an equal sign, the same thing happens, but if i

delete the last "min" in the down right corner, and replace it by writing "min" it gives the solution, which here is 56.249 bar.

 

Why doesn't it solve in the first place? I delete a min and replace it with a min, and that solves it??

 

 

I have another questing, that might be related to the first problem.

Capture2.PNG

As you can see it doesn't solve with b in degrees celcius, same error "This value must be a scalar or a matrix"  then when i define d as the same 5 deg. celcius, but add an equal sign afterwards it allows to solve, why can't it figure that out? It obviously knows how many kelvin 5 degrees celcius is.

I might be doing something wrong, since i recently moved from Mathcad 15 to prime, and never had the same problems in 15. Seems counterintuitive to create a worse program.

I hope this problem can be solved since units is the reason for using the program.

 

Thanks in advance

Martin

 

 

1 REPLY 1
LucMeekes
23-Emerald III
(To:Mardi)

The symbolic processor of Mathcad (and Prime) does not know units, It treats your 'm', 'bar' and other units as (unknown) variables.

 

If you want to work with symbolics, start with solving the problem with only symbols.

Then fill your (united) variables into the solution.

See here for an example: https://community.ptc.com/t5/PTC-Mathcad-Questions/Reduce-solving-solution-Intermediate-calculations/td-p/491698

 

Simple example:

LM_20171124_symbolic.png

Now with temperature units be extra careful. Prime has a Celsius unit for absolute temperature and one for temperature difference. And in addition Prime calculates EVERY unit internally as an SI unit (so feet are internally converted to metres, and °C to K...)

If you know that 0 °C = 273 K (or thereabouts) don't be surprised that if you add 1 °C to 1 K, you get about 275 K, and NOT 2 K; but you might get 2 °C.

And be aware that temperature conversions in Prime are not simple 'constants' but functions. That is because (unlike most other units of measure) temperature cannot be converted by simple multiplication or division, but an offset is involved in many temperature conversions.

Have a look here: https://community.ptc.com/t5/PTC-Mathcad-Questions/problem-defining-a-function-that-has-variables-with-units-of/m-p/491964#M174563

 

Success!
Luc.

 

Announcements

Top Tags