Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
So, I'm completely new to Mathcad and am literally using it for my first time ever for a grad assignment. I am having difficulties with a couple of things in particular.
First, and most importantly, I am getting an error which states "This value must be a function." Having defined the term and function in question previously, I am just not sure where I'm going wrong. I'm sure it's something easy about how I'm typing it in or what I forgot to do, but I need someone more experienced to help me out.
Secondly, in the "error 2" worksheet attached, I am getting an error about incompatible units. If anyone could help me with one or both of these errors, I'd greatly appreciate it. Sorry for my lack of knowledge of the program.
Solved! Go to Solution.
1) You have to type a multiplication sign between "w" and "(", otherwise a fuction w(..) is assumed. After you correct this error ou then run into a unit mismatch - check your formulas.
2) In your program body you have used the vector index when you typed L_h but you should have used the literal index. There is also a unit mismatch in the second ("parabolic") part of your routine where you try to add an area and a length.
Furthermore I guess that in the first part you should not use "if ... if .. else ..." but rather "if.. else if ... else..."
P.S.: You don't have to apology for lack of knowledge.
1) You have to type a multiplication sign between "w" and "(", otherwise a fuction w(..) is assumed. After you correct this error ou then run into a unit mismatch - check your formulas.
2) In your program body you have used the vector index when you typed L_h but you should have used the literal index. There is also a unit mismatch in the second ("parabolic") part of your routine where you try to add an area and a length.
Furthermore I guess that in the first part you should not use "if ... if .. else ..." but rather "if.. else if ... else..."
P.S.: You don't have to apology for lack of knowledge.
You didn't define e_c (that I could see), but you happened to choose one of the built-in constants in Mathcad; = 1.603*10^-19 C.
Your equation expects a length, so you got an "incompatible units" flag.
Fred Kohlhepp wrote:
You didn't define e_c (that I could see), but you happened to choose one of the built-in constants in
e_c is the second argument of the function profile() and it is passed the worksheet variable e which is a lenght. So I guess that this part is OK.
My point was that e_c has a preassigned value and unit (which is not a length) It was never defined as a length in the sheet, so it causes a conflict in the function.
Fred Kohlhepp wrote:
My point was that e_c has a preassigned value and unit (which is not a length) It was never defined as a length in the sheet, so it causes a conflict in the function.
No, i don't think that there is a conflict. Mathcad is not using the predefined constant because e_c is a formal function argument.
profile(..., e_c, ....):= ....<usage of e_c> .....
Then he calls
profile(......, e, ....) =
and the actual argument e (which is a lenght) is passed to the function, so there should be no problem.
You're right.
Once we sort out the difference between literal and index subscripts, and a few other unit errors:
Thank you both a ton. I see my mistakes very clearly now. Hopefully it'll be smooth sailing for the rest of the assignment!