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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Extract Real parts from an equation??

ptc-4451268
1-Newbie

Extract Real parts from an equation??

Hello,

I have attached my mathcad sheet (ver 14).

I have an equation, and I need to extract the real and imaginary parts. However, my equation is full of variables, and mathcad says "this variable is undefined". It is undefined because it isn't known, its just a variable. I don't know how to tell analytix that my variable is just a variable, it could be any number.

Anyway, I would LOVE LOVE LOVE if somebody could help me!

Thanks!

2 REPLIES 2

"variable is undefined" is an error mesaage from the numeric engine. All variables have to be defined, otherwise a numerical evaluation is not possible. The way to satisfay the numerics is either use the boolean "=" to make an equation (which you may solve symbolically for a distinc variable) or turn the assignment into a function, e.g. write U(R,I):=R*I instead of U:=R*I.

In your worksheet there is no equation, at least not at the and. The expression you have at the end could be separeted symbolically in real and imaginary part by using the Re(...) and Im(...) function, but Mathcad can't do that, as all of your variables could be complex numbers, too. Adding the modifyer "assume, ALL=real" or even better "assume,ALL>0" if thats appropriate would do the job, but not in case of your expression because of the square root of (x+yi). Guess you couldn't separate real and imaginary part by hand either.

ReIm.png

Addendum:

With a little manual calculation to split the square root of a generic complex number in real an imaginary part (Mathcad is not of any help here) you get the desired values.

Look at the attached file if its what you want

real2.png

Top Tags