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

Function won't recognize a variable when it is put as a power of e, (e^x). x is "undefined"

Walks
1-Newbie

Function won't recognize a variable when it is put as a power of e, (e^x). x is "undefined"

I'm using MathCad 3.1 and for some reason x in my function is always labeled as undefined and I can't figure out why. I played around with labeling the variables and such but it won't work. Normal functions work just fine. Is MathCad not able to do this?

 

A solution to a similar problem was done in mathcad 3.1 that worked fine, I could just enter 0 for x but i need to be able to use dp/dx in other equations

 HW2.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Walks)

Why are there brackets around x, like '(x)'   ?

And the argument to the exponential function must be unitless. You have defined x with unit of um, and have alpha with unit of 1/um. You should not put in an extra 'um' in the exponent !

Then, Pn0 is undefined... This triggers an error, but Mathcad is known to misplace error pointers.

Finally: apparently you cannot evaluate the function you define immediately.

LM_20180321_Variable.png

 

Success!
Luc

View solution in original post

4 REPLIES 4
LucMeekes
23-Emerald III
(To:Walks)

Why are there brackets around x, like '(x)'   ?

And the argument to the exponential function must be unitless. You have defined x with unit of um, and have alpha with unit of 1/um. You should not put in an extra 'um' in the exponent !

Then, Pn0 is undefined... This triggers an error, but Mathcad is known to misplace error pointers.

Finally: apparently you cannot evaluate the function you define immediately.

LM_20180321_Variable.png

 

Success!
Luc

Thank you I updated the picture and ya, I should have double checked the first picture I posted. Pn0 was defined but wasn't in the screen shot and the brackets were unnecessary but I don't think they should matter. I deleted the units but it still won't work.

LucMeekes
23-Emerald III
(To:Walks)

Check again, I updated my post.

Wow, you're right all I had to do was not put the equal sign after first declaring the function and thank you because that probably would have taken me a while to figure out haha.

Top Tags