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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Units issue when defining a function

mjenner
1-Visitor

Units issue when defining a function

Attached illustrates the problem where I calculate the constants a and b of a linear function. Next I define the function, but it doesn't really work - only partly.

What am I doing wrong?

Kind regards,

Michael

ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:mjenner)

Notice that the "a" in the function definition and the "a" in the function call look different? That's because the label for one is set to "variable". but for the other it's set to "function". They need to be set the same. Also, the symbolic processor does not really understand units. Notice that the "m" and "s" from the symbolic evaluation display as variables, not units. Split the symbolic evaluation from the function definition. When you call the function you also have "s" as a variable, which is not defined, rather than the defined unit for seconds. If you fix the other problems Mathcad should fix that for you automatically though.

View solution in original post

2 REPLIES 2
RichardJ
19-Tanzanite
(To:mjenner)

Notice that the "a" in the function definition and the "a" in the function call look different? That's because the label for one is set to "variable". but for the other it's set to "function". They need to be set the same. Also, the symbolic processor does not really understand units. Notice that the "m" and "s" from the symbolic evaluation display as variables, not units. Split the symbolic evaluation from the function definition. When you call the function you also have "s" as a variable, which is not defined, rather than the defined unit for seconds. If you fix the other problems Mathcad should fix that for you automatically though.

Got it,

Thanks!

Announcements

Top Tags