Jump to content

Is it possible to compute real(z) without breaking it into (a+bi)?


Recommended Posts

Posted

Given z is a complex number: a+bi, the function real is defined as real(z) = a;

 

For my purpose this is not satisfactory, I cannot break z into its real and imaginary parts. I am wondering if it is possible to express the function in terms of elementary functions: +, -, *, /, ^, cos, sine, log, exp....

 

Only z or constants must be used as paramaters to these functions, never a or b. Other functions that break z up cannot be used, for example: real(z) = z-imag(z) is not a valid solution.

 

My gut feeling tells me this is impossible, I would greatly appreciate a solution or verification that there is none. Thanks a lot!

 

- Moosie

Posted

But it isn't breaking up your complex number into real and imaginary parts... a complex number is already broken into real and imaginary parts, as you said z = a+bi. Do you have a way to write complex numbers without them already being broken into real and imaginary parts?

Posted

Assuming you can you write [math]z[/math] in polar form: if [math]z=re^{i\theta}[/math] then [math]\Re(z)=r\cos(\theta)[/math]. Does that count as a solution or is taking the argument not allowed?

Posted (edited)

Thanks for the quick responses.

 

@Mr Skeptic: The reason I do not want to break it up into real and imaginary parts is that I am developing a mathematical command line program (a bit like a mini mathematica) and I want to express it this way so that my simplifcation sub-routine can simplify a function that uses it with other functions, it's a bit complicated but my goal has an important purpose, despite it being a bit odd.

 

@ the tree: that involves calculating abs(z) which will help with some simplifications (refering to my above point) but calculating abs(z) also breaks it apart to find sqrt(a*a+b*b), if there is a way of calculating abs using my initial restrictions then I will find it very handy.

 

--

 

My first attempt was to find a complex number (c+di) which when multiplied by z will result in 'a'. After some simple algebra I got:

 

c = a^2/(a^2+b^2)

d = -ab/(a^2+b^2)

 

But I have run into the same problem again, expressing c and d in terms of z (without 'a' and 'b' being separate) with elementary functions.

Edited by BigMoosie
Added 2nd part of post.
Posted

Out of interest, how are you storing complex numbers? Based on your question, it's not as an ordered array which would have been my first guess as to how they were stored.

Posted

Complex numbers are being stored as an ordered array [a,b], but that doesn't mean they can't be expressed as mod-arg or any other form by being in combination with functions, such as prod(abs([a,b]), cis(arg([a,b]))).

 

The thing is that if real() is used in conjunction with other functions (outside of the 'real'), then often doing the most direct simplification will dig the expression into a hole where it needs to be expanded in order to be simplified further. I was hoping there would be another way of calculating real() in cases where it gets stuck and it can try an alternative heuristic.

 

An example of possible input into the program:

 

"x = 1+4i"

"y = x+pi(e^4-sin(ix))"

"simplify(y)"

 

->

 

sum(x, product(sum(pow([e,0], negate(sin(product([0,1], x)))))))

 

It will then try to produce a representation of the value with the real and imaginary parts separated by manipulating the functions then displaying it in a typical mathematical way, it will never try to produce a decimal representation unless the command to do so is sent.

 

It is easy enough to find formulas on the web for expanding things like tan^2(w+z) in different ways but nobody seems to try to do so with real() or imag(), perhaps that is because there is no way. If no way is clear then I will abandon this approach.

Posted

Ug. So you want to start with complex formulas and find a function that can express the real portion of the result using part of the formula?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.