0

Consider a function that maps a complex function z->f(z) to it's multivariable counterpart (x,y)->f(x,y)

complex2multivar[z_] := ComplexExpand[Through[{Re, Im}[z]]]

Here are some results:

As expected:

complex2multivar[2 #^2 &[x + I y]]
{2 x^2 - 2 y^2, 4 x y}

As expected:

t1[z_] := 2 z^2
complex2multivar[t1[x + I y]]
{2 x^2 - 2 y^2, 4 x y}    

NOT as expected:

t2[z_] := 2. z^2
complex2multivar[t2[x + I y]]
{(0. + 0. I) + 2. x^2 - 2. y^2, (0. + 0. I) + 4. x y}

Please explain this unexpected behavior.

How can this be fixed such that I can use pure functions like

(a # + b) / (c # + d) &

where the a,b,c,d are of type

Real + Real I

for example

a = 1.4 + .7 I
nilo de roock
  • 9,657
  • 3
  • 35
  • 77

0 Answers0