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 the Community Ranking System, a fun gamification element of the PTC Community. X

Calculating uncertainty (This value must be a function )

ptc-4587990
2-Explorer

Calculating uncertainty (This value must be a function )

I am trying to resolve a problem with the function on page 3. It worked in other files I've tried to use this function in but it always seems to mess up for some reason or another.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:ptc-4587990)

I guess there are a couple of problems:

  1. This is the reason for the error message: You redefine DeltaT.lm as a simple variable (with value 38.215°C) and so you delete the definition of the function with the same name!
  2. Get rid of the square brackets! Your are (certainly unintentionally) creating 1x1 matrices that way and the result would be a 1x1 matrix, too. Always use parenthesis only for structuring expression (Prime may show them sometimes as square brackets but you should never type them yourself unless you really want to create a matrix or vector).
  3. You are taking the square root of the first summand only. I am not sure but I guess that you want the square root of the whole sum (as shown on the right side of my picture), right?
    And yes, that square root of that multi-line expression really looks ugly! You might consider defining an auxiliary function without the root and the final function would call that auxiliary function and take the root.
  4. You may consider using temperature units as well, but they can be quite beasty! Carefully chose either °C or Delta°C. Keep in mind, that Prime internally will always use Kelvin!   Werner_E_0-1586918810258.png

 

Werner_E_0-1586918060366.png

 

View solution in original post

3 REPLIES 3

Hi,

 

See page 3.

Cheers

Terry

Werner_E
25-Diamond I
(To:ptc-4587990)

I guess there are a couple of problems:

  1. This is the reason for the error message: You redefine DeltaT.lm as a simple variable (with value 38.215°C) and so you delete the definition of the function with the same name!
  2. Get rid of the square brackets! Your are (certainly unintentionally) creating 1x1 matrices that way and the result would be a 1x1 matrix, too. Always use parenthesis only for structuring expression (Prime may show them sometimes as square brackets but you should never type them yourself unless you really want to create a matrix or vector).
  3. You are taking the square root of the first summand only. I am not sure but I guess that you want the square root of the whole sum (as shown on the right side of my picture), right?
    And yes, that square root of that multi-line expression really looks ugly! You might consider defining an auxiliary function without the root and the final function would call that auxiliary function and take the root.
  4. You may consider using temperature units as well, but they can be quite beasty! Carefully chose either °C or Delta°C. Keep in mind, that Prime internally will always use Kelvin!   Werner_E_0-1586918810258.png

 

Werner_E_0-1586918060366.png

 

Thank you, this was very helpful.

Announcements

Top Tags