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

SOLVED
Highlighted
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

1 ACCEPTED SOLUTION

Accepted Solutions

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

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.

Success!
Luc

4 REPLIES 4

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

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.

Success!
Luc

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

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.

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

Check again, I updated my post.

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

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.

Announcements